Android 4.2, A second version of Jelly Bean

Android 4.2 has performance optimizations, a refreshed system UI, and great new features for users and developers. This document provides a glimpse of what's new for developers.

Welcome to Android 4.2, the latest version of Jelly Bean!
See the Android 4.2 APIs document for a detailed look at the new developer APIs.
Find out more about the new Jelly Bean features for users at www.android.com.

Faster, Smoother, More Responsive


Android 4.2 on phone and tabletAndroid 4.2 builds on the performance improvements already included in Jelly Bean — vsync timing, triple buffering, reduced touch latency, and CPU input boost — and adds new optimizations that make Android even faster.
Improvements in the hardware-accelerated 2D renderer make common animations such as scrolling and swiping smoother and faster. In particular, drawing is optimized for layers, clipping and certain shapes (rounded rects, circles and ovals).
A variety of WebView rendering optimizations make scrolling of web pages smoother and free from jitter and lags.


Android’s Renderscript Compute is the first computation platform ported to run directly on a mobile device GPU. It automatically takes advantage of GPU computation resources whenever possible, dramatically improving performance for graphics and image processing. Any app using Renderscript on a supported device can benefit immediately from this GPU integration without recompiling.

Refined, refreshed UI


Android 4.2 refines the Jelly Bean user experience and brings familiar Android UI patterns such as status bar, system bar, and notifications window to all tablets.
All screen sizes now feature the status bar on top, with pull-down access to notifications and a new Quick Settings menu. The familiar system bar appears on the bottom, with buttons easily accessible from either hand. The Application Tray is also available on all screen sizes.

One tablet, many users


Now several users can share a single Android tablet, with each user having convenient access to a dedicated user space. Users can switch to their spaces with a single touch from the lock screen.
On a multiuser device, Android gives each user a separate environment, including user-specific emulated SD card storage. Users also have their own homescreens, widgets, accounts, settings, files, and apps, and the system keeps these separate. All users share core system services, but the system ensures that each user's applications and data remain isolated. In effect, each of the multiple users has his or her own Android device.
Users can install and uninstall apps at any time in their own environments. To save storage space, Google Play downloads an APK only if it's not already installed by another user on the device. If the app is already installed, Google Play records the new user's installation in the usual way but doesn't download another copy of the app. Multiple users can run the same copy of an APK because the system creates a new instance for each user, including a user-specific data directory.
For developers, multi-user support is transparent — your apps do not need to do anything special to run normally in a multi-user environment and there are no changes you need to make in your existing or published APKs. The system manages your app in each user space just as it does in a single-user environment.

New ways to engage users


Calendar lock screen widget
You can extend app widgets to run on the lock screen, for instant access to your content.

Lock screen widgets

In Android 4.2, users can place app widgets directly on their lock screens, for instant access to favorite app content without having to unlock. Users can add as many as five lock screen widgets, choosing from widgets provided by installed apps. The lock screen displays each widget in its own panel, letting users swipe left and right to view different panels and their widgets.
Like all app widgets, lock screen widgets can display any kind of content and they can accept direct user interaction. They can be entirely self-contained, such as a widget that offers controls to play music, or they can let users jump straight to an Activity in your app, after unlocking along the way as needed.
For developers, lock screen widgets offer a great new way to engage users. They let you put your content in front of users in a location they’ll see often, and they give you more opportunities to bring users directly into your app.
You can take advantage of this new capability by building a new app widget or by extending an existing home screen widget. If your app already includes home screen widgets, you can extend them to the lock screen with minimal change. To give users an optimal experience, you can update the widget to use the full lock screen area when available and resize when needed on smaller screens. You can also add features to your widgets that might be especially useful or convenient on the lock screen.

 

Daydream

Daydream is an interactive screensaver mode that starts when a user’s device is docked or charging. In this mode, the system launches a daydream — a remote content service provided by an installed app — as the device screensaver. A user can enable Daydream from the Settings app and then choose the daydream to display.
Daydreams combine the best capabilities of live wallpapers and home screen widgets, but they are more powerful. They let you offer the any kind of content in a completely new context, with user interactions such as flipping through photos, playing audio or video, or jumping straight into your app with a single touch.
Because daydreams can start automatically when a device is charging or docked, they also give your app a great way to support new types of user experiences, such as leanback or exhibition mode, demo or kiosk mode, and "attract mode" — all without requiring special hardware.
Daydream screensaver mode
Daydream lets you create powerful interactive screensavers that display any kind of content.
Daydreams are similar to Activities and can do anything that Activity can do — from rendering a UI hierarchy (without using RemoteViews) to drawing directly using Canvas, OpenGL, SurfaceTexture, and more. They can play video and audio and they can even accept direct user interaction. However, daydreams are not Activities, so they don’t affect the backstack or appear in Recents and they cannot be launched directly from your app.
Implementing a daydream is straightforward and you can take advantage of UI components and resources that you’ve already created for other parts of your app. You can provide multiple daydreams in your app and you can offer distinct content and display settings for each.

External display support


Android 4.2 introduces platform support for external displays that goes far beyond mirroring — apps can now target unique content to any one or multiple displays that are attached to an Android device. Apps can build on this to deliver new kinds of interaction and entertainment experiences to users.

Display manager

Apps interact with displays through a new display manager system service. Your app can enumerate the displays and check the capabilities of each, including size, density, display name, ID, support for secure video, and more. Your app can also receive callbacks when displays are added or removed or when their capabilities change, to better manage your content on external displays.

Presentation window

To make it easy to show content on an external display, the framework provides a new UI object called a Presentation — a type of dialog that represents a window for your app’s content on a specific external display. Your app just gives the display to use, a theme for the window, and any unique content to show. The Presentation handles inflating resources and rendering your content according to the characteristics of the targeted display.

You can take full control of two or more independent displays using Presentation.
A Presentation gives your app full control over the remote display window and its content and lets you manage it based on user input events such as key presses, gestures, motion events, and more. You can use all of the normal tools to create a UI and render content in the Presentation, from building an arbitrary view hierarchy to using SurfaceView or SurfaceTexture to draw directly into the window for streamed content or camera previews.

Comments