Testing in Android
The security and quality of Android applications are the key factors to its success. Testing helps you discover bugs and errors in your application, measure its accuracy, and also improve security.
Android testing is based on JUnit. JUnit is a framework to write repeatable tests in Java. It evaluates whether the class that is to be tested is working as expected. There are two types of tests to be created in an Android application:
Tests that can run on the Java Virtual Machine (JVM): If you want to test standard Java classes that do not call the Android API, you can use plain JUnit tests. The execution of this type of test is faster because it does not require any time for deployment on an Android device, especially when running on an emulator.
Tests that require the Android SDK: If you need to evaluate classes that use Android API, tests have to be run on an Android device using the Android JUnit extensions. From now on, we will be using this kind of test since we want...