'टीवी के लिए लिखें' पर माइग्रेट करें
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
Leanback यूज़र इंटरफ़ेस टूलकिट से Compose for Android TV पर माइग्रेट करने के लिए, यह तरीका अपनाएं:
Leanback के मौजूदा वर्शन का आकलन करें. इसके लिए, इस्तेमाल किए जा रहे कॉम्पोनेंट की पहचान करें. इनमें, पहले से तैयार किए गए फ़्रैगमेंट में दिए गए कॉम्पोनेंट भी शामिल हैं. साथ ही, यह समझें कि आपके यूज़र इंटरफ़ेस (यूआई) का स्ट्रक्चर कैसा है और आपके ऐप्लिकेशन में डेटा कैसे फ़्लो करता है.
अपने टीवी ऐप्लिकेशन की अलग-अलग स्क्रीन को Compose में माइग्रेट करें, ताकि आप धीरे-धीरे Compose को समझ सकें और उसका इस्तेमाल करना शुरू कर सकें.
धीरे-धीरे माइग्रेट करने की प्रोसेस के लिए, एक ही ऐप्लिकेशन में Leanback और Compose, दोनों का इस्तेमाल किया जा सकता है. हालांकि, अपने टीवी ऐप्लिकेशन को एक ही गतिविधि में बदलने के लक्ष्य के साथ, एक बार में पूरे फ़्रैगमेंट को बदलकर शुरू करें.
छोटी रकम से शुरू करें. एक साथ सभी डेटा को माइग्रेट न करें. सेटिंग या खाते की स्क्रीन जैसे छोटे कॉम्पोनेंट से शुरू करें और धीरे-धीरे ऐप्लिकेशन पर काम करें.
संसाधन सेक्शन में दिए गए संसाधनों में दस्तावेज़ और उदाहरण देखें.
Jetpack लाइब्रेरी का इस्तेमाल करके, Compose for TV के खास कॉम्पोनेंट का फ़ायदा लें. डिज़ाइन गाइड पढ़ें और जानें कि इस्तेमाल के लिए तैयार कॉम्पोनेंट को अपनी पसंद के मुताबिक कैसे बनाया जा सकता है और उन्हें कैसे बढ़ाया जा सकता है. इससे, टीवी के लिए बेहतर यूज़र इंटरफ़ेस (यूआई) बनाए जा सकते हैं.
Compose के डेक्लेरेटिव प्रोग्रामिंग पैराडाइम के साथ काम करने के लिए, अपने डेटा और स्टेटस मैनेजमेंट को अडैप्ट करें. ऐप्लिकेशन को नए वर्शन के हिसाब से अपडेट करने के लिए, हो सकता है कि आपको अपने ऐप्लिकेशन में डेटा और स्टेटस को मैनेज करने के तरीके में बदलाव करने पड़ें. अपने ऐप्लिकेशन में डेटा और स्टेटस को मैनेज करने के लिए, ViewModel
और Jetpack Compose के स्टेटस मैनेजमेंट के इंटरनल तरीके का इस्तेमाल करें.
अपने ऐप्लिकेशन के ज़्यादा मुश्किल हिस्सों को माइग्रेट करते समय, जांच करें और दोहराएं.
आपको जो भी गड़बड़ियां मिलती हैं उनके लिए, StackOverflow पर मौजूद Android डेवलपर कम्यूनिटी से जुड़ें या हमारे पब्लिक बग ट्रैकर के ज़रिए गड़बड़ियां सबमिट करें.
संसाधन
चाहे आपने Compose का इस्तेमाल पहले कभी न किया हो या आपने इसे इस्तेमाल करना शुरू कर दिया हो, हमारे संसाधनों के बड़े कलेक्शन से आपको Android के आधुनिक डेवलपमेंट टूलकिट, Jetpack Compose की मदद से टीवी यूज़र इंटरफ़ेस (यूआई) बनाने के सबसे सही तरीकों के बारे में जानने में मदद मिलेगी:
इस पेज पर मौजूद कॉन्टेंट और कोड सैंपल कॉन्टेंट के लाइसेंस में बताए गए लाइसेंस के हिसाब से हैं. Java और OpenJDK, Oracle और/या इससे जुड़ी हुई कंपनियों के ट्रेडमार्क या रजिस्टर किए हुए ट्रेडमार्क हैं.
आखिरी बार 2025-07-27 (UTC) को अपडेट किया गया.
[[["समझने में आसान है","easyToUnderstand","thumb-up"],["मेरी समस्या हल हो गई","solvedMyProblem","thumb-up"],["अन्य","otherUp","thumb-up"]],[["वह जानकारी मौजूद नहीं है जो मुझे चाहिए","missingTheInformationINeed","thumb-down"],["बहुत मुश्किल है / बहुत सारे चरण हैं","tooComplicatedTooManySteps","thumb-down"],["पुराना","outOfDate","thumb-down"],["अनुवाद से जुड़ी समस्या","translationIssue","thumb-down"],["सैंपल / कोड से जुड़ी समस्या","samplesCodeIssue","thumb-down"],["अन्य","otherDown","thumb-down"]],["आखिरी बार 2025-07-27 (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/)"]]