![]() When sideloading your app during development, you can test this step by Make this behavior happen by adding a BroadcastReceiver that listens for theĪ.action.INITIALIZE_PROGRAMS action, which the home screen Make your default channel appear before your app is opened.TvContractCompat.requestChannelBrowsable(context, channelId) Note that theĬhannel type must be TYPE_PREVIEW. If you try to add a channel while running in the background, the activity's onActivityResult() method returns the status code RESULT_CANCELED.Ĭreate a channel builder and set its attributes. This prevents your app from displaying a dialog requesting approval to add your channel while the user is running a different app. Your app should ask the system to show newly added channels only when it is running in the foreground. All other channels you create must be selected and accepted by the user before they can appear in the home screen. The default channel automatically appears in the home screen. ![]() The first channel your app creates becomes its default channel. Add it to the dependencies in your adle file: The TvProvider support library makes it easier to use the provider. Note: The READ_EPG_DATA permission was deprecated in Android M (API 23) and is To access the provider's data, add the following permission to your app's manifest: The Android TV home screen uses Android's TvProvider APIs to manage the channels and programs that your app creates. The default channel is special because it automatically appears in the home screen the user does not have to Every app has the option of creating one default channel. Select and approve each channel before it appears in the home screen. Your app can offer any number of channels for the user to add to the home screen. New channel appears in the last row of the home screen.System asks user to approve the new channel.App asks the system to display the channel.App creates the channel and adds it to the TvProvider (at this point the channel is not visible).User discovers a channel in your app and requests to add it to the home screen.The channels that your app creates all follow this life cycle: Note: On the home screen, the Watch Next channel has the label Play Next. For more information, see Add programs to The system creates and maintains this channel. The Watch Next channel is the second row that appears in the home screen, after The user can reorder, hide, and show channels. When your app creates a new channel, the home screen adds it to the bottom of the channel list. Supply recommendations for apps running on earlier versions of Android, your appĪpps can create new channels, add, remove, and update the programs in a channel, and control the order of programs in a channel.įor example an app can create a channel called "What's New" and show cards for newly available programs.Īpps cannot control the order in which channels appear in the home screen. Recommendations for apps running in Android 8.0 (API level 26) and later. Note: Recommendations channels are only available inĪndroid 8.0 (API level 26) and later. (If you'd like to dig deeper into the API, try theĪnd watch the I/O 2017 Android TV session.) This document demonstrates how to add channels and programs to the home screen, update content, handle user actions, and provide the best experience for your users. A channel contains cards for every program available on that channel: The Android TV home screen, or simply the home screen, provides a UI thatĭisplays recommended content as a table of channels and programs. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |