Xamarin.Forms & Xamarin.Essentials Go AndroidX

Avatar

James

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.

Feedback Welcome For any issues with AndroidX or Xamarin, please 

file an issue on Developer Community. You may also file an issue within the Xamarin AndroidX GitHub repository. Additionally, share any suggestions for how we can improve the AndroidX experience by filing a suggestion on Developer Community. Lastly, check out our Xamarin AndroidX Migration GitHub repository for some tips and tricks in using the package, known issues, and limitations!

1 comment

Comments are closed. Login to edit/delete your existing comments

  • Avatar
    Charles Roddie

    For users will the process be: update to XF4.5, compile using android version 10.0Q, uninstall all the Android Support Library nuget packages? If so that will be great.

    I found it extremely hard to work out what Android Support Packages do, apart from being related to Android’s inability to update. Online attempts to explain them always seem to assume you already know what they do. So it would be great to not only be able to ignore them, but also not have all the junk appear in nuget package manager.