Google previews Android Studio 4.0 and releases new Jetpack libraries at Android Dev Summit
Google is back for more, and this time that doesn’t mean yet another Play Store or API restriction. Instead, Google’s announced a whole bunch of stuff at the Android Dev Summit to help Android developers. It seems the effects of Project Marble are still around since Google’s doing more to improve app performance. We’re even getting a new tool to help debug performance. And speaking of new tools, the Android Jetpack family is growing, with some cool new libraries and functions.
Read on if any of that sounds even mildly interesting to you (I promise this article is short-ish).
Kotlin as a Java alternative has gotten incredibly popular in recent years. It’s gotten so popular that Google now recommends it for Android development over Java. Despite that, there are still a few areas where Kotlin for Android falls short. Luckily, Google has been working on making Kotlin Android development a better experience. If you use Kotlin in your apps, you’ve probably noticed that it takes significantly longer to compile than a similar Java app. With this announcement, Google says it worked hard to make compilation faster, with improvements such as incremental annotation processing and optimizations to R8 for Kotlin. Hopefully, we’ll see the results of these efforts soon.
With the release of Android Pie (API level 28), Google introduced a new set of support libraries under the Jetpack name. These libraries do two main things: They replace the old support and appcompat libraries developers use to provide backward-compatible functionality, and they add some new tools for developers to reduce boilerplate code. Jetpack has been out for a while, but the lineup is expanding today.
Jetpack Benchmarking was announced at Google I/O earlier this year, and it’s now available as a release candidate. Google says this library will make it easier to test the performance of your app, and pinpoint exactly where there are problems. If you’re having performance issues in your app, check it out.
The next new(ish) part of Jetpack is view binding. Similar to the old data binding, it’s meant as a null-safe alternative (important for Kotlin development). However, there are a couple of other notable differences. For one, it works with any layout XML, whether or not it’s wrapped in the
<layout> tag. The other difference is that it does not support layout variables or expressions. If you’re just looking for a convenient alternative to
findViewById(), view binding is a good option. If you need to bind data, then you should stick with data binding.
We’ve spoken about this before, but it’s finally (almost) here. CameraX is a wrapper of sorts for the Camera2 API. It’s supposed to be much simpler to use, though. Instead of leaving it up to the developer to account for device differences, CameraX does all the heavy lifting. It even introduces something called CameraX Vendor Extensions, where manufacturers can release libraries to allow app developers to use first-party camera features in their own apps. Needless to say, this is pretty exciting for both developers and users.
It’s no secret that Android UI development can sometimes be tricky, and boilerplate code can get out of control. Google’s hoping to fix this problem with Jetpack Compose. Built on top of the Kotlin language, Compose allows developers to use a declarative approach to building UIs rather than imperative. This can greatly simplify layout creation.
Compose has been released as a developer preview, and you can try it out now by updating to the latest Android Studio Canary.
Android Studio 4.0
Speaking of the latest version of Android Studio Canary, that’s also being updated today. It’s not 3.7, though. Instead, we’ve got a full version jump to 4.0. As I mentioned (right) before, this version brings support for Jetpack Compose, including live preview and code completion. That’s not it, though. We’ve also finally got full support for
kts script files, Kotlin live templates, and a motion editor, I’m assuming for the MotionLayout.
This isn’t directly related to Android Studio, but it’s still an important part of the app distribution process. In case you didn’t know, developers publishing to the Google Play Store use the Google Play Developer Console to do so. Earlier this year, Google introduced the Internal Testing feature for apps, allowing only specified people to use testing versions of an app. There were a couple of limitations with this testing feature, though.
The first limitation was that Google’s new more-efficient app packages—App Bundles—weren’t compatible with internal testing, forcing developers to use APKs instead. The other was less of a limitation and more of a lacking feature: developers can now upload debuggable artifacts (APKs or App Bundles) to the Internal Test track, making it easier to figure out why an application is having issues on a certain device. It’s now also possible to share links to older internal testing versions.
As you can probably tell, Google’s been pretty busy working on improving the Android developer experience. With Project Marble, and now these new Jetpack libraries, it’s nice to see that Google does think about its developers. If you’re an Android developer, check out the new Jetpack features. If you’re daring, update to Android Studio Canary and play around with Compose. I’m probably going to.
For more details on the Android Dev Summit including the schedule and live streams, check out the official app.
Want more posts like this delivered to your inbox? Enter your email to be subscribed to our newsletter.