Your Second Kotlin Android App

Aug 29 2023 · Kotlin 1.8.21, Android 13, Android Studio Flamingo | 2022.2.1

Part 1: Create Your App & Learn Jetpack Compose

05. Understand AndroidX

Episode complete

Play next episode

Next
About this episode

Leave a rating/review

See forum comments
Cinema mode Mark complete Download course materials
Previous episode: 04. Customize Android Studio Next episode: 06. Understand Material Design 3

Get immediate access to this and 4,000+ other videos and books.

Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and 4,000+ professional videos in a single subscription, it's simply the best investment you can make in your development career.

Learn more Already a subscriber? Sign in.

Transcript: 05. Understand AndroidX
  1. AndroidX comprises the Android Jetpack libraries.

  2. It is a major improvement over the Android Support Library since it ships separately from the Android Platform.

  3. It also provides backward compatibility across all versions of Android.

  4. Packages in AndroidX have a consistent namespace that starts with androidx. All the previous support libraries have mappings to corresponding AndroidX libraries.

The Google team has a page, (AndroidX Releases)[https://developer.android.com/jetpack/androidx/releases], where you can see the latest releases of all the AndroidX Jetpack libraries. You can also see the release notes for each library. This is normally very helpful in seeing the latest alpha, beta, release candidate and stable releases of each library. AndroidX uses semantic versioning whereas the support libraries used a different versioning scheme.

By default, all projects created with newer Android Studio versions use AndroidX. If you’re using an older version of Android Studio, you can migrate your project to AndroidX. To do this, click on Refactor > Migrate to AndroidX. on your toolbar to migrate your project to AndroidX. Follow the prompts to migrate your project to AndroidX.

Since this project already uses androidX, you don’t need any migration. Navigate to the gradle.properties file. You’ll see that the following line has been added to your project:

android.useAndroidX=true

This is a flag that tells Android Studio to use AndroidX libraries instead of the old support libraries.

For libraries that aren’t migrated to use AndroidX, you set this property in your gradle.properties file:

android.enableJetifier=true

This migrates the third-party libraries to AndroidX by rewriting their binaries. However, this flag can lead to slower build times. Since all libraries in this proeject support AndroidX, you can remove the configuration line.