Google Intros Android Extension Libraries – I/O 2018

AndroidX Mockup

In keeping with the theme of today’s Google I/O 2018 event, Google has now unveiled an early preview of the first groundwork for a new library package called Android extension libraries or AndroidX as Google refers to it. As developers will have guessed, the preview represents a pretty massive change on the way for Android in terms of how its libraries are handled. More directly, this is effectively a refactor that moves unbundled libraries into an AndroidX package. That includes all of the Support Library and Architecture components and is intended to make the distinction of dependencies required by an application easier. The package structure itself has been reworked to “encourage smaller, more focused libraries” and also includes the introduction of Material Components as a drop-in replacement for Design Library. In the shortest terms, this is intended to act as a solid foundation that allows a more modular approach to library imports based on dependencies, while retaining backward-compatibility and allowing Google a more focused approach to its API library. Starting from this refactor, library versions will be reset from 28.0.0 to 1.0.0 and will follow a more strict set of versioning rules.

The early preview is available now via the Android Developers Blog through the source link below. In the meantime, this is also not necessarily going to be as straightforward a jump as previous library updates. It’s also worth pointing out that, developers should be aware that there are known issues with it and it shouldn’t be used on any production-level apps or projects. Migrating to AndroidX requires two steps. The first is source refactoring, which will update Java code, XML resources, and Gradle configuration to reference the refactored classes and Maven artifacts. In Android Studio Canary 14, that can be accomplished on projects aimed at Android P by selecting “refactor” and then selecting “refactor to AndroidX.” Those apps that depend on the older Support Library will also need to undergo dependency translation. That will be automatically applied by the Android Gradle Plugin 3.2.0-alpha14 and the team behind Google’s Android Developer tools is also working to create a standalone tool as a JAR.

There’s no word on when a more stable version of AndroidX will be released but the stable release of 28.0.0 is said to be the final feature release that will be packaged as android.support. All future feature releases being available only as androidx-packaged artifacts.