Mobile
June 16, 2022

Best of Android @ I/O 22

Best of Android @ I/O 22

Every year Google treats us android developers to a whole load of features, and this year was no exception. We got a huge list of new tools to play with, and improvements from app launch right down to how our views update in Android Studio.

Here’s our top improvements we think are worth a look at.

Apps for every screen

Google has made it very clear that they’re back to taking tablets seriously. Gone are the days of being able to just make your app bigger, it’s time to optimise for the space we have. Thanks to huge, pocketable, screens like that of the galaxy fold, this will affect more users than you’d think.

You don’t have to worry about working out layouts for every possible pixel size - you can employ a similar system to iOS with size classes.  This allows you to make the most out of screen sizes without having to build something bespoke for every single size. Think web CSS breakpoints, only a little more locked down. There's no code for this out of the box, but Google has provided a sample which demonstrates how you can achieve this effect. The goal is to have your root level work out the size of the device, and pass down a simplified class to its child views.

If you follow their examples, you'd get compact which is generally your phone, medium which is a larger device like an open galaxy fold, and expanded for those huge tablets, like the upcoming official Google tablet.

We can use these size classes to determine what navigation we should use, and how we should layout our views in general. It doesn’t make sense to have a tab bar on a big tablet, nor does it make sense to have one row  in a table take up the full width of a 13” screen.

Compose doesn't have built in support for this (yet), but Google gave us a lovely new code sample that helps us get to grips with it, with now in android.

Google said they’d promote apps that support tablets, so this could be a great opportunity for not just your users to enjoy your app more, but for more users to find it.

There’s enough for us to write an entire article about large screens, but we’ll recommend you read Google’s dedicated page here if you’d like to learn more.

For some quick design wins, checkout exercises to prepare your app here.

Baseline profiles

With about a 40% launch time improvement on the table, you’d be silly to ignore these.

Profiles have been around for a while thanks to Google Play, but we've never quite had control like this. The way they work is quite smart, in that essentially, some of the work that your app does on startup, can now be sped up by telling Android what work will be done, allowing it to compile this ahead of time. This means that on install these methods run much faster, resulting in a faster launch.

Faster launch means better engagement.

Getting started is pretty simple for such a powerful feature. You’ll build a baseline profile on an emulator or device, upload it to the play store with your app, and let them take care of the rest on install.

It's worth checking out the guide on how to implement these, with a quick path to getting started, here.

Health Connect

Having tried to build apps that use health in the past, we know it’s never been quite as easy as it should be on Android. Theres too many providers to try and integrate with, and every new device seems to have its own new health store. Things are a lot better now with the introduction of easier to use tech thats designed to remove some of the fragmentation.

Health Connect is very similar to Apple’s HealthKit, creating a simple set of APIs that allow you to read and write not just your own data, but that of others that also write to the same store. Think about an app for managing your weight that could read the existing information about how much you've eaten and how much you've exercised, then apply more data on top of that, or use it to gain insights about why you're not losing weight.

There's lovely new permissions UI allowing you to ask for as little or as much information as you need, allowing users much tighter control over what they share - no one wants their sleeping app to ask for every single possible piece of data out of the box.

With the upcoming wearOS push from Google, now could be a great time to integrate with the health store in preparation. People will begin to spend more time in their health apps, and you should be right there waiting for them.

Learn more here.

Jetpack

The future of Android development looks bright with Jetpack. With continual improvements to its existing APIs, and fantastic replacements for legacy code, there's never been a better time to start using it. Google says that "90% of the top 1000 apps use Jetpack" and we think it shows.

There's plenty to talk about, so here's some of our highlights - they're not all compose, we promise.

  • Drag and Drop is being pushed more throughout the OS to help with the feeling of coherency, so you should add this to your app too. You can create drop zones inside your app to allow for lovely gesture based actions, like moving content around, or even allow for drops from other apps. Imagine you're an app that makes an editor for Instagram style stories, you could allow for dropping of images from the photos app, and then support dragging out the finished story right onto social apps.
  • Navigation has been improved with built-in support for multiple back stacks, and pre-built support for two pane layouts. To make the most of larger screens, it's common practice to have a list of options on the left, with the content taking the majority of the screen on the right. Navigation makes this easier than ever.
  • WIndowManager is part of the many improvements to support foldable and other large screen devices. It makes it a little easier for you to support multi-window environments, and combined with some of the new API's like drag and drop in compose, you can create a truly optimal experience on larger devices that will shine on the play store.
  • JankStats is here to help you ensure that your app is smooth as butter when it's in users hands. There's tools to help you listen for the performance of frames, and find out if they're janky or not. You can even use the aggregator to make sure you're not overwhelmed with data. You could add the listener to your app, then send up the aggregated data to your API to measure it later. For a great start, why not track the performance of your most important screens, like checkout, to build up a better picture of how it feels to your customers.

There's a dedicated video to tell you all about these new APIs and we think its a must watch.

We're already underway making the most of the changes to Compose in our Android SDK and we're loving every second - we hope you'll get to enjoy some of these wonderful new features too.

What are you waiting for?

Make apps smarter,
with Unflow

Thanks for your interest!
Something's gone wrong while submitting the form