Chapter 10. Multimedia

 

This chapter covers

  • Playing audio and video
  • Controlling the camera
  • Recording audio
  • Recording video

Today, people use cell phones for almost everything but phone calls, from instant messaging to surfing the web to listening to music and even to watching live streaming TV. Nowadays, a cell phone needs to support multimedia to be considered a usable device. In this chapter, we’re going to look at how you can use Android to play audio files, watch video, take pictures, and even record sound and video.

As of Android 2.0, Google decided to phase out the OpenCORE system for Android’s multimedia needs and move to a new multimedia system called Stagefright. As of Android 2.3, Stagefright has subsumed OpenCORE and become its replacement. That being said, most of Android’s interaction with media is abstracted through the MediaPlayer API, hiding the specific implementation of Stagefright, versus OpenCORE in older versions of Android. What this means to you is that by considering which core media formats you wish to support and by carefully developing your application, it’s possible to create applications that will work on Android 2.3 and up as well as older versions of Android that use OpenCORE.

In this chapter, we’ll be looking at Stagefright’s multimedia architecture and features. Moving on from architecture, we’ll explore how to use Stagefright via Android’s MediaPlayer API.

10.1. Introduction to multimedia and Stagefright

10.2. Playing audio

10.3. Playing video

10.4. Capturing media

10.5. Summary