Pular para o conteúdo

Mais visitados

Visitados recentemente

navigation

Building TV Games

The television screen presents a number of considerations that may be new to mobile game developers. These areas include its large size, its control scheme, and the fact that all players are viewing it simultaneously.

Display

The two main things to keep in mind when developing games for the TV screen are its nature as a shared display and the need to design your game for a landscape orientation.

Consider the shared display

A living-room TV poses design challenges for multiplayer games, in that all players can see everything. This issue is especially relevant to games (such as card games or strategy games) that rely on each player’s possession of hidden information.

Some mechanisms you can implement to address the problem of one player’s eavesdropping on another’s information are:

Support landscape display

A TV is always sideways: You can’t turn it, and there is no portrait orientation. Always design your TV games to be displayed in landscape mode.

Input Devices

TVs don't have touch interfaces, so it's even more important to get your controls right and make sure players find them intuitive and fun to use. Handling controllers also introduces some other issues to pay attention to, like keeping track of multiple controllers, and handling disconnects gracefully. All TV apps, including games, should handle controllers consistently. Read Managing TV Controllers for more information about using TV controllers and Handle controllers for games for specific information about using TV controllers for games.

Manifest

There are a some special things games should include in the Android manifest.

Show your game on the home screen

The Android TV home screen displays games in a separate row from regular apps. To make your game appear in the list of games, set the android:isGame attribute to "true" in your app manifest's <application> tag. For example:

<application
    ...
    android:isGame="true"
    ...
>

Declare support for game controllers

Games controllers may not be available or active for users of a TV device. In order to properly inform users that your game supports a game controller, you must include the following entry in your app manifest:

  <uses-feature android:name="android.hardware.gamepad" android:required="false"/>

Note: When specifying android:hardware:gamepad support, do not set the android:required attribute to "true". If you do this, users won’t be able to install your app on TV devices.

For more information about manifest entries, see App Manifest.

Google Play Game Services

If your game integrates Google Play Game services, you should keep in mind a number of considerations pertaining to achievements, sign-in, saving games, and multiplayer play.

Achievements

Your game should include at least five (earnable) achievements. Only a user controlling gameplay from a supported input device should be able to earn achievements. For more information about achievements and how to implement them, see Achievements in Android.

Sign-in

Your game should attempt to sign the user in on launch. If the player declines sign-in several times in a row, your game should stop asking. Learn more about sign-in at Implementing Sign-in on Android.

Saving

Use Google Play Services Saved Games to store your game save. Your game should bind game saves to a specific Google account, so as to be uniquely identifiable even across devices: Whether the player is using a handset or a TV, the game should be able to pull the game-save information from the same user account.

You should also provide an option in your game's UI to allow the player to delete locally and cloud-stored data. You might put the option in the game's Settings screen. For specifics on implementing saved games using Play Services, see Saved Games in Android.

Multiplayer experience

A game offering a multiplayer experience must allow at least two players to enter a room. For further information about multiplayer games in Android, see the Real-time Multiplayer and Turn-based Multiplayer documentation on the Android developer site.

Exit

Provide a consistent and obvious UI element that lets the user exit the game gracefully. This element should be accessible with the D-pad navigation buttons. Do this instead of relying on the Home button to provide an exit, as that is not consistent nor reliable across different controllers.

Web

Do not enable web browsing in games for Android TV. Android TV does not support a web browser.

Note: You can use the WebView class for logins to services like Google+ and Facebook.

Networking

Games frequently need greater bandwidth to provide optimum performance, and many users prefer ethernet to WiFi to provide that performance. Your app should check for both WiFi and ethernet connections. If your app is for TV only, you do not need to check for 3G/LTE service as you would for a mobile app.

Este site usa cookies para armazenar suas preferências quanto às opções de idioma e exibição específicas ao site.

Receba as dicas e notícias mais recentes para desenvolvedores Android que ajudarão você a ter sucesso no Google Play.

* Campos obrigatórios

Uhu!

Siga o Google Developers no WeChat

Navegar neste site em ?

Você solicitou uma página em , mas sua preferência de idioma para este site está definida como .

Quer alterar sua preferência de idioma e navegar neste site em ? Para alterar a preferência de idioma depois, use o menu de idiomas na parte inferior de cada página.

É preciso ter o nível de API ou superior para esta aula

Este documento está oculto porque o nível de API selecionado para a documentação é o . Para alterar o nível, clique no seletor acima da barra de navegação esquerda.

Para mais informações sobre como especificar o nível de API que o seu app precisa, leia o artigo Compatibilidade com diferentes versões de plataforma.

Take a short survey?
Help us improve the Android developer experience. (April 2018 — Developer Survey)