Android TV-Building TV Apps,Get Started with TV Apps
Note: For details on how to publish your TV apps in Google Play, see Distribute to Android TV.
Android offers a rich user experience that's optimized for apps running on large screen devices,
such as high-definition televisions. Apps on TV offer new opportunities to delight your users from the comfort of their couch.
TV apps use the same structure as those for phones and tablets. This approach means you can create
new TV apps based on what you already know about building apps for Android, or extend your existing apps to also run on TV devices. However, the user interaction model for TV is substantially different from phone and tablet devices. In order to make your app
successful on TV devices, you must design new layouts that can be easily understood from 10 feet away, and provide navigation that works with just a directional pad and a select button.
TV apps use the same structure as those for phones and tablets. This similarity means you can modify
your existing apps to also run on TV devices or create new apps based on what you already know about building apps for Android.
》 See the following documentation for information about the codecs, protocols, and formats supported by Android TV.
》 This section discusses how to modify an existing app to run on TV devices, or create a new one. These are the main components you must use to create an app that runs on TV devices:- Activity for TV (Required) - In your application manifest, declare an activity that is intended to run on TV devices.
- TV Support Libraries (Optional) - There are several Support Libraries available for TV devices that provide widgets for building user interfaces.
》Before you begin building apps for TV, you must:
- Update your SDK tools to version 24.0.0 or higher
The updated SDK tools enable you to build and test apps for TV. - Update your SDK with Android 5.0 (API 21) or higher
The updated platform version provides new APIs for TV apps. - Create or update your app project
In order to access new APIs for TV devices, you must create a project or modify an existing project that targets Android 5.0 (API level 21) or higher.
CATEGORY_LEANBACK_LAUNCHER
intent
filter. This filter identifies your app as being enabled for TV, and is required for your app to be considered a TV app in Google Play. Declaring this intent also identifies which activity in your app to launch when a user selects its icon on the TV home screen.
<application android:banner="@drawable/banner" > ... <activity android:name="com.example.android.MainActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="com.example.android.TvActivity" android:label="@string/app_name" android:theme="@style/Theme.Leanback"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LEANBACK_LAUNCHER" /> </intent-filter> </activity> </application>Caution: If you do not include the
CATEGORY_LEANBACK_LAUNCHER
intent
filter in your app, it is not visible to users running the Google Play store on TV devices. Also, if your app does not have this filter when you load it onto a TV device using developer tools, the app does not appear in the TV user interface.
Declare that your app uses the Leanback user interface required by Android TV. If you are developing an app that runs on mobile (phones, wearables, tablets, etc.) as well as Android TV, set the required
attribute value tofalse
.
If you set the required
attribute value to true
, your app will run only on devices that use the Leanback UI.
<manifest> <uses-feature android:name="android.software.leanback" android:required="false" /> ... </manifest>
<application ... android:banner="@drawable/banner" > ... </application>
Use the android:banner
attribute with the <application>
tag
to supply a default banner for all application activities, or with the <activity>
tag
to supply a banner for a specific activity.
If you decide to use the v17 leanback library for your app, you should note that it is dependent on the v4 support library. This means that apps that use the leanback support library should include all of these support libraries:
- v4 support library
- v7 recyclerview support library
- v17 leanback support library
- v17 leanback library - Provides user interface widgets for TV apps, particularly for apps that do media playback.
- v7 recyclerview library - Provides classes for managing display of long lists in a memory efficient manner. Several classes in the v17 leanback library depend on the classes in this library.
- v7 cardview library - Provides user interface widgets for displaying information cards, such as media item pictures and descriptions.
Note: You are not required to use these support libraries for your TV app. However, we strongly recommend using them, particularly for apps that provide a media catalog browsing interface.
相關文章
- android tv-TV Apps ChecklistAndroidAPP
- android TV-Making TV Apps Searchable,Searching within TV AppsAndroidAPP
- Android TV-Building Layouts for TVAndroidUI
- android tv-Building TV GamesAndroidUIGAM
- android TV-Building TV Channels,Developing a TV Input ServiceAndroidUIdev
- android TV-Building a Details View,Displaying a Now Playing CardAndroidUIAIView
- Android TV開發——RecyclerView For TVAndroidView
- Android Auto-Building Apps for Auto,Getting Started with AutoAndroidUIAPP
- Android TVAndroid
- Android TV-Handling TV HardwareAndroid
- Android TV-Creating TV NavigationAndroidNavigation
- android TV-Recommending TV Content,Android
- 一起看 I/O | Google TV 和 Android TV OS 的最新進展GoAndroid
- Android TV開發總結【RecycleView】AndroidView
- android TV-Working with Channel DataAndroid
- android tv-Managing User InteractionAndroid
- Java TV MHPJava
- Microsoft opens up Office apps for Android tabletsROSAPPAndroid
- PcMagazine:羅技TV、谷歌TV、Roku XDS三大網際網路TV引數對比谷歌
- stf 怎麼使用在 android tv 上Android
- Android TV版小米盒子專版亮相Android
- Android TV端RecyclerView焦點亂跑AndroidView
- Android Jetpack - Android TV 應用開發教程AndroidJetpack
- 鬥魚TV回應直播造人 鬥魚TV直播造娃娃事件始末事件
- [譯]利用 Android 構建 TV 的未來Android
- [譯] 利用 Android 構建 TV 的未來Android
- [譯]SearchFragment --Android TV 開發手冊十二FragmentAndroid
- 蘋果最新的Apple TV怎麼樣?全新Apple TV解析蘋果APP
- Get Started with EC2
- OEM in Apps 11.5.10.2APP
- Why mobile web apps are slowWebAPP
- 如何阻止Google Apps在Android後臺耗電?GoAPPAndroid
- 【原創】.NET Core應用型別(Portable apps & Self-contained apps)型別APPAI
- 聊聊真實的 Android TV 開發技術棧Android
- [譯] Performance testing of Flutter appsORMFlutterAPP
- Testing Flutter apps翻譯FlutterAPP
- 什麼是 Immutable Web AppsWebAPP
- Apps DBA 談Oracle EBS 安全APPOracle