I start new tv app and now I need to develop dynamic preferences for set quality of stream, language of stream etc. So I was planning to use android.preference library and dynamically generate perfs base on stream data. But on https://developer.android.com/guide/topics/ui/settings.html is
Note: This guide explains how to use the AndroidX Preference library. Starting with Android 10, the platform android.preference library is deprecated.
But there is no redirection to replacement. So what to use in place of android.preference library?
Also on that guide is also note:
Note: This guide assumes you are using androidx.preference:preference:1.1.0-alpha04 or higher. Some features might be unavailable on older versions of the library.
so androidx.preference:preference
will be deprecated.
the platform android.preference library is deprecated. But there is no redirection to replacement.
You can check in Android 10 documentation:
The android.preference library is deprecated as of Android 10. Developers should instead use the AndroidX preference library, part of Android Jetpack.
The replacement is the androidx-preference library.
Just use:
dependencies {
def preference_version = "1.1.0"
// Java
implementation "androidx.preference:preference:$preference_version"
// Kotlin
implementation "androidx.preference:preference-ktx:$preference_version"
}
More info about the release notes.
Also:
Note: This guide assumes you are using androidx.preference:preference:1.1.0-alpha04 or higher. Some features might be unavailable on older versions of the library.
It means that while a release is in alpha, APIs may be added, removed, or changed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With