13Audio Playback Using MediaPlayer

For the next three chapters, you are going to put CriminalIntent on hiatus and build another application. This app will play a historical audio file using the MediaPlayer class.

Figure 13.1  Hello, Moon!

Hello, Moon!

MediaPlayer is the Android class for audio and video playback. It can play media from different sources (like a local file or streamed from the Internet) and in many different formats (like WAV, MP3, Ogg Vorbis, MPEG-4, and 3GPP).

Create a new project named HelloMoon. In the first dialog, select Holo Dark for the app’s theme.

Figure 13.2  Creating HelloMoon with Holo Dark theme

Click Next. This app will not have ...

Get Android Programming: The Big Nerd Ranch Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.