Chapter 15

Audio, Video, and Using the Camera

What's in this Chapter?

Playing audio and video with the Media Player

Handling audio focus and media button presses

Using the Remote Control Client

Applying audio and video effects

Recording audio and video with the Media Recorder

Recording video and taking pictures using Intents

Previewing recorded video and displaying live camera streams

Taking pictures and controlling the camera

Manipulating raw audio

Using face and feature recognition

The increasing popularity of cloud-based music players, combined with the ubiquity of modern phones with ever-increasing storage capacities, is leading to mobile devices becoming the de facto portable digital media player.

This chapter introduces you to the Android APIs for controlling audio and video playback, controlling the audio focus of the device, and reacting appropriately when other applications take focus or the output channel is changed (for example, when headphones are unplugged).

You'll also learn how to use the Remote Control Client, introduced in Android 4.0. It provides a mechanism for showing users details on the media they're playing and allows them to control the playback from the device's lock screen.

With many devices now including two high-resolution cameras, mobiles have also begun to take the place of non-SLR digital cameras. You'll learn to use the Android camera APIs to take photos and record video using any camera available to the device, as well as displaying the live camera ...

Get Professional Android 4 Application Development, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.