This sample is designed to run on an Android TV device that supports the assistant (such as the NVIDIA SHIELD). It demonstrates how to interact with the user through the assistant to control playback.
The only dependency required is the leanback support library. If you use Android Studio as recommended, the following dependencies will automatically be installed by Gradle.
git clone https://github.com/googlesamples/leanback-assistant.git
Need more information about getting started with Android TV? Check the official docs.
If you need additional help, our community might be able to help.
We love contributions! :smile: Please follow the steps in the CONTRIBUTING guide to get started. If you found a bug, please file it here.
Licensed under the Apache 2.0 license. See the LICENSE file for details.
compileSdkVersion 26
applicationId "com.example.android.assistantplayback"
minSdkVersion 23
targetSdkVersion 26
versionCode 1
versionName "1.0"
package com.example.android.assistantplayback
uses-permission
Main entrance into the app, loads {@link MainFragment}.
Handles the intent from a global search.
The assistant determines if the content should begin immediately, and lets us know with the boolean extra value, {@link android.support.v4.content.IntentCompat#EXTRA_START_PLAYBACK EXTRA_START_PLAYBACK}. If true, launches {@link PlaybackActivity}, otherwise, launches {@link VideoDetailsActivity}.
Loads {@link PlaybackFragment}.
Builds an activity intent to play a movie. * @param context Used to create an {@link Intent}. @param movieId The id of the movie to play. @return An intent that can be started to play a movie.
Loads {@link VideoDetailsFragment}.
Provides global search on the app's movie catalog. The assistant will query this provider for results.
Note: If you provide WatchAction feeds to Google, then you do not need this class. You should still handle the playback intent and media controls in your fragment. This class enables <a href="on-device">https://developer.android.com/training/tv/discovery/searchable.html">on-device search..