Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between android.* vs androidx.* package implementation and usage in android

Google launch an early preview of the new Android extension libraries (AndroidX) which is basically new replacement of existing android support library and architecture packages as per their documentation.

But what is the actual difference between theseandroid and androidx package. Proper use case of these two packages and how can we convert existing android packages to androidx package. Which packages/libraries support these conversion?

like image 340
0xAliHn Avatar asked Aug 30 '18 11:08

0xAliHn


People also ask

What is difference between Android and AndroidX?

AndroidX is a major improvement to the original Android Support Library, which is no longer maintained. androidx packages fully replace the Support Library by providing feature parity and new libraries.

What is the difference between AndroidX and jetpack?

Jetpack is a suite of libraries, tools, and guidance to help developers write high-quality apps easier. Jetpack comprises the androidx. * package libraries, unbundled from the platform APIs.

What is AndroidX used for?

The Android Extension Library, often known as AndroidX, is the new open-source project that is a significant upgrade to the original Android Support Library and can be used to develop, test, package version, and release libraries within Jetpack. The Android Jetpack libraries are part of the AndroidX namespace.

Is AndroidX a support library?

Note: With the release of Android 9.0 (API level 28) there is a new version of the support library called AndroidX which is part of Jetpack. The AndroidX library contains the existing support library and also includes the latest Jetpack components.


2 Answers

AndroidX is basically a big refactoring Google's made on their package structure. They changed the location of many classes to make it clearer which classes are bundled with the system and which ones aren't.

As stated on their docs:

We are rolling out a new package structure to make it clearer which packages are bundled with the Android operating system, and which are packaged with your app's APK. Going forward, the android.* package hierarchy will be reserved for Android packages that ship with the operating system; other packages will be issued in the new androidx.* package hierarchy.

The old support libs up to version 28 will remain available as they are, but the new versions of the support lib will be released under the AndroidX package refactor, starting from version 1.0.0.

Also, as taken from their refactoring list:

Only the package and Maven artifact names are affected; class, method, and field names are not changing.

In other words, they're just organizing their libs. You can read more about that on their blog post.

like image 153
Mauker Avatar answered Oct 24 '22 17:10

Mauker


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 backwards-compatibility across Android releases. AndroidX fully replaces the Support Library by providing feature parity and new libraries. In addition 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 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 androidxpackages 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.

Source : AndroidX Overview

like image 26
Jitendra ramoliya Avatar answered Oct 24 '22 17:10

Jitendra ramoliya