Will use Instrumented Unit Test instead of JUnit test.
Establishing communication with the server requires the use of ASyncTask, an Implementation provided by the Android SDK.
JUnit test isolates itself from the Android SDK environment, meaning any Android libraries will not work. The Android library must be mocked in order for JUnit tests to work. Implementing mock code introduces additional work that is not needed since the libraries already exists in the Android SDK and it may introduce more bugs.
Instrumented Unit Test can use Android libraries since it is integrated with the Android SDK environment.
Will use Instrumented Unit Test instead of JUnit test.
Establishing communication with the server requires the use of ASyncTask, an Implementation provided by the Android SDK.
JUnit test isolates itself from the Android SDK environment, meaning any Android libraries will not work. The Android library must be mocked in order for JUnit tests to work. Implementing mock code introduces additional work that is not needed since the libraries already exists in the Android SDK and it may introduce more bugs.
Instrumented Unit Test can use Android libraries since it is integrated with the Android SDK environment.