O'Reilly logo

Android Programming: The Big Nerd Ranch Guide by Brian Hardy, Bill Phillips

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required