Android Studio 3.2 Canary Review (Part 1) — AndroidX

Lisa Watkins
Code With Lisa
Published in
2 min readJun 16, 2018

This year at Google I/O, Android Studio 3.2 Canary was announced and released for download. Android Studio 3.2 has a variety of exciting features that support other I/O announcements, including Android Jetpack and Android App Bundle.

What better way to test these new features than to refactor an app I haven’t touched in nearly a year? Allow me to take you on a journey of refactoring a simple app that uses the New York Times Search API to retrieve news articles. You can find the source code here.

The first thing I noticed after opening Android Studio 3.2 Canary was a friendly new feature called “Assistant”. Unfortunately, the assistant is not voice activated like the Google Home Mini I received at I/O, but it is a useful little panel that informs you of any software updates to Android Studio.

As I mentioned earlier, Android Jetpack was announced at I/O this year. One of the features of Android Jetpack is the AndroidX library, the new namespace under which Google has refactored the Android Support library. AndroidX also includes Architecture Components. Google’s reasoning for this shift is that the versioning of the support library has become really confusing (I’d venture to say that most Android developers agree), and this way it can be clear going forward which dependencies to include and how the API’s are divided.

Migrating from the Support Library namespace to AndroidX is very simple with Android Studio 3.2. Simply select “Migrate to AndroidX…” from the “Refactor” menu. Not kidding, it’s that easy.

The only issue so far with migrating to AndroidX has been incompatibility with ButterKnife. The generated code from ButterKnife is looking for the old support library namespaces, and not the AndroidX namespace. I saw that this commit in the ButterKnife project aims to fix this issue, but even after cleaning the project and bumping up to ButterKnife 8.8.1, there still appears to be some bugs. For reasons like this, I don’t recommend refactoring your production code to AndroidX until 3.2 is stable and your other dependencies have had time to catch up.

Overall I think this feature worked really well, but it would be nice if 3.2 could inform you on mismatched namespaces between the support library and AndroidX for your dependencies.

Stay tuned for more Android Studio 3.2 Canary reviews, next up I will be exploring the Slice Provider, Navigation Editor, and more.

--

--

Lisa Watkins
Code With Lisa

Engineer, Activist, Cat Lady. Mobile engineering @ Lyft.