Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Ekran główny Androida TV wyświetla polecane treści według kanałów i
programów. Kanały są wyświetlane jako pojedyncze wiersze na ekranie głównym,
karty zawierające wszystkie programy dostępne na danym kanale.
Aplikacja powinna mieć co najmniej 1 kanał. Pierwszy kanał
tworzy kanał domyślny,
a Android TV automatycznie wyświetla ten kanał na ekranie głównym. Twoja aplikacja
mogą oferować inne kanały, ale użytkownik musi je wybrać i zatwierdzić
przed dodaniem ich do ekranu głównego.
Jeśli aplikacja zawiera programy telewizyjne, filmy lub inne treści wideo, zalecamy
obsługujesz podglądy filmów oraz
można zintegrować z kanałem Warte obejrzenia.
Kanałem Warte obejrzenia steruje system Android. Aplikacja może dodawać
powiązane z tym kanałem programy, takie jak programy, które użytkownik oznaczył jako
interesujące, nie są wyświetlane w trakcie oglądania lub są związane z treścią
oglądany przez użytkownika (np. następny odcinek serialu lub następny sezon
programu).
Zapewnianie zgodności
Ekran główny wyświetla rekomendacje na dwa sposoby w zależności od
wersja Androida:
W Androidzie 8.0 (poziom interfejsu API 26) i nowszych aplikacje mogą wyświetlać rekomendacje w jednym lub
więcej kanałów, które pojawiają się w osobnych wierszach. 1 kanał (kanał domyślny)
jest zawsze wyświetlana. Użytkownik może odkrywać inne kanały i dodawać je do swojej strony głównej
ekranu. Dowiedz się, jak tworzyć kanały rekomendacji.
na ekranie głównym.
Przed Androidem 8.0 Android TV pokazuje wszystkie rekomendacje w jednym
wiersza rekomendacji zawsze wyświetlanego na ekranie. Dowiedz się, jak utworzyć
wiersz rekomendacji na stronie głównej
ekranu.
Aby móc wyświetlać rekomendacje na wszystkich wersjach Androida TV, Twoja aplikacja
należy wdrożyć oba interfejsy API rekomendacji. przetestować bieżący systemowy poziom interfejsu API oraz
użyć odpowiedniego interfejsu API do utworzenia wiersza lub kanałów rekomendacji.
Kotlin
if(android.os.Build.VERSION.SDK_INT>=Build.VERSION_CODES.O){// Use the home screen recommendation channels API}else{// Use the recommendations row API}
Java
if(android.os.Build.VERSION.SDK_INT>=Build.VERSION_CODES.O){// Use the home screen recommendation channels API}else{// Use the recommendations row API}
Jeśli Twoja aplikacja została skompilowana na poziomie interfejsu API 25 lub starszym, może nadal działać na
Android TV na poziomie 26. Stary sposób rekomendacji jest zgodny z przewidywaniami,
ale ograniczony:
Wiersz rekomendacji jest automatycznie konwertowany i wyświetla się jako nowy
kanał na ekranie głównym.
Programy na przekształconym kanale odpowiadają na aktualizacje
usług rekomendacji,
ale użytkownik nie może korzystać z interfejsu telewizora do manipulowania programami na kanale
(dodawanie/usuwanie programów, kopiowanie programów do kanału Warte obejrzenia).
Jeśli zaktualizujesz aplikację do poziomu API 26, przekonwertowany kanał
będzie ona nadal widoczna na telewizorach z interfejsem API 26. Telewizor usunie przekonwertowany kanał z
przy pierwszym wyświetleniu w aplikacji kanału utworzonego przy użyciu nowego interfejsu API.
Dzieje się tak natychmiast, gdy aplikacja utworzy
kanału domyślnego,
lub później, gdy użytkownik wybierze i doda dowolny inny kanał utworzony przez Twoją aplikację.
Treść strony i umieszczone na niej fragmenty kodu podlegają licencjom opisanym w Licencji na treści. Java i OpenJDK są znakami towarowymi lub zastrzeżonymi znakami towarowymi należącymi do firmy Oracle lub jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-27 UTC.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-07-27 UTC."],[],[],null,["# Recommend content on the home screen\n\nThe Android TV *home screen* displays recommended content using *channels* and\n*programs*. Channels are displayed as individual rows on the home screen, with\ncards that display all of the available programs for that channel.\n\nYour app should have at least one channel. The first channel your\napp creates becomes its [default channel](/training/tv/discovery/recommendations-channel#default-channel),\nand Android TV displays that channel automatically on the home screen. Your app\ncan offer other channels, but the user must select and approve those channels\nbefore they are added to the home screen.\n\nIf your app features TV shows, movies, or other video content, we recommend that\nyou support [video previews](/training/tv/discovery/preview-videos) and\nintegrate with the [Watch Next channel](/training/tv/discovery/recommendations-channel#watch-next).\nThe Watch Next channel is controlled by the Android system. Your app can add\nuser-related programs to this channel, such as programs that the user marked as\ninteresting, stopped watching in the middle, or that are related to the content\nthe user is watching (like the next episode in a series or next season of a\nshow).\n\nEnsure compatibility\n--------------------\n\nThe home screen displays recommendations two different ways depending on the\nversion of Android:\n\n- In Android 8.0 (API level 26) and later, apps can show recommendations in one or more channels that appear on separate rows. One channel (the default channel) always appears. The user can discover and add the other channels to their home screen. Learn how to create [recommendation channels](/training/tv/discovery/recommendations-channel) on the home screen.\n- Before Android 8.0, Android TV shows all recommendations in a single recommendations row that always appears on the screen. Learn how to create the [recommendation row](/training/tv/discovery/recommendations-row) on the home screen.\n\nTo be able to show recommendations on all versions of Android TV, your app\nshould implement both recommendation APIs. Test the current system API level and\nuse the appropriate API to build the recommendation row or channels. \n\n### Kotlin\n\n```kotlin\nif (android.os.Build.VERSION.SDK_INT \u003e= Build.VERSION_CODES.O) {\n // Use the home screen recommendation channels API\n} else {\n // Use the recommendations row API\n}\n```\n\n### Java\n\n```java\nif (android.os.Build.VERSION.SDK_INT \u003e= Build.VERSION_CODES.O) {\n // Use the home screen recommendation channels API\n} else {\n // Use the recommendations row API\n}\n```\n\nIf your app was compiled using API level 25 or earlier, it can still run on\nAndroid TV in level 26. The old recommendations behavior is forward-compatible,\nbut constrained:\n\n- The recommendations row is automatically converted and appears as a new channel on the home screen.\n- The programs on the converted channel respond to updates from your [recommendation service](/training/tv/discovery/recommendations-row#service), but the user cannot use the TV's UI to manipulate the programs on the channel (add/remove programs, copy programs to the Watch Next channel).\n- If you update the app to API level 26, the converted channel still appears on TVs running API 26. The TV removes the converted channel from the screen the first time your app displays a channel created with the new API. This happens immediately if the app creates a [default channel](/training/tv/discovery/recommendations-channel#the_default_channel), or later when the user selects and adds any other channel created by your app.\n\n| **Note:** This forward-compatible behavior is temporary, it will be removed sometime in the future. To ensure compatibility, the best practice is to implement both APIs, as described above."]]