Migrate to Compose for TV
Stay organized with collections
Save and categorize content based on your preferences.
To migrate from the Leanback UI toolkit to Compose for Android TV, follow these steps:
Assess your current Leanback implementation by identifying the components
you're using (including those that are provided inside the prefabricated
fragments) and understanding how your UI is structured and how data flows
through your app.
Migrate individual screens of your TV app to Compose so you can learn and adapt to Compose
gradually.
While you can use both Leanback and Compose within the same app to allow for
a gradual migration process, begin by replacing entire fragments at a time
with a goal of converting your TV application into a single activity.
Start small. Don't try to migrate everything at once. Begin with smaller
components like settings or account screens and gradually work your way
through the app.
Refer to documentation and examples in the resources listed in the
Resources section.
Leverage dedicated components from Compose for TV by using the Jetpack
libraries. Consult our design guides to explore
how you can customize and extend ready-to-use composables to build
beautiful TV UIs.
Adapt your data and state management to support the Compose declarative
programming paradigm. Adaptation might require changes in how you manage
data and state in your app. Use ViewModel
and Jetpack Compose internal state management mechanisms to manage data and
state in your app.
Test and iterate as you migrate more complex parts of your app.
Engage with the active Android developer community on Stack
Overflow for any bugs you encounter, or submit the bugs through
our public bug tracker.
Resources
Whether you're new to Compose or are in the process of migrating to Compose
already, our large collection of resources are here to help you learn best
practices for building TV UIs with the modern Android development toolkit,
Jetpack Compose:
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# Migrate to Compose for TV\n\nTo migrate from the Leanback UI toolkit to Compose for Android TV, follow these steps:\n\n- **Assess your current Leanback implementation** by identifying the components\n you're using (including those that are provided inside the prefabricated\n fragments) and understanding how your UI is structured and how data flows\n through your app.\n\n- **Migrate individual screens** of your TV app to Compose so you can learn and adapt to Compose\n gradually.\n\n - While you can use both Leanback and Compose within the same app to allow for\n a gradual migration process, begin by replacing entire fragments at a time\n with a goal of converting your TV application into a single activity.\n\n - Start small. Don't try to migrate everything at once. Begin with smaller\n components like settings or account screens and gradually work your way\n through the app.\n\n - Refer to documentation and examples in the resources listed in the\n [Resources](#resources) section.\n\n- **Leverage dedicated components** from Compose for TV by using [the Jetpack\n libraries](/jetpack/androidx/releases/tv). Consult our [design guides](/design/ui/tv/guides/components) to explore\n how you can customize and extend ready-to-use composables to build\n beautiful TV UIs.\n\n- **Adapt your data and state management** to support the Compose [declarative\n programming paradigm](/develop/ui/compose/mental-model#paradigm). Adaptation might require changes in how you manage\n data and state in your app. Use [`ViewModel`](/reference/kotlin/androidx/lifecycle/ViewModel)\n and Jetpack Compose internal state management mechanisms to manage data and\n state in your app.\n\n- **[Test](/develop/ui/compose/testing) and iterate** as you migrate more complex parts of your app.\n\nEngage with the active Android [developer community on Stack\nOverflow](https://stackoverflow.com/questions/tagged/android-jetpack-compose-tv) for any bugs you encounter, or submit the bugs through\nour [public bug tracker](/jetpack/androidx/releases/tv#feedback).\n\nResources\n---------\n\nWhether you're new to Compose or are in the process of migrating to Compose\nalready, our large collection of resources are here to help you learn best\npractices for building TV UIs with the modern Android development toolkit,\nJetpack Compose:\n\n- [Compose for TV integration guides](/training/tv/playback/compose)\n- [TV design guides](/design/ui/tv/guides/components)\n- [Introduction to Compose for TV](/codelabs/compose-for-tv-introduction) codelab\n- [Library release notes](/jetpack/androidx/releases/tv)\n- [JetStream](https://github.com/android/tv-samples/tree/main/JetStreamCompose) video streaming sample app\n- [JetCaster](https://github.com/android/compose-samples/tree/main/Jetcaster/tv-app) audio streaming sample app\n- [Component samples](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:tv/samples/src/main/java/androidx/tv/samples/)"]]