- An Android app usually has multiple activities, and we move between them by launching intents. In this chapter, you will learn how to write Espresso tests that handles both incoming and outgoing intents. We will do that by looking at the Cat Names app. I've prepared that project in exercise files. Download it, and import in Android Studio. You can put the project anywhere you want.
I put mine under projects, cat-names. If Android Studio asks you to upgrade the Gradle plugin, you can say, Don't remind me again. Let's run the app and see what it does. Click on the green triangle to run the app. Choose your device, and press OK. Cat Names is a two-activity app. Main activity has an added text with three buttons.
Clicking on a button launches ideas activity, which shows you a list of potential names for your cat. Select one, and it will return you to main activity with the added text filled by that name. Next we will look into how this app uses intent to move between the two activities.
- Incoming and outgoing intents
- How intents are used
- Dependency injection
- Why extract dependencies?
- Mockito and Dagger
Skill Level Advanced
Android App Development: Data Persistence Librarieswith Annyce Davis4h 52m Intermediate
Effective Android Testing for Mobile Developerswith Chiu-Ki Chan2h 56m Intermediate
2. Hermetic Test Environment
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.