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

Android supports multimedia by using the open source multimedia system called OpenCORE from PacketVideo Corporation. OpenCORE provides the foundation for Android’s media services, which Android wraps in an easy-to-use API. In addition to the OpenCORE framework, the Android platform is migrating to a Google-written multimedia framework named Stagefright. Both frameworks are provided in version 2.2 (Froyo) and in subsequent versions of the SDK. It’s anticipated that most, if not all, of the multimedia functionality will be handled by the Stagefright code base.

In this chapter, we’ll look at OpenCORE’s multimedia architecture and features, and then use it via Android’s MediaPlayer API to play audio files, take a picture, play videos, and finally record video and audio from the emulator. To begin, let’s look at OpenCORE’s multimedia architecture.

10.1. Introduction to multimedia and OpenCORE

10.2. Playing audio

10.3. Playing video

10.4. Capturing media

10.5. Recording video

10.6. Summary