New Android O API’s Out Now – Time to Charge Up Your App Development

New Android O API's Out Now-Time to Charge Up Your App Development
Subscribe

With the announcement of Android O at the Google I/O 2017, developer circles have been abuzz with speculation and activity. Google promised some fantastic new features in its latest release and now with the beta version out, developers can’t wait to get cracking and explore what they can do with Android Oreo.

Now would be a good time to start testing your apps for Android O. Making your app compatible with Android O will make sure your users have a seamless experience when they upgrade to Oreo. If you enrolled in the beta program, you would have received an invitation to the developer’s preview automatically. All you need to do is download a device system image over-the-air, install your app from Google Play and test. Make any updates to the code if required. Once you have made the updates, the app should run smoothly and adapt to all the behavior changes of Android O. once you are happy with the app’s performance, it is advisable to publish the updated app on Google Play immediately, without changing the app’s existing platform targeting.

The Android O preview is free and lets you access all the tools that are required to make your app compatible with the latest update. The preview has everything you will need to test your current app’s performance on different screen sizes, network technologies, CPU/GPU chipsets and hardware structures.

To access the developer preview, you need to first make sure you are on the latest version of Android Studio. That would give you access to the following through the SDK Manager:

– Developer preview SDK and Tools

– Developer preview Emulator System Image

– Developer preview Emulator Image for Android TV and

– Developer preview support libraries 

Preparing your app for Android O behavior changes

Making your app compatible with Android O will help you enhance your app performance, offer better interactions, give your users heightened security and drive greater user engagement. However, it would serve you well to be aware of and prepared for the behavior changes your app will see on Android O.

So here are some of the key new features and changes you will see in the developer preview. Find out how you can make the best of them to deliver faster and better app performances:

Notifications

The Android 8.0 (API level 26) gives you a lot more ways to make your notifications truly engaging. Some of the most interesting features are:

– Notification channels let you create user-customizable channels for different kinds of notifications. So you can let users segment notifications into channels like ‘promotional’ or ‘payment alert’. Users can then choose different settings for different notification channels.

Android O also introduces notification dots that will indicate the presence of unread notifications on an app launcher icon. Check out Notification badges for more.

Snoozing is a feature that will allow users to make a notification to go away for certain duration of time, after which it will reappear to remind the user.

Notification timeouts will let you specify a time after which the notification will stop showing. You can do this using setTimeoutAfter().

Specific notifications can have specific background colors. You can also set the desired background color using setColor(). Do this to draw attention to selective, urgent notifications.

Picture-in-Picture Mode

One of the most awaited features on Android O is the PIP or Picture-in-Picture mode that allows your app to show active in a corner of the screen while the user switches to a different app. While an activity is in the PIP mode, it stays in a paused state but continues to show content. You need to make sure that your app continues to run and does not pause playback in the onPause() handler. Check out Multi-Window Lifecycle for more.

App Shortcuts

Another highly anticipated feature of the Android O is the ability to pin app shortcuts onto the launcher through deep linking. These shortcuts enable users to start commonly used in-app tasks quickly. With Android O, you can use ACTION_CREATE_SHORTCUT intent to create app shortcuts that can be managed using the ShortcutManager class. This intent can also be used to create legacy launcher shortcuts that don’t interact with ShortcutManager. Earlier, this intent could create only legacy launcher shortcuts. Check out the Pinning Shortcuts and Widgets feature guide for more info and you can learn how to code app shortcuts like a pro

Autofill Framework

To make the dreaded forms easier on you and your users, Android O has introduced the Autofill Framework that makes filling forms like login, personal details, and credit card forms easier. Users can choose to activate or deactivate autofill in Settings > SystemLanguages & input > Advanced > Input assistance > Autofill service. Check out exactly how to do this at the Autofill Framework Overview.

Downloadable Fonts

By enabling downloadable fonts, Android O lets you reduce your APK size, helping app performance and installation success rate as well as allows multiple apps to share the same font. With this new feature, you can skip bundling fonts into the APK and instead, just request fonts from a provider.

Also, fonts will now be automatically available as a full Android resource so you can use them directly with XML.

Autosizing TextView

Taking adaptive layouts a step further, you can now expand or contract the size of your app’s text using the TextView. This would be great for those who use different devices and like to read a lot.

WebView APIs

WebView allows you to render Chrome webpages in apps. The new update provides all new APIs that will help these pages load and work even more seamlessly and improve your app’s stability and security. Some of these APIs include Version API, Google SafeBrowsing API, Termination Handle API and Renderer Importance API.

Apart from these, there are a host of other new features and APIs that will help you deliver much better app performances. Some other features of the Android O are:

– Wide gamut colors
– Multi-display support
– Maximum screen aspect ratio
– App categories
– Speech Output
– Keyboard navigation clusters
– New StrictMode detectors
Cached data
Content refresh requests
Volume Shaper
– Media metrics
– Custom document providers

Conclusion

There are a number of other features out there and every developer has something to be excited about with the preview of Android O. if you haven’t started yet, download the Android O developer preview today and optimize your app to make the best use of the new tools and capabilities Android O has in store.

Hiral Atha is the Co-Founder and Technical Head of MoveoApps.