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.
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.
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.
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.
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.
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.