I am reading about a room library of Android. I see they changed package android
to androidx
. I did not understand that. Can someone explain, pleas
AndroidX is the open-source project that the Android team uses to develop, test, package, version and release libraries within Jetpack.
AndroidX is a major improvement to the original Android Support Library. Like the Support Library, AndroidX ships separately from the Android OS and provides backward-compatibility across Android releases. AndroidX fully replaces the Support Library by providing feature parity and new libraries.
AndroidX includes the following features:
All packages in AndroidX live in a consistent namespace starting with the string androidx. The Support Library packages have been mapped into the corresponding androidx.* packages. For a full mapping of all the old classes and build artifacts to the new ones, see the Package Refactoring page.
Unlike the Support Library, AndroidX packages are separately maintained and updated. The androidx packages use strict Semantic Versioning
starting with version 1.0.0. You can update AndroidX
libraries in your project independently.
All new Support Library development will occur in the AndroidX library. This includes maintenance of the original Support Library artifacts and introduction of new Jetpack components.
Using AndroidX
See Migrating to AndroidX to learn how to migrate an existing project.
If you want to use AndroidX in a new project, you need to set the compile SDK to Android 9.0 (API level 28) or higher and set both of the following Android Gradle plugin flags to true in your gradle.properties
file.
android.useAndroidX
: When set to true, the Android plugin uses the appropriate AndroidX library instead of a Support Library. The flag
is false by default if it is not specified.
android.enableJetifier
: When set to true, the Android plugin automatically migrates existing third-party libraries to use AndroidX by rewriting their binaries. The flag is false by default if it is
not specified.
For Artifact mappings see this