Xamarin.Forms & Xamarin.Essentials Go AndroidX Avatar

Last week we released our official stable NuGet packages for AndroidX, which are an exciting replacement for the Android Support Libraries. AndroidX streamlines components into smaller and easier to update libraries for developers to consume. In the post last week, we also outlined several ways to start migrating your Android applications to take advantage of them. Today, I wanted to talk more about our upcoming plans for AndroidX for both Xamarin.Forms and Xamarin.Essentials.

Image Jetpack logo 2

Upcoming Releases

The upcoming releases of Xamarin.Forms 4.5 and Xamarin.Essentials 1.5, both in pre-release today, offer an upgrade path for developers creating Android apps. Both of the libraries will use AndroidX as their base when your application has its compile target set to Android 10. This means if you are currently compiling against and older version of Android your app will still receive the older support libraries when upgraded to these versions. To change your compile target, you can head into the project settings:

Project settings for Android 10

Once this version is set and you upgrade Xamarin.Forms or Xamarin.Essentials your app will start to use the AndroidX libraries and the migration support. This means even if you have other libraries still using older support libraries you should no problems.

Library Creators Call to Action

Right now is a great time to start upgrading your libraries to use AndroidX. I would recommend checking out the AndroidX pull request to Xamarin.Essentials as it shows you how to multi-target and support all versions of Android with a few lines of code. We recommend releasing new pre-release versions that base off of Xamarin.Forms 4.5 and Xamarin.Essentials 1.5 so all dependencies line up to help upgrades. It may also be helpful to create an issue and track AndroidX progress in your open source project and update the README with this information.

What’s Next?

The next stop for AndroidX is full integration throughout the Xamarin ecosystem. We hope that library creators start to adopt AndroidX so their users have a seamless transition and can start to slowly phase out the older support libraries. In an upcoming release of Visual Studio 2019 and Visual Studio 2019 for Mac you will see AndroidX used throughout all of the Android and Xamarin.Forms templates that use the latest versions of Xamarin.Forms and Xamarin.Essentials.