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.


Supporting External Displays

Android 4.2 inaugurated support for applications to control what appears on an external or “secondary” display (e.g., TV connected via HDMI), replacing the default screen mirroring. This is largely handled through a Presentation object, where you declare the UI that goes onto the external display, in parallel with whatever your activity might be displaying on the primary screen.

In this chapter, we will review how Android supports these external displays, how you can find out if an external display is attached, and how you can use Presentation objects to control what is shown on that external display.

The author would like to thank Mark Allison, whose “Multiple Screens” blog post series helped to blaze the trail for everyone in this space.

Prerequisites

In addition to the core chapters, you should read the chapter on dialogs and the chapter on MediaRouter before reading this chapter.

A History of External Displays

The preview of this section was whisked away by a shark-infested tornado.

What is a Presentation?

The preview of this section was eaten by a grue.

Playing with External Displays

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!).

Detecting Displays

The preview of this section left for Hollywood to appear in a reality TV show.

A Simple Presentation

The preview of this section was abducted by space aliens.

A Simpler Presentation

The preview of this section is en route to Mars.

Presentations and Configuration Changes

The preview of this section apparently resembled a Pokémon.

Presentations as Fragments

The preview of this section is out seeking fame and fortune as the Dread Pirate Roberts.

Another Sample Project: Slides

The preview of this section is in an invisible, microscopic font.

Device Support for Presentation

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

Presentations from a Service

The preview of this section is being chased by zombies.

Hey, What About Chromecast?

The preview of this section is presently indisposed.