Android Programming: The Big Nerd Ranch Guide, Third Edition
by Bill Phillips, Chris Stewart, Kristin Marsicano
21 Unit Testing and Audio Playback
One reason MVVM architecture is so appealing is that it makes a critical programming practice easier: unit testing. Unit testing is the practice of writing small programs that verify the standalone behavior of each unit of your main app. Because BeatBox’s units are each classes, classes are what your unit tests will test.
In this chapter, you will finally play all of the .wav files you loaded in the previous chapter. As you build and integrate sound playback, you will write unit tests for your SoundViewModel’s integration with BeatBox.
Android’s audio APIs are low level for the most part, but there is a tool practically tailor-made for the app you are writing: SoundPool. SoundPool can load ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access