The whole lot it’s essential to find out about Google TV and Android TV OS


Over the previous 12 months, we’ve seen important development of Android TV OS, reaching 220 million month-to-month energetic units with a 47% year-over-year improve. This unbelievable engagement wouldn’t be doable with out our devoted developer group. A large thanks on your contributions.

We’re bringing Android 14 to TV! The following technology of Android offers enhancements in efficiency, sustainability, accessibility, and multitasking that will help you construct partaking apps for TVs.

hasSystemFeature(PackageManager.FEATURE_PICTURE_IN_PICTURE)

For added particulars, seek the advice of the up to date Android TV app high quality pointers and the Android 14 for TV launch notes.

Compose for TV

Compose for TV is now accessible in 1.0.0-beta01. We’ve up to date the developer instruments in Android Studio to incorporate a brand new mission wizard to present you a operating begin with Compose for TV.

Listed below are only a few methods Compose makes it simpler to construct apps for TV:

    • Devoted elements for TV apps. Discover these elements in our design information or in observe by utilizing our new TV Materials Catalog app. Because the earlier alpha launch, we’ve added lists, navigation, chips, and settings screens.
    • Improved enter help and efficiency. We’ve labored laborious to handle focus points and be sure that the UI seems and animates easily.
    • Ease of implementation and in depth styling. Add elements to your app and customise them with minimal code.
    • Broad form-factor help. Reuse enterprise logic out of your telephone, pill, or foldable app to render a TV UI with adjustments that may be as small as merely including a ViewModel.

Beta01 makes two huge adjustments from alpha10:

    • A number of elements have graduated from experimental.
    • The ImmersiveList composable has been faraway from the androidx-tv-material package deal.

Carousel and chip elements, resembling FilterChip, are nonetheless experimental, so that you’ll wish to hold the @ExperimentalTvMaterial3Api annotation in case you are utilizing these elements in your app. For all different elements, now you can take away the @ExperimentalTvMaterial3Api annotation, since these APIs are actually accessible in beta.

We heard your suggestions concerning the selection within the information varieties that signify content material, which made it tough to design a element in such a means that it might lead to much less code. In case you are utilizing the ImmersiveList composable from the alpha launch, change it with a customized implementation of an immersive checklist. Whereas ImmersiveList is now not a part of Compose for TV, you’ll be able to create an immersive checklist with only a few traces of code:

@Composable
enjoyable SampleImmersiveList() {
    val selectedMovie = keep in mind { mutableStateOf<Film?>(null) }


    // Container
    Field(
        modifier = Modifier
            .fillMaxWidth()
            .peak(400.dp)
    ) {
        // Background
        Field(
            modifier = Modifier
                .fillMaxWidth()
                .aspectRatio(20f / 7)
                .background(selectedMovie.background)
        ) {}


        // Rows
        LazyRow(
            modifier = Modifier.align(Alignment.BottomEnd),
            ...
        ) {
            objects(films) { film ->
                MyMovieCard(
                    modifier = Modifier
                        .onFocusChanged {
                            if (it.hasFocus) {
                                selectedMovie.worth = film
                            }
                        },
                    ...
                ) {}
            }
        }
    }
}

A whole snippet is accessible within the immersive checklist pattern.

Additionally seek the advice of the excellent checklist of adjustments within the launch notes emigrate any renamed or moved elements.

Migrate from the Leanback UI toolkit

We advocate following our step-by-step migration information to modify from Leanback to Compose for Android TV.

Assets

Whether or not you’re new to Compose or are within the means of migrating to Compose already, our giant assortment of assets are right here that will help you study greatest practices for constructing TV UIs with the fashionable Android growth toolkit, Jetpack Compose:

Interact with the energetic Android developer group on Stack Overflow for any bugs you encounter, or submit the bugs by means of our public bug tracker.

Thanks on your continued help of Android TV OS. We are able to’t wait to see what you’ll do on Google TV with the Android 14 TV OS!

Recent Articles

Related Stories

Leave A Reply

Please enter your comment!
Please enter your name here

Stay on op - Ge the daily news in your inbox