Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Android O: Notification Channels, Background Limits, PIP and More

Android O: Notification Channels, Background Limits, PIP and More

Google has made available the Android O Preview to developers, admonishing them to test their applications on the new OS to be ready when this version of Android becomes publicly available. New in Android O: More Background limits, Notification channels, Picture-in-picture, Autofill, Adaptive icons, and API changes, among others.

There are many new features in Android O for developers, but we have summarized here what we consider to be the main ones:

Notification Channels. Users will have more control over notifications by the introduction of channels. These channels can group messages from multiple applications, and the user can enable/disable a channel, or effect one of its settings: Importance, Sound, Lights, Vibration, Visibility on the lock screen. Notifications no longer have a priority assigned to them, the new seven Importance levels of the channel determining how a notification is displayed and what noise, light or vibration is associated with it. Channels can be grouped across multiple user accounts. This is useful for managing channels on devices used both for work and personal use.

Background Limits. Android O introduces more background limits in order to improve battery life and performance. The areas affected by the new limits are implicit broadcasts, background services, and location updates. Services running in the background are stopped after a few minutes. Applications using such services can be placed on a temporary whitelist for several other minutes in which time they can launch services without limitations. This happens when applications need to handle a task that is visible to the user, such as a high-priority message, when receiving a broadcast, or when executing a pending intent from a notification.

Regarding location updates, applications running in the background will receive such updates only several times each hour. Applications can change this behavior by bringing the application to the foreground, using a foreground service, using the Geofencing API, or using a passive location listener.

Picture-in-picture (PIP). Already available on Android TV, PIP is brought now to Android enabling activities to be shown within other activities. PIP is a special case of multi-window introduced in Android N, and it is especially fit to play video content in it.

Autofill framework. Android O introduces a framework that applications can use to save data and autofill forms in order to save users time and avoid repeating form-filling operations. Examples include working with login data or credit card information.

Adaptive icons. Launchers on various devices will be able to show icons that have different shapes: round, square, squircle, or others. Android O builds launcher icons from two image layers, one for background and one for foreground, and a mask. These icons support visual effects.

Multi-display. Developers can move activities from one display to another on devices with multiple displays.

Java. Android O includes java.time from OpenJDK 8 and java.nio.file and java.lang.invoke from OpenJDK 7. The runtime performance was improved up to 2x on some benchmarks.

Other improvements in Android O include: font resources in XML, wide-gamut color for apps, high-quality Bluetooth audio codecs, WiFi Aware, keyboard navigation, WebView enhancements, etc..

Google lets develops know that this version of Android is a preview; it is not fully stable and subsequent versions will be issued over the following months. To develop for Android O one needs Android Studio 2.4 Canary. The new version of Android can be tested in the emulator or several Nexus and Pixel devices.

Rate this Article