Book Image

Mastering Android Game Development

By : Raul Portales
Book Image

Mastering Android Game Development

By: Raul Portales

Overview of this book

Table of Contents (18 chapters)
Mastering Android Game Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
API Levels for Android Versions
Index

Declaring a TV Activity


Android TV uses the Leanback interface, which is designed for big screens controlled by a remote. This UI displays apps and games in a different way from phones. The launcher is also different. Because of this, apps and games need to declare an Activity with a particular intent filter so the Leanback launcher can find them and make them available to the user.

This intent filter will declare the app to be available for launch on a Leanback interface.

The easiest way to proceed is to create a new Activity that extends from our normal activity and then override some methods if necessary to adapt to the TV interface. For now, we will create YassTvActivity that just extends YassActivity:

public class YassTvActivity extends YassActivity {
}

We will then declare it on AndroidManifest.xml with the proper intent filter:

<activity
  android:name=".YassTvActivity"
  android:label="@string/app_name"
  >
  <intent-filter>
    <action android:name="android.intent.action...