Android 4.3 Welcome to Android 4.3, a sweeter version of Jelly Bean! Android 4.3 includes performance optimizations and great new features for users and developers. This document provides a glimpse of what's new for developers. See the Android 4.3 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.3 builds on the performance improvements already included in Jelly Bean — vsync timing, triple buffering, reduced touch latency, CPU input boost, and hardware-accelerated 2D rendering — and adds new optimizations that make Android even faster. For a graphics performance boost, the hardware-accelerated 2D renderer now optimizes the stream of drawing commands, transforming it into a more efficient GPU format by rearranging and merging draw operations. For multithreaded processing, the renderer can also now use multithreading across multiple CPU cores to perform certain tasks. Android 4.3 also improves rendering for shapes and text. Shapes such as circles and rounded rectangles are now rendered at higher quality in a more efficient manner. Optimizations for text include increased performance when using multiple fonts or complex glyph sets (CJK), higher rendering quality when scaling text, and faster rendering of drop shadows. Improved window buffer allocation results in a faster image buffer allocation for your apps, reducing the time taken to start rendering when you create a window. For highest-performance graphics, Android 4.3 introduces support for OpenGL ES 3.0 and makes it accessible to apps through both framework and native APIs. On supported devices, the hardware accelerated 2D rendering engine takes advantage of OpenGL ES 3.0 to optimize texture management and increase gradient rendering fidelity. OpenGL ES 3.0 for High-Performance Graphics Android 4.3 introduces platform support for Khronos OpenGL ES 3.0, providing games and other apps with highest-performance 2D and 3D graphics capabilities on supported devices. You can take advantage of OpenGL ES 3.0 and related EGL extensions using either framework APIs or native API bindings through the Android Native Development Kit (NDK). Key new functionality provided in OpenGL ES 3.0 includes acceleration of advanced visual effects, high quality ETC2/EAC texture compression as a standard feature, a new version of the GLSL ES shading language with integer and 32-bit floating point support, advanced texture rendering, and standardized texture size and render-buffer formats. You can use the OpenGL ES 3.0 APIs to create highly complex, highly efficient graphics that run across a range of compatible Android devices, and you can support a single, standard texture-compression format across those devices. OpenGL ES 3.0 is an optional feature that depends on underlying graphics hardware. Support is already available on Nexus 7 (2013), Nexus 4, and Nexus 10 devices. Enhanced Bluetooth Connectivity Connectivity with Bluetooth Smart devices and sensors Now you can design and build apps that interact with the latest generation of small, low-power devices and sensors that use Bluetooth Smart technology. Android 4.3 gives you a single, standard API for interacting with Bluetooth Smart devices. Android 4.3 introduces built-in platform support for Bluetooth Smart Ready in the central role and provides a standard set of APIs that apps can use to discover nearby devices, query for GATT services, and read/write characteristics. With the new APIs, your apps can efficiently scan for devices and services of interest. For each device, you can check for supported GATT services by UUID and manage connections by device ID and signal strength. You can connect to a GATT server hosted on the device and read or write characteristics, or register a listener to receive notifications whenever those characteristics change. You can implement support for any GATT profile. You can read or write standard characteristics or add support for custom characteristics as needed. Your app can function as either client or server and can transmit and receive data in either mode. The APIs are generic, so you’ll be able to support interactions with a variety of devices such as proximity tags, watches, fitness meters, game controllers, remote controls, health devices, and more. Support for Bluetooth Smart Ready is already available on Nexus 7 (2013) and Nexus 4 devices and will be supported in a growing number of Android-compatible devices in the months ahead. AVRCP 1.3 Profile Android 4.3 adds built-in support for Bluetooth AVRCP 1.3, so your apps can support richer interactions with remote streaming media devices. Apps such as media players can take advantage of AVRCP 1.3 through the remote control client APIs introduced in Android 4.0. In addition to exposing playback controls on the remote devices connected over Bluetooth, apps can now transmit metadata such as track name, composer, and other types of media metadata. Platform support for AVRCP 1.3 is built on the Bluedroid Bluetooth stack introduced by Google and Broadcom in Android 4.2. Support is available right away on Nexus devices and other Android-compatible devices that offer A2DP/AVRCP capability. Support for Restricted Profiles A tablet owner can set up one or more restricted profiles in Settings and manage them independently. Your app can offer restrictions to let owners manage your app content when it's running in a profile. Android 4.3 extends the multiuser feature for tablets with restricted profiles, a new way to manage users and their capabilities on a single device. With restricted profiles, tablet owners can quickly set up separate environments for each user, with the ability to manage finer-grained restrictions in the apps that are available in those environments. Restricted profiles are ideal for friends and family, guest users, kiosks, point-of-sale devices, and more. Each restricted profile offers an isolated and secure space with its own local storage, home screens, widgets, and settings. Unlike with users, profiles are created from the tablet owner’s environment, based on the owner’s installed apps and system accounts. The owner controls which installed apps are enabled in the new profile, and access to the owner’s accounts is disabled by default. Apps that need to access the owner’s accounts — for sign-in, preferences, or other uses — can opt-in by declaring a manifest attribute, and the owner can review and manage those apps from the profile configuration settings. For developers, restricted profiles offer a new way to deliver more value and control to your users. You can implement app restrictions — content or capabilities controls that are supported by your app — and advertise them to tablet owners in the profile configuration settings. You can add app restrictions directly to the profile configuration settings using predefined boolean, select, and multi-select types. If you want more flexibility, you can even launch your own UI from profile configuration settings to offer any type of restriction you want. When your app runs in a profile, it can check for any restrictions configured by the owner and enforce them appropriately. For example, a media app might offer a restriction to let the owner set a maturity level for the profile. At run time, the app could check for the maturity setting and then manage content according to the preferred maturity level. If your app is not designed for use in restricted profiles, you can opt out altogether, so that your app can't be enabled in any restricted profile. Optimized Location and Sensor Capabilities Google Play services offers advanced location APIs that you can use in your apps. Android 4.3 optimizes these APIs on supported devices with new hardware and software capabilities that minimize use of the battery. Hardware geofencing optimizes for power efficiency by performing location computation in the device hardware, rather than in software. On devices that support hardware geofencing, Google Play services geofence APIs will be able to take advantage of this optimization to save battery while the device is moving. Wi-Fi scan-only mode is a new platform optimization that lets users keep Wi-Fi scan on without connecting to a Wi-Fi network, to improve location accuracy while conserving battery. Apps that depend on Wi-Fi for location services can now ask users to enable scan-only mode from Wi-Fi advanced settings. Wi-Fi scan-only mode is not dependent on device hardware and is available as part of the Android 4.3 platform. New sensor types allow apps to better manage sensor readings. A game rotation vector lets game developers sense the device’s rotation without having to worry about magnetic interference. Uncalibrated gyroscope and uncalibrated magnetometer sensors report raw measurements as well as estimated biases to apps. The new hardware capabilities are already available on Nexus 7 (2013) and Nexus 4 devices, and any device manufacturer or chipset vendor can build them into their devices. New Media Capabilities Modular DRM framework To meet the needs of the next generation of media services, Android 4.3 introduces a modular DRM framework that enables media application developers to more easily integrate DRM into their own streaming protocols, such as MPEG DASH (Dynamic Adaptive Streaming over HTTP, ISO/IEC 23009-1). Through a combination of new APIs and enhancements to existing APIs, the media DRM framework provides an integrated set of services for managing licensing and provisioning, accessing low-level codecs, and decoding encrypted media data. A new MediaExtractor API lets you get the PSSH metadata for DASH media. Apps using the media DRM framework manage the network communication with a license server and handle the streaming of encrypted data from a content library. VP8 encoder Android 4.3 introduces built-in support for VP8 encoding, accessible from framework and native APIs. For apps using native APIs, the platform includes OpenMAX 1.1.2 extension headers to support VP8 profiles and levels. VP8 encoding support includes settings for target bitrate, rate control, frame rate, token partitioning, error resilience, reconstruction and loop filters. The platform API introduces VP8 encoder support in a range of formats, so you can take advantage of the best format for your content. VP8 encoding is available in software on all compatible devices running Android 4.3. For highest performance, the platform also supports hardware-accelerated VP8 encoding on capable devices. Video encoding from a surface Starting in Android 4.3 you can use a surface as the input to a video encoder. For example, you can now direct a stream from an OpenGL ES surface to the encoder, rather than having to copy between buffers. Media muxer Apps can use new media muxer APIs to combine elementary audio and video streams into a single output file. Currently apps can multiplex a single MPEG-4 audio stream and a single MPEG-4 video stream into a single MPEG-4 output file. The new APIs are a counterpart to the media demuxing APIs introduced in Android 4.2. Playback progress and scrubbing in remote control clients Since Android 4.0, media players and similar applications have been able to offer playback controls from remote control clients such as the device lock screen, notifications, and remote devices connected over Bluetooth. Starting in Android 4.3, those applications can now also expose playback progress and speed through their remote control clients, and receive commands to jump to a specific playback position. New Ways to Build Beautiful Apps Access to notifications Notifications have long been a popular Android feature because they let users see information and updates from across the system, all in one place. Now in Android 4.3, apps can observe the stream of notifications with the user's permission and display the notifications in any way they want, including sending them to nearby devices connected over Bluetooth. You can access notifications through new APIs that let you register a notification listener service and with permission of the user, receive notifications as they are displayed in the status bar. Notifications are delivered to you in full, with all details on the originating app, the post time, the content view and style, and priority. You can evaluate fields of interest in the notifications, process or add context from your app, and route them for display in any way you choose. The new API gives you callbacks when a notification is added, updated, and removed (either because the user dismissed it or the originating app withdrew it). You'll be able to launch any intents attached to the notification or its actions, as well as dismiss it from the system, allowing your app to provide a complete user interface to notifications. Users remain in control of which apps can receive notifications. At any time, they can look in Settings to see which apps have notification access and enable or disable access as needed. Notification access is disabled by default — apps can use a new Intent to take the user directly to the Settings to enable the listener service after installation. View overlays You can now create transparent overlays on top of Views and ViewGroups to render a temporary View hierarchy or transient animation effects without disturbing the underlying layout hierarchy. Overlays are particularly useful when you want to create animations such as sliding a view outside of its container or dragging items on the screen without affecting the view hierarchy. Optical bounds layout mode A new layout mode lets you manage the positioning of Views inside ViewGroups according to their optical bounds, rather than their clip bounds. Clip bounds represent a widget’s actual outer boundary, while the new optical bounds describe the where the widget appears to be, within the clip bounds. You can use the optical bounds layout mode to properly align widgets that use outer visual effects such as shadows and glows. Custom rotation animation types Apps can now define the exit and entry animation types used on a window when the device is rotated. You can set window properties to enable jump-cut, cross-fade, or standard window rotation. The system uses the custom animation types when the window is fullscreen and is not covered by other windows. Screen orientation modes Apps can set new orientation modes for Activities to ensure that they are displayed in the proper orientation when the device is flipped. Additionally, apps can use a new mode to lock the screen to its current orientation. This is useful for apps using the camera that want to disable rotation while shooting video. Intent for handling Quick Responses Android 4.3 introduces a new public Intent that lets any app handle Quick Responses — text messages sent by the user in response to an incoming call, without needing to pick up the call or unlock the device. Your app can listen for the intent and send the message to the caller over your messaging system. The intent includes the recipient (caller) as well as the message itself. Support for International Users More parts of Android 4.3 are optimized for RTL languages. RTL improvements Android 4.3 includes RTL performance enhancements and broader RTL support across framework UI widgets, including ProgressBar/Spinner and ExpandableListView. More debugging information visible through the uiautomatorviewer tool. In addition, more system UI components are now RTL aware, such as notifications, navigation bar and the Action Bar. To provide a better systemwide experience in RTL scripts, more default system apps now support RTL layouts, including Launcher, Quick Settings, Phone, People, SetupWizard, Clock, Downloads, and more. Utilities for localization Pseudo-locales make it easier to test your app's localization. Android 4.3 also includes new utilities and APIs for creating better RTL strings and testing your localized UIs. A new BidiFormatter class provides a simple API for wrapping Unicode strings, so that RTL-script data is displayed as intended in LTR-locale messages and vice-versa. To let you use this utility more broadly in your apps, the BidiFormatter API is also now available for earlier platform versions through the Support Package in the Android SDK. To assist you with managing date formatting across locales, Android 4.3 includes a new getBestDateTimePattern() method that automatically generates the best possible localized form of a Unicode UTS date for a locale that you specify. It’s a convenient way to provide a more localized experience for your users. To help you test your app more easily in other locales, Android 4.3 introduces pseudo-locales as a new developer option. Pseudo-locales simulate the language, script, and display characteristics associated with a locale or language group. Currently, you can test with a pseudo-locale for Accented English, which lets you see how your UI works with script accents and characters used in a variety of European languages. Accessibility and UI Automation Starting in Android 4.3, accessibility services can observe and filter key events, such as to handle keyboard shortcuts or provide navigation parity with gesture-based input. The service receives the events and can process them as needed before they are passed to the system or other installed apps. Accessibility services can declare new capability attributes to describe what their services can do and what platform features they use. For example, they can declare the capability to filter key events, retrieve window content, enable explore-by-touch, or enable web accessibility features. In some cases, services must declare a capability attribute before they can access related platform features. The system uses the service’s capability attributes to generate an opt-in dialog for users, so they can see and agree to the capabilities before launch. Building on the accessibility framework in Android 4.3, a new UI automation framework lets tests interact with the device’s UI by simulating user actions and introspecting the screen content. Through the UI automation framework you can perform basic operations, set rotation of the screen, generate input events, take screenshots, and much more. It’s a powerful way to automate testing in realistic user scenarios, including actions or sequences that span multiple apps. Enterprise and Security Wi-Fi configuration for WPA2-Enterprise networks Apps can now configure the Wi-Fi credentials they need for connections to WPA2 enterprise access points. Developers can use new APIs to configure Extensible Authentication Protocol (EAP) and Encapsulated EAP (Phase 2) credentials for authentication methods used in the enterprise. Apps with permission to access and change Wi-Fi can configure authentication credentials for a variety of EAP and Phase 2 authentication methods. Android sandbox reinforced with SELinux Android now uses SELinux, a mandatory access control (MAC) system in the Linux kernel to augment the UID based application sandbox. This protects the operating system against potential security vulnerabilities. KeyChain enhancements The KeyChain API now provides a method that allows applications to confirm that system-wide keys are bound to a hardware root of trust for the device. This provides a place to create or store private keys that cannot be exported off the device, even in the event of a root or kernel compromise. Android Keystore Provider Android 4.3 introduces a keystore provider and APIs that allow applications to create exclusive-use keys. Using the APIs, apps can create or store private keys that cannot be seen or used by other apps, and can be added to the keystore without any user interaction. The keystore provider provides the same security benefits that the KeyChain API provides for system-wide credentials, such as binding credentials to a device. Private keys in the keystore cannot be exported off the device. Restrict Setuid from Android Apps The /system partition is now mounted nosuid for zygote-spawned processes, preventing Android applications from executing setuid programs. This reduces root attack surface and likelihood of potential security vulnerabilities. Systrace uses a new command syntax and lets you collect more types of profiling data. Enhanced Systrace logging Android 4.3 supports an enhanced version of the Systrace tool that’s easier to use and that gives you access to more types of information to profile the performance of your app. You can now collect trace data from hardware modules, kernel functions, Dalvik VM including garbage collection, resources loading, and more. Android 4.3 also includes new Trace APIs that you can use in your apps to mark specific sections of code to trace using Systrace begin/end events. When the marked sections of code execute, the system writes the begin/end events to the trace log. There's minimal impact on the performance of your app, so timings reported give you an accurate view of what your app is doing. You can visualize app-specific events in a timeline in the Systrace output file and analyze the events in the context of other kernel and user space trace data. Together with existing Systrace tags, custom app sections can give you new ways to understand the performance and behavior of your apps. On-screen GPU profiling in Android 4.3. On-screen GPU profiling Android 4.3 adds new developer options to help you analyze your app’s performance and pinpoint rendering issues on any device or emulator. In the Profile GPU rendering option you can now visualize your app’s effective framerate on-screen, while the app is running. You can choose to display profiling data as on-screen bar or line graphs, with colors indicating time spent creating drawing commands (blue), issuing the commands (orange), and waiting for the commands to complete (yellow). The system updates the on-screen graphs continuously, displaying a graph for each visible Activity, including the navigation bar and notification bar. A green line highlights the 16ms threshold for rendering operations, so you can assess the your app’s effective framerate relative to a 60 fps goal (because 1/60th of a second equals roughly 16ms). If you see operations that cross the green line, you can analyze them further using Systrace and other tools. On devices running Android 4.2 and higher, developer options are hidden by default. You can reveal them at any time by tapping 7 times on Settings > About phone > Build number on any compatible Android device. StrictMode warning for file URIs The latest addition to the StrictMode tool is a policy constraint that warns when your app exposes a file:// URI to the system or another app. In some cases the receiving app may not have access to the file:// URI path, so when sharing files between apps, a content:// URI should be used (with the appropriate permission). This new policy helps you catch and fix such cases. If you’re looking for a convenient way to store and expose files to other apps, try using the FileProvider content provider that’s available in the Support Library.

Android 4.2 Welcome to Android 4.2, the latest 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. 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 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 their 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 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 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. Preferred display selection When multiple external displays are available, you can create as many Presentations as you need, with each one showing unique content on a specific display. In many cases, you might only want to show your content on a single external display — but always on the that’s best for Presentation content. For this, the system can help your app choose the best display to use. To find the best display to use, your app can query the display manager for the system’s preferred Presentation display and receive callbacks when that display changes. Alternatively, you can use the media router service, extended in Android 4.2, to receive notifications when a system video route changes. Your app can display content by default in the main Activity until a preferred Presentation display is attached, at which time it can automatically switch to Presentation content on the preferred display. Your apps can also use media router’s MediaRouteActionProvider and MediaRouteButton to offer standard display-selection UI. Protected content For apps that handle protected or encrypted content, the display API now reports the secure video capabilities of attached displays. Your app query a display to find out if it offers a secure video output or provides protected graphics buffers and then choose the appropriate content stream or decoding to make the content viewable. For additional security on SurfaceView objects, your app can set a secure flag to indicate that the contents should never appear in screenshots or on a non-secure display output, even when mirrored. Wireless display Starting in Android 4.2, users on supported devices can connect to an external display over Wi-Fi, using Wi-Fi Display (a peer-to-peer wireless display solution that complies with the Miracast™ certification program). When a wireless display is connected, users can stream any type of content to the big screen, including photos, games, maps, and more. Apps can take advantage of wireless displays in the same way as they do other external displays and no extra work is needed. The system manages the network connection and streams your Presentation or other app content to the wireless display as needed. Native RTL support Developers can now mirror their layouts for RTL languages. Android 4.2 introduces full native support for RTL (right-to-left) layouts, including layout mirroring. With native RTL support, you can deliver the same great app experience to all of your users, whether their language uses a script that reads right-to-left or one that reads left-to-right. When the user switches the system language to a right-to-left script, the system now provides automatic mirroring of app UI layouts and all view widgets, in addition to bidi mirroring of text elements for both reading and character input. Your app can take advantage of RTL layout mirroring in your app with minimal effort. If you want the app to be mirrored, you simply declare a new attribute in your app manifest and change all "left/right" layout properties to new "start/end" equivalents. The system then handles the mirroring and display of your UI as appropriate. For precise control over your app UI, Android 4.2 includes new APIs that let you manage layout direction, text direction, text alignment, gravity, and locale direction in View components. You can even create custom versions of layout, drawables, and other resources for display when a right-to-left script is in use. To help you debug and optimize your custom right-to-left layouts, the HierarchyViewer tool now lets you see start/end properties, layout direction, text direction, and text alignment for all the Views in the hierarchy. Enhancements for international languages Android 4.2 includes a variety of font and character optimizations for international users: For Korean users, a new font choice is available — Nanum (나눔글꼴) Gothic, a unicode font designed especially for the Korean-language script.

Improved support for Japanese vertical text displayed in WebViews.

Improved font kerning and positioning for Indic, Thai, Arabic, and Hebrew default fonts. The default Android keyboard also includes an updated set of dictionaries: Improved dictionaries for French (with bigram support), English, and Russian

New dictionaries for Danish, Greek, Finnish, Lithuanian, Latvian, Polish, Slovenian, Serbian, Swedish, Turkish Nested Fragments For more control over your UI components and to make them more modular, Android 4.2 lets you nest Fragments inside of Fragments. For any Fragment, a new Fragment manager lets you insert other Fragments as child nodes in the View hierarchy. You can use nested Fragments in a variety of ways, but they are especially useful for implementing dynamic and reusable UI components inside of a UI component that is itself dynamic and reusable. For example, if you use ViewPager to create fragments that swipe left and right, you can now insert fragments into each Fragment of the view pager. To let you take advantage of nested Fragments more broadly in your app, this capability is added to the latest version of the Android Support Library. Accessibility The system now helps accessibility services distinguish between touch exploration and accessibility gestures while in touch-exploration mode. When a user touches the screen, the system notifies the service that a generic touch interaction has started. It then tracks the speed of the touch interaction and determines whether it is a touch exploration (slow) or accessibility gesture (fast) and notifies the service. When the touch interaction ends, the system notifies the service. The system provides a new global accessibility option that lets an accessibility service open the Quick Settings menu based on an action by the user. Also added in Android 4.2 is a new accessibility feedback type for Braille devices. To give accessibility services insight into the meaning of Views for accessibility purposes, the framework provides new APIs for associating a View as the label for another View. The label for each View is available to accessibility services through AccessibilityNodeInfo. Improved Camera with HDR Android 4.2 introduces a new camera hardware interface and pipeline for improved performance. On supported devices, apps can use a new HDR camera scene mode to capture an image using high dynamic range imaging techniques. Additionally, the framework now provides an API to let apps check whether the camera shutter sound can be disabled. Apps can then let the user disable the sound or choose an alternative sound in place of the standard shutter sound, which is recommended. Renderscript Computation In Android 4.2, Renderscript Compute introduces new scripting features, new optimizations, and direct GPU integration for the highest performance in computation operations. Filterscript Filterscript is a subset of Renderscript that is focused on optimized image processing across a broad range of device chipsets. Developers can write their image processing operations in Filterscript using the standard Renderscript runtime API, but within stricter constraints that ensure wider compatibility and improved optimization across CPUs, GPUs, and DSPs. Filterscript is ideal for hardware-accelerating simple image-processing and computation operations such as those that might be written for OpenGL ES fragment shaders. Because it places a relaxed set of constraints on hardware, your operations are optimized and accelerated on more types of device chipsets. Any app targeting API level 17 or higher can make use of Filterscript. Script intrinsics In Android 4.2, Renderscript adds support for a set of script intrinsics — pre-implemented filtering primitives that are accelerated to reduce the amount of code that you need to write and to ensure that your app gets the maximum performance gain possible. Intrinsics are available for blends, blur, color matrix, 3x3 and 5x5 convolve, per-channel lookup table, and converting an Android YUV buffer to RGB. Script groups You can now create groups of Renderscript scripts and execute them all with a single call as though they were part of a single script. This allows Renderscript to optimize execution of the scripts in ways that it could not do if the scripts were executed individually. Renderscript image-processing benchmarks run on different Android platform versions (Android 4.0, 4.1, and 4.2) in CPU only on a Galaxy Nexus device. Renderscript image-processing benchmarks comparing operations run with GPU + CPU to those run in CPU only on the same Nexus 10 device. If you have a directed acyclic graph of Renderscript operations to run, you can use a builder class to create a script group defining the operations. At execution time, Renderscript optimizes the run order and the connections between these operations for best performance. Ongoing optimization improvements When you use Renderscript for computation operations, you apps benefit from ongoing performance and optimization improvements in the Renderscript engine itself, without any impact on your app code or any need for recompilation. As optimization improves, your operations execute faster and on more chipsets, without any work on your part. The chart at right highlights the performance gain delivered by ongoing Renderscript optimization improvements across successive versions of the Android platform. GPU Compute Renderscript Compute is the first computation platform ported to run directly on a mobile device GPU. It now automatically takes advantage of GPU computation resources whenver possible to improve performance. With GPU integration, even the most complex computations for graphics or image processing can execute with dramatically improved performance. Any app using Renderscript on a supported device can benefit immediately from this GPU integration, without recompiling. The Nexus 10 tablet is the first device to support this integration. New built-in developer options The Android 4.2 system includes a variety of new developer options that make it easier to create great looking apps that perform well. The new options expose features for debugging and profiling your app from any device or emulator. On devices running Android 4.2, developer options are hidden by default, helping to create a better experience for users. You can reveal the developer options at any time by tapping 7 times on Settings > About phone > Build number on any compatible Android device. New developer options give you more ways to profile and debug on a device. New developer options in Android 4.2 include: Take bug report — immediately takes a screen shot and dumps device state information to local file storage, then attaches them to a new outgoing email message.

— immediately takes a screen shot and dumps device state information to local file storage, then attaches them to a new outgoing email message. Power menu bug reports — Adds a new option to the device power menu and quick settings to take a bug report (see above).

— Adds a new option to the device power menu and quick settings to take a bug report (see above). Verify apps over usb — Allows you to disable app checks for sideloading apps over USB, while still checking apps from other sources like the browser. This can speed up the development process while keeping the security feature enabled.

— Allows you to disable app checks for sideloading apps over USB, while still checking apps from other sources like the browser. This can speed up the development process while keeping the security feature enabled. Show hardware layers updates — Flashes hardware layers green when they update.

— Flashes hardware layers green when they update. Show GPU overdraw — Highlights GPU overdraw areas.

— Highlights GPU overdraw areas. Force 4x MSAA — Enables 4x MSAA in Open GL ES 2.0 apps.

— Enables 4x MSAA in Open GL ES 2.0 apps. Simulate secondary displays — Creates one or more non-secure overlay windows on the current screen for use as a simulated remote display. You can control the simulated display’s size and density.

— Creates one or more non-secure overlay windows on the current screen for use as a simulated remote display. You can control the simulated display’s size and density. Enable OpenGL traces — Lets you trace OpenGL execution using Logcat, Systrace, or callstack on glGetError. New Platform Technologies Android 4.2 includes a variety of new and enhanced platform technologies to support innovative communications use-cases across a broad range of hardware devices. In most cases, the new platform technologies and enhancements do not directly affect your apps, so you can benefit from them without any modification. Security enhancements Every Android release includes dozens of security enhancements to protect users. Here are some of the enhancements in Android 4.2: Application verification — Users can choose to enable “Verify Apps" and have applications screened by an application verifier, prior to installation. App verification can alert the user if they try to install an app that might be harmful; if an application is especially bad, it can block installation.

— Users can choose to enable “Verify Apps" and have applications screened by an application verifier, prior to installation. App verification can alert the user if they try to install an app that might be harmful; if an application is especially bad, it can block installation. More control of premium SMS — Android will provide a notification if an application attempts to send SMS to a short code that uses premium services which might cause additional charges. The user can choose whether to allow the application to send the message or block it.

— Android will provide a notification if an application attempts to send SMS to a short code that uses premium services which might cause additional charges. The user can choose whether to allow the application to send the message or block it. Always-on VPN — VPN can be configured so that applications will not have access to the network until a VPN connection is established. This prevents applications from sending data across other networks.

— VPN can be configured so that applications will not have access to the network until a VPN connection is established. This prevents applications from sending data across other networks. Certificate Pinning — The libcore SSL implementation now supports certificate pinning. Pinned domains will receive a certificate validation failure if the certificate does not chain to a set of expected certificates. This protects against possible compromise of Certificate Authorities.

— The libcore SSL implementation now supports certificate pinning. Pinned domains will receive a certificate validation failure if the certificate does not chain to a set of expected certificates. This protects against possible compromise of Certificate Authorities. Improved display of Android permissions — Permissions have been organized into groups that are more easily understood by users. During review of the permissions, the user can click on the permission to see more detailed information about the permission.

— Permissions have been organized into groups that are more easily understood by users. During review of the permissions, the user can click on the permission to see more detailed information about the permission. installd hardening — The installd daemon does not run as the root user, reducing potential attack surface for root privilege escalation.

— The installd daemon does not run as the root user, reducing potential attack surface for root privilege escalation. init script hardening — init scripts now apply O_NOFOLLOW semantics to prevent symlink related attacks.

— init scripts now apply O_NOFOLLOW semantics to prevent symlink related attacks. FORTIFY_SOURCE — Android now implements FORTIFY_SOURCE. This is used by system libraries and applications to prevent memory corruption.

— Android now implements FORTIFY_SOURCE. This is used by system libraries and applications to prevent memory corruption. ContentProvider default configuration — Applications which target API level 17 will have “export” set to “false” by default for each ContentProvider, reducing default attack surface for applications.

— Applications which target API level 17 will have “export” set to “false” by default for each ContentProvider, reducing default attack surface for applications. Cryptography — Modified the default implementations of SecureRandom and Cipher.RSA to use OpenSSL. Added SSLSocket support for TLSv1.1 and TLSv1.2 using OpenSSL 1.0.1

— Modified the default implementations of SecureRandom and Cipher.RSA to use OpenSSL. Added SSLSocket support for TLSv1.1 and TLSv1.2 using OpenSSL 1.0.1 Security Fixes — Upgraded open source libraries with security fixes include WebKit, libpng, OpenSSL, and LibXML. Android 4.2 also includes fixes for Android-specific vulnerabilities. Information about these vulnerabilities has been provided to Open Handset Alliance members and fixes are available in Android Open Source Project. To improve security, some devices with earlier versions of Android may also include these fixes. New Bluetooth stack Android 4.2 introduces a new Bluetooth stack optimized for use with Android devices. The new Bluetooth stack developed in collaboration between Google and Broadcom replaces the stack based on BlueZ and provides improved compatibility and reliability. Low-latency audio Android 4.2 introduces a new Bluetooth stack optimized for use with Android devices. The new Bluetooth stack developed in collaboration between Google and Broadcom replaces the stack based on BlueZ and provides improved compatibility and reliability. Android 4.2 improves support for low-latency audio playback, starting from the improvements made in Android 4.1 release for audio output latency using OpenSL ES, Soundpool and tone generator APIs. These improvements depend on hardware support — devices that offer these low-latency audio features can advertise their support to apps through a hardware feature constant. New AudioManager APIs are provided to query the native audio sample rate and buffer size, for use on devices which claim this feature. New camera hardware interface Android 4.2 introduces a new implementation of the camera stack. The camera subsystem includes the implementations for components in the camera pipeline such as burst mode capture with processing controls. New NFC hardware interface and controller interface Android 4.2 introduces support for controllers based on the NCI standard from the NFC-Forum. NCI provides a standard communication protocol between an NFC Controller (NFCC) and a device Host, and the new NFC stack developed in collaboration between Google and Broadcom supports it. Dalvik runtime optimizations Android 4.2 introduces a new implementation of the camera stack. The camera subsystem includes the implementations for components in the camera pipeline such as burst mode capture with processing controls.Android 4.2 introduces support for controllers based on the NCI standard from the NFC-Forum. NCI provides a standard communication protocol between an NFC Controller (NFCC) and a device Host, and the new NFC stack developed in collaboration between Google and Broadcom supports it. The Dalvik runtime includes enhancements for performance and security across a wider range of architectures: x86 JIT support from Intel and MIPS JIT support from MIPS

Optimized garbage-collection parameters for devices with > 512MB

Default implementations of SecureRandom and Cipher.RSA now use OpenSSL

SSLSocket support for TLSv1.1 and TLSv1.2 via OpenSSL 1.0.1

New intrinsic support for StrictMath methods abs, min, max, and sqrt

BouncyCastle updated to 1.47

zlib updated to 1.27

dlmalloc updated to 2.8.6