What Developers Need To Know About Android 5.0 Lollipop
|Richard Harris in Android Monday, October 27, 2014|
Google is touting Android 5.0 Lollipop as its largest and most ambitious release for Android and now that the public has been notified of its upcoming availability, we thought we’d provide an overview of the latest L iteration.
Google’s main goal with the new mobile SDK is to provide a more seamless experience across phones, tablets, wearables, TVs, cars and anything else someone can dream up to connect. It includes a number of new features for users and thousands of new APIs for developers.
It's About Material Design
Its all based around material design, giving developers an expanded UI toolkit for integrating the new design patterns easily into apps. New 3D views let provides the ability to set a z-level to raise elements off of the view hierarchy and cast realtime shadows, even as they move. Built-in activity transitions take the user seamlessly from one state to another with animated motion. The material theme adds transitions for activities, including the ability to use shared visual elements across activities.
Ripple animations are available for buttons, checkboxes, and other touch controls in an app. Developers can also define vector drawables in XML and animate them in a variety of ways. Vector drawables scale without losing definition, so they are perfect for single-color in-app icons. A new system-managed processing thread called RenderThread keeps animations smooth even when there are delays in the main UI thread.
Mo Power is Mo Better
Of course, what good are any new features without more power and this latest Android rendition should provide a remarkably smoother and more powerful computing experience. Android now runs exclusively on the new ART runtime, built from the ground up to support a mix of ahead-of-time (AOT), just-in-time (JIT), and interpreted code. It’s supported on ARM, x86, and MIPS architectures and is fully 64-bit compatible.
The ART runtime will allow developers to create apps offering improved performance and responsiveness. Efficient garbage collection reduces the number and duration of pauses for GC events, which fit comfortably within the v-sync window so an app doesn’t skip frames. ART also dynamically moves memory to optimize performance for foreground uses.
Android 5.0 introduces platform support for 64-bit architectures which is used by the Nexus 9's NVIDIA Tegra K1. Optimizations provide larger address space and improved performance for certain compute workloads. Apps written in Java run as 64-bit apps automatically with no modifications needed. If an app uses native code, Google has extended the NDK to support new ABIs for ARM v8, and x86-64, and MIPS-64.
Android 5.0 also offers improved A/V sync. The audio and graphics pipelines have been instrumented for more accurate timestamps, enabling video apps and games to display smooth synchronized content.
Stay Connected with Notifications
Notifications in Android 5.0 are more visible, accessible, and configurable. Varying notification details may appear on the lock screen if desired by the user. Users may elect to allow none, some, or all notification content to be shown on a secure lock screen. Key notification alerts such as incoming calls appear in a heads-up notification which is a small floating window that allows the user to respond or dismiss without leaving the current app.
Developers can now add new metadata to notifications to collect associated contacts (for ranking), category, and priority. And a new media notification template provides consistent media controls for notifications with up to 6 action buttons, including custom controls such as "thumbs up" with no more need for RemoteViews.
Supersize the Screen
For those developers looking to make it to the big screen, Android TV provides a TV platform to maximize an app's big screen experience. Android TV is centered around a simplified home screen experience that allows users to discover content easily, with personalized recommendations and voice search.
Developers can now create big screen appropriate experiences for app and game content and support interactions with game controllers and other input devices. To help build cinematic, 10-foot UIs for television, Android provides a leanback UI framework in the v17 support library.
The Android TV Input Framework (TIF) allows TV apps to handle video streams from sources such as HDMI inputs, TV tuners, and IPTV receivers. It also enables live TV search and recommendations via metadata published by the TV Input and includes an HDMI-CEC Control Service to handle multiple devices with a single remote.
The TV Input Framework provides access to a wide variety of live TV input sources and brings them together in a single user interface for users to browse, view, and enjoy content. Building a TV input service for an app’s content can help make the content more accessible on TV devices.
Android 5.0 introduces a redesigned Overview space (formerly called Recents) that’s more versatile and useful for multitasking than before. New APIs allow developers to show separate activities in an app as individual documents alongside other recent screens. There is also the ability to take advantage of concurrent documents to provide users instant access to more of content or services.
Next Generation Connectivity Means Faster Performance
Android 5.0 adds new APIs that allow apps to perform concurrent operations with Bluetooth Low Energy (BLE), allowing both scanning (central mode) and advertising (peripheral mode).
New multi-networking features allow apps to query accessible networks for available features such as whether they are Wi-Fi, cellular, metered, or provide certain network features. Then the app can request a connection and respond to connectivity loss or other network changes.
NFC APIs now allow apps to register an NFC application ID (AID) dynamically. There is also the ability to set the preferred card emulation service per active service and create an NDEF record containing UTF-8 text data.
Souped Up Graphics
Support for Khronos OpenGL ES 3.1 now provides games and other apps the highest-performance 2D and 3D graphics capabilities on supported devices. OpenGL ES 3.1 adds compute shaders, stencil textures, accelerated visual effects, high quality ETC2/EAC texture compression, advanced texture rendering, standardized texture size and render-buffer formats, and more.
Android 5.0 Lollipop also introduces the Android Extension Pack (AEP), a set of OpenGL ES extensions that gives access to features like tessellation shaders, geometry shaders, ASTC texture compression, per-sample interpolation and shading, and other advanced rendering capabilities. With AEP developers can deliver high-performance graphics across a range of GPUs.
Crank Up the Volume
A new audio-capture design offers low-latency audio input. The new design include a fast capture thread that never blocks except during a read; fast track capture clients at native sample rate, channel count, and bit depth; and normal capture clients offer resampling, up/down channel mix, and up/down bit depth. Multi-channel audio stream mixing allows professional audio apps to mix up to eight channels including 5.1 and 7.1 channels.
Apps can expose their media content and browse media from other apps, then request playback. Content is exposed through a queryable interface and does not need to reside on the device.
Apps have finer-grain control over text-to-speech synthesis through voice profiles that are associated with specific locales, quality and latency rating. New APIs also improve support for synthesis error checking, network synthesis, language discovery, and network fallback.
Android now includes support for standard USB audio peripherals, allowing users to connect USB headsets, speakers, microphones, or other high performance digital peripherals. Android 5.0 Lollipop also adds support for Opus audio codecs. There also are new MediaSession APIs for controlling media playback to make it easier to provide consistent media controls across screens and other controllers.
Lights, Camera, Action
Android 5.0 introduces all new camera APIs that provide the ability to capture raw formats such as YUV and Bayer RAW, and control parameters such as exposure time, ISO sensitivity, and frame duration on a per-frame basis. With the new fully-synchronized camera pipeline developers can capture uncompressed full-resolution YUV images at 30 FPS on supported devices.
Along with images, there is the option to capture metadata like noise models and optical information from the camera. Apps sending video streams over the network can now take advantage of H.265 High Efficiency Video Coding (HEVC) for optimized encoding and decoding of video data.
Android 5.0 also adds support for multimedia tunneling to provide the best experience for ultra-high definition (4K) content and the ability to play compressed audio and video data together.
Brown Bag it At Work
To enable BYOB for enterprise environments, a new managed provisioning process creates a secure work profile on the device. In the launcher, apps are shown with a Work badge to indicate that the app and its data are administered inside of the work profile by an IT administrator.
Notifications for both the personal and work profile are visible in a unified view. The data for each profile is always kept separate and secure from each other, including when the same app is used by both profiles.
For company-owned devices, IT administrators can start with a new device and configure it with a device owner. Employers can issue these devices with a device owner app already installed that can configure global device settings.
Grab That Screen
Android 5.0 lets developers add screen capturing and screen sharing capabilities to an app. With user permission, there is the ability to can capture non-secure video from the display and deliver it over the network.
Wave at the Tilt A Whirl
In Android 5.0, a new tilt detector sensor helps improve activity recognition on supported devices, and a heart rate sensor reports the heart rate of the person touching the device. New interaction composite sensors are now available to detect special interactions such as a wake up gesture, a pick up gesture, and a glance gesture.
The initial release for Android 5.0 includes a version of Chromium for WebView based on the Chromium M37 release, adding support for WebRTC, WebAudio, and WebGL. Chromium M37 also includes native support for all of the Web Components specifications: Custom Elements, Shadow DOM, HTML Imports, and Templates. Developers can use Polymer and its material design elements in a WebView without needing polyfills.
The Chromium layer is also now updatable from Google Play. As new versions of Chromium become available, users can update from Google Play to ensure they get the latest enhancements and bug fixes for WebView, providing the latest web APIs and bug fixes for apps using WebView on Android 5.0 and higher.
New job scheduling APIs allow the opportunity to optimize battery life by deferring jobs for the system to run at a later time or under specified conditions, such as when the device is charging or connected to Wi-Fi.
A new dumpsys batterystats command generates battery usage statistics developers can use to understand system-wide power use and understand the impact of an app on the device battery including the ability to look at the history of power events, approximate power use per UID and system component, and more. Battery Historian is a new tool to convert the statistics from dumpsys batterystats into a visualization for battery-related debugging.
All of these new features and more are powered by thousands of new API’s. You can find an API overview as well as other documentation on the Android Developer website.
Read more: http://developer.android.com/about/versions/lollip...