Google I/O 2019: News and Announcements for Android Developers

I attended my first I/O this year, and it was a really good experience. While there, I Tweeted about some of the announcements in real-time. You can check them out on my twitter page.

But I wanted to dig a bit deeper and give more detail about news related to Android development that came out of I/O. There are other developments and Android-related announcements, but here I’ll only mention one connected specifically to Android development.

Many people I spoke to think that the announcements weren’t quite as shiny as in previous years. I kind of agree with this, but at the same time I’m satisfied with them. This year the focus was mostly on privacy, security, and stability—and I’m ok with this. Here is the developer keynote if you missed it:

Without further ado, let’s get started. Here’s what we’ll cover:

Jetpack Compose

The most significant announcement made on the Android side was, without a doubt, Jetpack Compose. The initial impression I had was that it’s more or less a reactive DSL for creating UI, but it’s bigger than that. It’s actually Android UI reimagined.

It doesn’t use the current views like TextView and ImageView (although it can). Instead, it introduces new UI elements. I think this will be the biggest change on Android development ever. There were not any other fundamental changes announced other than Fragments. Architecture components are big, but they’re mostly wrappers around existing frameworks to make things easier. So I’m really excited about it (as you can probably tell). I hope this is the first step of a bigger change in the Android environment.

Jetpack Compose is at a very early stage—not even alpha yet. The Googlers I talked to think it’ll take some time to be production-ready and probably years to be adopted. Currently it’s released in AOSP as source code. If you want to try it you’d have to checkout a code that will provide a special version of Android Studio, required plugins, and the library itself (and build it). It’s only available for Linux and Mac OS for now.

You can find the information on how to get it running here:

Checking out and building the sample may sound scary, but it’s relatively easy to do and is also well-documented. If you want to talk about it or give feedback, there’s a #compose channel on Kotlin’s Slack. You can join Kotlin’s Slack group here if you’re not a member yet. If you want to learn more about it, this is the introductory video for Compose:

Kotlin-First

Another exciting piece of news for me is that Kotlin has become Google’s preferred and recommended language for Android development. What that means is new features in various libraries will be designed in a Kotlin-idiomatic way, and then Java will be supported later (if it can be).

My guess is that Compose won’t even be supported in Java. Also, documentation and examples will be provided in Kotlin initially. Another notable announcement was that Android Q APIs will have nullability annotations that will give errors instead of warnings for Kotlin null safety interop. All this means the Kotlin support will be well ahead of the KTX library. With this news, they also stated that Java and C++ support will continue.

Coroutines First

Coroutines are now the preferred method to perform async operations on Android. Yigit Boyar explicitly stated this. I think one of the most important actions taken in this new Kotlin-first shift is support for coroutines on Jetpack. Almost all of the architecture components libraries got coroutines support, and it was promised that we’ll see more. You can watch the I/O talk about the coroutines here:

Security & Privacy

Jetpack Security Library provides tools to implement security best practices. It provides encryption with performance. It makes it easy to encrypt files and shared preferences.

With location permission changes on Q, users can choose if they want to permit apps to access their locations when the app is in both the background and foreground.

Activities in the background will not be able to start other activities, except in special cases.

Apps won’t be able to turn on/off the WiFi on Q. Instead they’ll have to use the new system dialog that would allow users to change settings without leaving the app.

SYSTEM_ALERT_WINDOW permission is deprecated on Q. It was mostly used to display floating chat bubbles over any screen, like the Facebook Messenger one. Android Q will add support for chat bubbles without SYSTEM_ALERT_WINDOW permissions.

Dark Mode

Android Q will improve its dark mode support even further. The appcompat library also provides these improvements. The new force dark mode option will do a smart conversation of an existing theme to a dark one. Apps will have to opt in to allow force dark mode, and developers can test this out with an Android Q emulator.

Gesture Navigation

Some device manufacturers already offer gesture navigation. With Android Q, gesture navigation is now supported by Android. I think this will save developers some headaches because they won’t need to support different implementations for different device models.

Gesture navigation provides a bottom inset for home navigation and left and right insets for going back. Developers can mark areas to override insets if they have some kind of gesture like drag and drop, resize or swipe on the sides. You can watch the Android Developers video for more information:

CameraX

Jetpack’s CameraX library is one of my favorite announcements. Even taking a profile picture could be a big pain because of different implementations of the API from different manufacturers. This library will handle device-specific problems, so developers won’t need to handle special cases. It will also support features like Portrait, HDR, Night, and Beauty. The functionality could be expanded with add-ons. You can read more on the CameraX Android developer page:

ViewBindings

ViewBindings is similar to DataBindings. If you just want to avoid findViewById(), ViewBindings will be the way to go. ViewBindings uses the Gradle plugin instead of annotation processing. Using the Gradle plugin provides two things. First, it doesn’t have an effect on build time, and second, it has compile time safety. It will be available with Android Studio 3.6. Here’s a more detailed look at this new library:

Conclusion

There were many other smaller announcements that didn’t make it into this post, but I think we covered the most significant ones here.

If you’re using Kotlin for development, then the primary announcements are likely enough to satisfy you. Android Q will probably released around the end of the year. So it might be worth following future developments on Q.

Compose is another topic to keep an eye on through the year. I think there’s still a lot of room to improve the Android platform. So I hope the Android team continues to make fundamental changes in the mold of Compose.

I also hope to be able to attend the I/O next yeah and feel the excitement on the scene again!

Fritz

Our team has been at the forefront of Artificial Intelligence and Machine Learning research for more than 15 years and we're using our collective intelligence to help others learn, understand and grow using these new technologies in ethical and sustainable ways.

Comments 0 Responses

Leave a Reply

Your email address will not be published. Required fields are marked *

wix banner square