The following is the first few sections of a chapter from The Busy Coder's Guide to Android Development, plus headings for the remaining major sections, to give you an idea about the content of the chapter.


Media Routes

Android can send audio and video to a variety of places, such as:

There is a common API for determining which of these “places” are available and allowing the user to choose which of these “places” should be used for a given bit of media. This common API centers around a MediaRouter, which is the focus of this chapter.

Prerequisites

Understanding this chapter requires that you have read the core chapters of the book. In addition, you should read the chapters on advanced action bar techniques and the appcompat-v7 action bar backport.

Terminology

First, we need to establish some common ground in terms of…, well, terms.

Media

In this chapter, “media” refers to audio or video. This includes both media that may be stored on the device as well as media that may be streamed from some other source, frequently over the Internet.

Route

A route indicates where media should be played. There are three categories of routes that concern us:

MediaRouter

MediaRouter is the name of a class (actually, two classes) that know what routes are possible given the current environment and what routes are selected for the different categories (by default or by user choice).

A Tale of Two MediaRouters

The preview of this section is unavailable right now, but if you leave your name and number at the sound of the tone, it might get back to you (BEEEEEEEEEEEEP!).

Attaching to MediaRouter

The preview of this section is unavailable right now, but if you leave your name and number at the sound of the tone, it might get back to you (BEEEEEEEEEEEEP!).

User Route Selection with MediaRouteActionProvider

The preview of this section was traded for a bag of magic beans.

Using Live Video Routes

The preview of this section is presently indisposed.

Using Remote Playback Routes

The preview of this section will not appear here for a while, due to a time machine mishap.