Jelly Bean
![](http://developer.android.com/images/jb-android-4.1.png)
Welcome to Android 4.1 the first version of Jelly Bean!
Android 4.1 is the fastest and smoothest version of Android yet. We’ve made improvements throughout the platform and added great new features for users and developers. This document provides a glimpse of what's new for developers.
See the Android 4.1 APIs document for a detailed look at the new developer APIs.
Faster, Smoother, More Responsive
Android 4.1 is optimized to deliver Android's best performance and lowest touch latency, in an effortless, intuitive UI.
To ensure a consistent framerate, Android 4.1 extends vsync timing across all drawing and animation done by the Android framework. Everything runs in lockstep against a 16 millisecond vsync heartbeat — application rendering, touch events, screen composition, and display refresh — so frames don’t get ahead or behind.
Android 4.1 also adds triple buffering in the graphics pipeline, for more consistent rendering that makes everything feel smoother, from scrolling to paging and animations.
Android 4.1 reduces touch latency not only by synchronizing touch to vsync timing, but also by actually anticipatingwhere your finger will be at the time of the screen refresh. This results in a more reactive and uniform touch response. In addition, after periods of inactivity, Android applies a CPU input boost at the next touch event, to make sure there’s no latency.
Tooling can help you get the absolute best performance out of your apps. Android 4.1 is designed to work with a new tool called systrace, which collects data directly from the Linux kernel to produce an overall picture of system activities. The data is represented as a group of vertically stacked time series graphs, to help isolate rendering interruptions and other issues. The tool is available now in the Android SDK (Tools R20 or higher)
![](http://developer.android.com/images/jb-accessibility-focus-250.png)
Enhanced Accessibility
New APIs for accessibility services let you handle gestures and manage accessibility focus as the user moves through the on-screen elements and navigation buttons using accessibility gestures, accessories, and other input. The Talkback system and explore-by-touch are redesigned to use accessibility focus for easier use and offer a complete set of APIs for developers.
Accessibility services can link their own tutorials into the Accessibility settings, to help users configure and use their services.
Apps that use standard View components inherit support for the new accessibility features automatically, without any changes in their code. Apps that use custom Views can use new accessibility node APIs to indicate the parts of the View that are of interest to accessibility services.
Support for International Users
![](http://developer.android.com/images/jb-r2l.png)
Bi-Directional Text and Other Language Support
Android 4.1 helps you to reach more users through support for bi-directional text in TextView and EditText elements. Apps can display text or handle text editing in left-to-right or right-to-left scripts. Apps can make use of new Arabic and Hebrew locales and associated fonts.
Other types of new language support include:
- Additional Indic languages: Kannada, Telugu, and Malayalam
- The new Emoji characters from Unicode version 6.0
- Better glyph support for Japanese users (renders Japanese-specific versions of glyphs when system language is set to Japanese)
- Arabic glyphs optimized for WebViews in addition to the Arabic glyphs for TextViews
- Vertical Text support in WebViews, including Ruby Text and additional Vertical Text glyphs
- Synthetic Bold is now available for all fonts that don't have dedicated bold glyphs
User-installable keymaps
The platform now supports user-installable keyboard maps, such as for additional international keyboards and special layout types. By default, Android 4.1 includes 27 international keymaps for keyboards, including Dvorak. When users connect a keyboard, they can go to the Settings app and select one or more keymaps that they want to use for that keyboard. When typing, users can switch between keymaps using a shortcut (ctrl-space).
You can create an app to publish additional keymaps to the system. The APK would include the keyboard layout resources in it, based on standard Android keymap format. The application can offer additional keyboard layouts to the user by declaring a suitable broadcast receiver for ACTION_QUERY_KEYBOARD_LAYOUTS in its manifest.
New Ways to Create Beautiful UI
![](http://developer.android.com/images/jb-notif-ex1.png)
Developers can create custom notification styles like those shown in the examples above to display rich content and actions.
Expandable notifications
Notifications have long been a unique and popular feature on Android. Developers can use them to place important or time-based information in front of users in the notification bar, outside of the app’s normal UI.
Android 4.1 brings a major update to the Android notifications framework. Apps can now display larger, richer notifications to users that can be expanded and collapsed with a pinch or swipe. Notifications support new types of content, including photos, have configurable priority, and can even include multiple actions.
Through an improved notification builder, apps can create notifications that use a larger area, up to 256 dp in height. Three templated notification styles are available:
- BigTextStyle — a notification that includes a multiline TextView object.
- BigInboxStyle — a notification that shows any kind of list such as messages, headlines, and so on.
- BigPictureStyle — a notification that showcases visual content such as a bitmap.
In addition to the templated styles, you can create your own notification styles using any remote View.
Apps can add up to three actions to a notification, which are displayed below the notification content. The actions let the users respond directly to the information in the notification in alternative ways. such as by email or by phone call, without visiting the app.
With expandable notifications, apps can give more information to the user, effortlessly and on demand. Users remain in control and can long-press any notification to get information about the sender and optionally disable further notifications from the app.
![](http://developer.android.com/images/jb-appwidgets.png)
App Widgets can resize automatically to fit the home screen and load different content as their sizes change.
Resizable app widgets
Android 4.1 introduces improved App Widgets that can automatically resize, based on where the user drops them on the home screen, the size to which the user expands them, and the amount of room available on the home screen. New App Widget APIs let you take advantage of this tooptimize your app widget content as the size of widgets changes.
When a widget changes size, the system notifies the host app’s widget provider, which can reload the content in the widget as needed. For example, a widget could display larger, richer graphics or additional functionality or options. Developers can still maintain control over maximum and minimum sizes and can update other widget options whenever needed.
You can also supply separate landscape and portrait layouts for your widgets, which the system inflates as appropriate when the screen orientation changes.
App widgets can now be displayed in third party launchers and other host apps through a new bind Intent (AppWidgetManager.ACTION_APPWIDGET_BIND).
Simplified task navigation
Android 4.1 makes it easy for you to manage the “Up” navigation that’s available to users from inside of your apps and helps ensure a consistent experience for users.
You can define the intended Up navigation for individual Activity components of your UI by adding a new XML attribute in the app’s manifest file. At run time, as Activities are launched, the system extracts the Up navigation tree from the manifest file and automatically creates the Up affordance navigation in the action bar. Developers who declare Up navigation in the manifest no longer need to manage navigation by callback at run time, although they can also do so if needed.
Also available is a new TaskStackBuilder class that lets you quickly put together a synthetic task stack to start immediately or to use when an Activity is launched from a PendingIntent. Creating a synthetic task stack is especially useful when users launch Activities from remote views, such as from Home screen widgets and notifications, because it lets the developer provide a managed, consistent experience on Back navigation.
Easy animations for Activity launch
You can use a new helper class, ActivityOptions, to create and control the animation displayed when you launch your Activities. Through the helper class, you can specify custom animation resources to be used when the activity is launched, or request new zoom animations that start from any rectangle you specify on screen and that optionally include a thumbnail bitmap.
Transitions to Lights Out and Full Screen Modes
New system UI flags in View let you to cleanly transition from a normal application UI (with action bar, navigation bar, and system bar visible), to "lights out mode" (with status bar and action bar hidden and navigation bar dimmed) or "full screen mode" (with status bar, action bar, and navigation bar all hidden).
New types of remoteable Views
Developers can now use GridLayout and ViewStub views in Home screen widgets and notifications. GridLayout lets you structure the content of your remote views and manage child views alignments with a shallower UI hierarchy. ViewStub is an invisible, zero-sized View that can be used to lazily inflate layout resources at runtime.
Live wallpaper preview
Android 4.1 makes it easier for users to find and install Live Wallpapers from apps that include them. If your app includes Live Wallpapers, you can now start an Activity (ACTION_CHANGE_LIVE_WALLPAPER) that shows the user a preview of the Live Wallpaper from your own app. From the preview, users can directly load the Live Wallpaper.
Higher-resolution contact photos
With Android 4.1, you can store contact photos that are as large as 720 x 720, making contacts even richer and more personal. Apps can store and retrieve contact photos at that size or use any other size needed. The maximum photo size supported on specific devices may vary, so apps should query the built-in contacts provider at run time to obtain the max size for the current device.
Source: http://developer.android.com/
No comments:
Post a Comment