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.


Putting the TVs All Together: Decktastic

This book profiles many ways of getting content to a TV:

It is entirely possible to create one app that can support all of these modes from one code base, though you are constrained by the most limited option. In this case, RemotePlaybackClient is the most limited option, as its API is designed to tell some external device to play some media, whereas the other options can support comparatively arbitrary user interfaces rendered through normal Android widgets.

In this chapter, we will review the Presentation/Decktastic sample application. This app is designed to give the user a roster of slide-based presentations to choose from, then deliver one of those presentations. The presentation will appear on the external display (e.g., TV or projector), while the presenter will be able to control the presentation either from a touchscreen-equipped Android device or a remote control.

Prerequisites

You should read the following chapters before this one:

Reading up on specific hardware, like the Amazon Fire TV, is a good idea but not as critical.

Introducing Decktastic

Before we get into discussing the implementation of Decktastic, we should first review what the app looks like and how it functions.

Launcher UI

If you were to set up Decktastic on some test device and run it, the first thing that you would see is a media browsing UI built from the leanback-v17 support library, showing you a roster of the available presentations to choose from:

Decktastic Media Browser
Figure 834: Decktastic Media Browser

This UI works fine on TVs and on tablets. On phones… it gets a bit cramped.

Tapping on a presentation selects it:

Decktastic Media Browser, With Selected Presentation
Figure 835: Decktastic Media Browser, With Selected Presentation

Presentation UI

Tapping on the presentation again opens it up into a ViewPager-based UI for the presenter:

Decktastic Main UI, Showing Presentation and Open Overflow
Figure 836: Decktastic Main UI, Showing Presentation and Open Overflow

However, who sees what depends a bit upon the available hardware:

To move through the slides, you can:

Implementing Decktastic

The preview of this section is sleeping in.