Audio Video and Using the Camera

WHAT'S IN THIS CHAPTER?_

> Playing audio and video with the Media Player

> Packaging audio as an application resource

> Using the Video View for video playback

> 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

> Reading and modifying image EXIF data

> Adding media to the Media Store

> Manipulating raw audio

> Using speech recognition

The only modern technology that can compete with mobile phones for ubiquity is the portable digital media player. As a result, the multimedia capabilities of mobile devices are a significant consideration for many consumers.

Android's open platform and provider-agnostic philosophy ensures that it offers a multimedia API capable of playing and recording a wide range of image, audio, and video formats, both locally and streamed.

The Camera API and OpenCORE multimedia platform expose these capabilities to your applications, providing comprehensive multimedia functionality.

In this chapter you'll learn how to play and record multimedia content including audio, video, and still images, as well as use the camera to capture images and preview and record live video.

You'll also learn how to manipulate raw audio files using the Audio Track and Audio Record classes, add newly recorded media files to the Media Store, and make use of speech recognition to add voice input to your applications.

PLAYING AUDIO AND VIDEO

Android includes a comprehensive Media Player to simplify the playback of audio and video. This section describes how to use it to control and manipulate media playback within your applications.

Android 2.1 (API level 7) supports the following multimedia formats for playback as part of the base framework. Note that some devices may support playback of additional file formats:

Audio

>

AAC LC/LTP

>

HE-AACvl (AAC+)

>

HE-AACv2 (Enhanced AAC+)

>

AMR-NB

>

AMR-WB

>

MP3

>

MIDI

>

Ogg Vorbis

>

PCM/WAVE

Video

>

H.263

>

H.264 AVC

>

MPEG-4 SP

Mobile Apps Made Easy

Mobile Apps Made Easy

Quick start guide to skyrocket your offline and online business success with mobile apps. If you know anything about mobile devices, you’ve probably heard that famous phrase coined by one of the mobile device’s most prolific creators proclaiming that there’s an app for pretty much everything.

Get My Free Training Guide


Post a comment