The following is the first few sections of a chapter from The Busy Coder's Guide to Android Development, plus headings for the remaining major sections, to give you an idea about the content of the chapter.


Testing with JUnit4

Presumably, you will want to test your code, beyond just playing around with it yourself by hand. Android offers several means of testing your app, covered in this next series of chapters.

The first Android SDK testing solution we will examine is the JUnit test framework. This is a standard Java unit testing framework. Originally, Android itself “baked in” a copy of JUnit3. This has since been deprecated, and modern Android testing is done with a separate copy of JUnit4, in the form of a AndroidJUnitRunner class.

In this chapter, we will review how to apply the AndroidJUnitRunner to run JUnit4 tests for our Android apps.

Prerequisites

Understanding this chapter requires that you have read the core chapters of the book.

This chapter also assumes you have some familiarity with JUnit, though you certainly do not need to be an expert. You can learn more about JUnit at the JUnit site.

Instrumentation Tests and Unit Tests

The preview of this section will not appear here for a while, due to a time machine mishap.

Writing JUnit4 Test Cases

The preview of this section is out seeking fame and fortune as the Dread Pirate Roberts.

Configuring Gradle

The preview of this section took that left turn at Albuquerque.

Running Your Instrumentation Tests

The preview of this section is out seeking fame and fortune as the Dread Pirate Roberts.

Testing Android Library Projects

The preview of this section is sleeping in.

Testing and Runtime Permissions

The preview of this section was traded for a bag of magic beans.

The Android Test Orchestrator

The preview of this section was eaten by a grue.