OSDN Git Service

am 083bfa5a: Merge "Remove dead DateUtils code that was never in an API level."
[android-x86/frameworks-base.git] / docs / html / about / versions / jelly-bean.jd
1 page.title=Jelly Bean
2 tab1=Android 4.2
3 tab1.link=#android-42
4 tab2=Android 4.1
5 tab2.link=#android-41
6
7 @jd:body
8
9
10 <style>
11 #android-41 {display:none;}
12 </style>
13
14 <script>
15 function revealSection(hashy) {
16   if (hashy != "" && !$(hashy).is(":visible")) {
17     sectionId = $(hashy).closest(".version-section").attr("id");
18     link = $("#title-tabs a[href$="+sectionId+"]");
19     link.parent().addClass("selected");
20     link.parent().siblings().removeClass("selected");
21     
22     sectionDiv = $(".version-section"+link.attr("href"));
23     if (sectionDiv.length) {
24       $(".version-section").hide();
25       sectionDiv.show();
26     }
27     
28     $('html, body').animate({
29          scrollTop: $(hashy).offset().top
30      }, 100);
31   }
32 }
33
34 $(document).ready(function() {
35   $("#title-tabs li a").each(function() {
36     $(this).click(function(){
37       $(this).parent().addClass("selected");
38       $(this).parent().siblings().removeClass("selected");
39       $(".version-section").hide();
40       $($(this).attr("href")).show();
41       return false;
42     });
43   });
44
45   hashy = escapeHTML(location.hash);
46   revealSection(hashy);
47 });
48
49 window.onhashchange = function () {
50   revealSection(escapeHTML(location.hash));
51 }
52
53 </script>
54
55
56
57 <!-- BEGIN ANDROID 4.2 -->
58 <div id="android-42" class="version-section">
59 <div style="float:right;padding:0px 0px 12px 34px;">
60 <div>
61 <img src="{@docRoot}images/jb-device-2.png" alt="Android 4.2 on phone and tablet" height="348" width="400">
62 </div>
63 </div>
64 <p>Welcome to Android 4.2, the latest version of <span
65 style="white-space:nowrap;">Jelly Bean!</span></p>
66
67 <p>Android 4.2 has performance optimizations, a refreshed system UI, and great
68 new features for users and developers. This document provides a glimpse of what's new for
69 developers.
70
71 <p>See the <a href="/about/versions/android-4.2.html">Android 4.2 APIs</a>
72 document for a detailed look at the new developer APIs.</p>
73
74 <p>Find out more about the new Jelly Bean features for users at <a
75 href="http://www.android.com/whatsnew">www.android.com</a>.</p>
76
77
78 <h2 id="42-performance" style="line-height:1.25em;">Faster, Smoother, More Responsive</h2>
79
80 <p>Android 4.2 builds on the performance improvements already included in Jelly Bean
81 &mdash; <strong>vsync timing</strong>, <strong>triple buffering</strong>,
82 <strong>reduced touch latency</strong>, and <strong>CPU input boost</strong>
83 &mdash; and adds new optimizations that make Android even faster.</p>
84
85 <p>Improvements in the <strong>hardware-accelerated 2D renderer</strong> make
86 common animations such as scrolling and swiping smoother and faster. In
87 particular, <strong>drawing is optimized</strong> for layers, clipping and
88 certain shapes (rounded rects, circles and ovals).</p>
89
90 <p>A variety of <strong>WebView rendering optimizations</strong> make scrolling
91 of web pages smoother and free from jitter and lags.</p>
92
93 <p>Android’s <strong>Renderscript Compute</strong> is the first computation
94 platform ported to run directly on a <strong>mobile device GPU</strong>. It automatically
95 takes advantage of <strong>GPU computation</strong> resources whenever possible,
96 dramatically improving performance for graphics and image processing. Any app using
97 Renderscript on a supported device can benefit immediately from
98 this GPU integration <strong>without recompiling</strong>.</p>
99
100
101 <div style="float:left;margin:16px 24px 12px 0px;">
102 <a href="" target="_android">
103 <img src="{@docRoot}images/jb-nexus10-1.png" alt="10-inch tablet running Android 4.2" width="380" height="281" /></a>
104 </div> 
105
106 <h2 id="42-ui" style="margin-top:2em;">Refined, refreshed UI</h2>
107
108 <p>Android 4.2 refines the Jelly Bean user experience and brings familiar
109 Android UI patterns such as status bar, system bar, and notifications window to
110 all tablets.</p>
111
112 <p>All screen sizes now feature the <strong>status bar</strong> on top, with
113 pull-down access to <strong>notifications</strong> and a new <strong>Quick
114 Settings</strong> menu. The familiar </strong>system bar</strong> appears on the
115 bottom, with buttons easily accessible from either hand. The <strong>Application
116 Tray</strong> is also available on all screen sizes.</p>
117
118
119 <h2 id="42-multiuser" style="margin-top:2em;clear:left;">One tablet, many users</h2>
120
121 <p>Now several users can <strong>share a single Android tablet</strong>, with
122 each user having convenient access to a <strong>dedicated user
123 space</strong>. Users can switch to their spaces with a single touch from the
124 lock screen.</p>
125
126 <p>On a multiuser device, Android gives each user a separate environment,
127 including user-specific emulated SD card storage. Users also have their own
128 homescreens, widgets, accounts, settings, files, and apps, and the system keeps
129 these separate. All users share core system services, but the system ensures that
130 each user's applications and data remain isolated. In effect, each of the multiple
131 users has his or her own Android device.</p>
132
133 <p>Users can install and uninstall apps at any time in their own environments.
134 To save storage space, Google Play downloads an APK only if it's not already
135 installed by another user on the device. If the app is already installed, Google
136 Play records the new user's installation in the usual way but doesn't download
137 another copy of the app. Multiple users can run the same copy of an APK because
138 the system creates a new instance for each user, including a user-specific data
139 directory.</p>
140
141 <p>For developers, <strong>multi-user support is transparent</strong> &mdash;
142 your apps do not need to do anything special to run normally in a multi-user
143 environment and there are no changes you need to make in your existing or
144 published APKs. The system manages your app in each user space just as it does
145 in a single-user environment. </p>
146
147
148 <h2 id="42-engagement" style="clear:left; margin-top:1em;">New ways to engage users</h2>
149
150 <div style="float:right;margin:22px 0px 0px 24px;width:280px;">
151 <div>
152 <img src="{@docRoot}images/jb-lock-calendar.png" alt="Calendar lock screen widget" width="280" height="543" style="padding-left:1em;margin-bottom:0">
153 </div>
154 <p class="image-caption" style="padding:1.5em">You can extend <strong>app widgets</strong> to run on the lock screen, for instant access to your content.</p>
155 </div>
156
157 <h3 id="42-lockscreen-widgets">Lock screen widgets</h3>
158
159 <p>In Android 4.2, users can place <strong>app widgets</strong> directly on
160 their <strong>lock screens</strong>, for instant access to favorite app content
161 without having to unlock. Users can add as many as five lock screen widgets,
162 choosing from widgets provided by installed apps. The lock screen displays each
163 widget in its own panel, letting users swipe left and right to view different
164 panels and their widgets.</p>
165
166 <p>Like all app widgets, lock screen widgets can display <strong>any kind of content</strong> and
167 they can accept direct user interaction. They can be entirely self-contained,
168 such as a widget that offers controls to play music, or they can let users jump
169 straight to an Activity in your app, after unlocking along the way as
170 needed.</p>
171
172 <p>For developers, lock screen widgets offer a great new way to engage users.
173 They let you put your content in front of users in a location they’ll see often,
174 and they give you more opportunities to bring users directly into your app.</p>
175
176 <p>You can take advantage of this new capability by building a new app widget or
177 by extending an existing home screen widget. If your app already includes home
178 screen widgets, you can extend them to the lock screen with minimal change. To
179 give users an optimal experience, you can update the widget to use the full lock
180 screen area when available and resize when needed on smaller screens. You can
181 also add features to your widgets that might be especially useful or convenient
182 on the lock screen.</p>
183
184 <h3 id="42-daydreams">Daydream</h3>
185
186 <p>Daydream is an <strong>interactive screensaver mode</strong> that starts when
187 a user’s device is docked or charging. In this mode, the system launches a
188 daydream &mdash; a remote content service provided by an installed app &mdash;
189 as the device screensaver. A user can enable Daydream from the Settings app and
190 then choose the daydream to display.</p>
191
192 <p>Daydreams combine the best capabilities of live wallpapers and home screen
193 widgets, but they are more powerful. They let you offer the any kind of content
194 in a completely new context, with user interactions such as flipping through
195 photos, playing audio or video, or jumping straight into your app with a single
196 touch.</p>
197
198 <p>Because daydreams can start automatically when a device is charging or
199 docked, they also give your app a great way to support new types of user
200 experiences, such as leanback or exhibition mode, demo or kiosk mode, and
201 "attract mode" &mdash; all without requiring special hardware.</p>
202
203 <div style="float:left;margin:20px 30px 0px 0px;width:460px;">
204 <div>
205 <img src="{@docRoot}images/jb-dream-1.png" alt="Daydream screensaver mode" height="300" style="padding-left:1em;">
206 </div>
207 <p class="image-caption" style="padding:.5em .5em .5em 1.5em;"><span
208 style="font-weight:500;">Daydream</span> lets you create powerful interactive screensavers that display any kind of content.</p>
209 </div>
210
211 <p>Daydreams are similar to Activities and can do anything that Activity
212 can do &mdash; from rendering a UI hierarchy (without using RemoteViews) to
213 drawing directly using Canvas, OpenGL, SurfaceTexture, and more. They can play
214 video and audio and they can even accept direct user interaction. However,
215 daydreams are not Activities, so they don’t affect the backstack or appear in
216 Recents and they cannot be launched directly from your app.</p>
217
218 <p>Implementing a daydream is straightforward and you can take advantage of UI
219 components and resources that you’ve already created for other parts of your
220 app. You can provide multiple daydreams in your app and you can offer distinct
221 content and display settings for each.</p>
222
223 <h2  id="42-external-display" style="clear:left;">External display support</h2>
224
225 <p>Android 4.2 introduces platform support for <strong>external
226 displays</strong> that goes far beyond mirroring &mdash; apps can now target
227 unique content to any one or multiple displays that are attached to an Android
228 device. Apps can build on this to deliver new kinds of interaction and
229 entertainment experiences to users.</p>
230
231 <h3 id="42-display-manager">Display manager</h3>
232
233 <p>Apps interact with displays through a new display manager system service.
234 Your app can enumerate the displays and check the capabilities of each,
235 including size, density, display name, ID, support for secure video, and more.
236 Your app can also receive callbacks when displays are added or removed or when
237 their capabilities change, to better manage your content on external
238 displays.</p>
239
240 <h3 id="42-presentation">Presentation window</h3>
241
242 <p>To make it easy to show content on an external display, the framework
243 provides a new UI object called a <strong>Presentation</strong> &mdash; a type of dialog that
244 represents a window for your app’s content on a specific external display. Your
245 app just gives the display to use, a theme for the window, and any unique
246 content to show. The Presentation handles inflating resources and rendering your
247 content according to the characteristics of the targeted display.</p>
248
249 <div style="margin:0 auto;width:569px;padding-top:1em;">
250
251 <img src="{@docRoot}images/external-display.png" alt="" width="555" height="351" style="padding-left:1em;margin-bottom:0">
252
253 <p class="image-caption" style="padding:1.25em">You can take full control of two or more independent displays using <strong>Presentation</strong>.</p>
254 </div>
255
256 <p>A Presentation gives your app full control over the remote display window and
257 its content and lets you manage it based on user input events such as key
258 presses, gestures, motion events, and more. You can use all of the normal tools
259 to create a UI and render content in the Presentation, from building an
260 arbitrary view hierarchy to using SurfaceView or SurfaceTexture to draw directly
261 into the window for streamed content or camera previews.</p>
262
263 <h3 id="42-preferred display">Preferred display selection</h3>
264
265 <p>When multiple external displays are available, you can create as many
266 Presentations as you need, with each one showing unique content on a specific
267 display. In many cases, you might only want to show your content on a single
268 external display &mdash; but always on the that’s best for Presentation content.
269 For this, the system can help your app choose the best display to use.</p>
270
271 <p>To find the best display to use, your app can query the display manager for
272 the system’s <strong>preferred Presentation display</strong> and receive callbacks when that
273 display changes. Alternatively, you can use the media router service, extended
274 in Android 4.2, to receive notifications when a system video route changes. Your
275 app can display content by default in the main Activity until a preferred
276 Presentation display is attached, at which time it can automatically switch to
277 Presentation content on the preferred display. Your apps can also use media
278 router’s MediaRouteActionProvider and MediaRouteButton to offer standard
279 display-selection UI.</p>
280
281 <h3 id="42-protected-content">Protected content</h3>
282
283 <p>For apps that handle protected or encrypted content, the display API now
284 reports the <strong>secure video capabilities</strong> of attached displays. Your app query a
285 display to find out if it offers a secure video output or provides protected
286 graphics buffers and then choose the appropriate content stream or decoding to
287 make the content viewable. For additional security on SurfaceView objects, your
288 app can set a secure flag to indicate that the contents should never appear in
289 screenshots or on a non-secure display output, even when mirrored.</p>
290
291 <h3 id="42-wireless-display">Wireless display</h3>
292
293 <p>Starting in Android 4.2, users on supported devices can connect to an
294 external display over Wi-Fi, using <a
295 href="http://www.wi-fi.org/wi-fi-certified-miracast%E2%84%A2">Miracast</a>, a
296 peer-to-peer wireless display standard created by the <a
297 href="http://www.wi-fi.org/">Wi-Fi Alliance</a>. When a wireless display is
298 connected, users can stream any type of content to the big screen, including
299 photos, games, maps, and more.</p>
300
301 <p>Apps can take advantage of <strong>wireless displays</strong> in the same way as they do other
302 external displays and no extra work is needed. The system manages the network
303 connection and streams your Presentation or other app content to the wireless
304 display as needed.</p>
305
306
307 <h2 id="42-native-rtl">Native RTL support</h2>
308
309 <div style="float:right;margin:22px 0px 0px 24px;width:340px;">
310 <div>
311 <img src="{@docRoot}images/jb-rtl.png" alt="RTL layout mirroring" width="340" height="457" style="margin-bottom:0;">
312 </div>
313 <p class="image-caption" style="padding-top:1em">Developers can now <strong>mirror their layouts</strong> for RTL languages.</p>
314 </div>
315
316 <p>Android 4.2 introduces <strong>full native support for RTL</strong>
317 (right-to-left) layouts, including layout mirroring. With native RTL support,
318 you can deliver the same great app experience to all of your users, whether
319 their language uses a script that reads right-to-left or one that reads
320 left-to-right.</p>
321
322 <p>When the user switches the system language to a right-to-left script, the
323 system now provides automatic mirroring of app UI layouts and all view widgets,
324 in addition to bidi mirroring of text elements for both reading and character
325 input.</p>
326
327 <p>Your app can take advantage of <strong>RTL layout mirroring</strong> in your app with minimal effort.
328 If you want the app to be mirrored, you simply declare a new attribute in your
329 app manifest and change all "left/right" layout properties to new "start/end"
330 equivalents. The system then handles the mirroring and display of your UI as
331 appropriate.</p>
332
333 <p>For precise control over your app UI, Android 4.2 includes new APIs that let
334 you manage layout direction, text direction, text alignment, gravity, and 
335 locale direction in View components. You can even create custom versions of
336 layout, drawables, and other resources for display when a right-to-left script
337 is in use.</p>
338
339 <p>To help you debug and optimize your custom right-to-left layouts, the
340 HierarchyViewer tool now lets you see start/end properties, layout direction,
341 text direction, and text alignment for all the Views in the hierarchy.</p>
342
343
344 <h2 id="42-intl">Enhancements for international languages</h2>
345
346 <p>Android 4.2 includes a variety of <strong>font and character
347 optimizations</strong> for international users:</p>
348 <ul>
349 <li>For Korean users, a new font choice is available &mdash; Nanum (나눔글꼴)
350 Gothic, a unicode font designed especially for the Korean-language script.</li>
351 <li>Improved support for Japanese vertical text displayed in WebViews.</li>
352 <li>Improved font kerning and positioning for Indic, Thai, Arabic, and Hebrew
353 default fonts.</li>
354 </ul>
355
356 <p>The default Android keyboard also includes an updated set of
357 dictionaries:</p>
358 <ul>
359 <li>Improved dictionaries for French (with bigram support), English, and
360 Russian</li>
361 <li>New dictionaries for Danish, Greek, Finnish, Lithuanian, Latvian, Polish,
362 Slovenian, Serbian, Swedish, Turkish</li>
363 </ul>
364
365
366 <h2 id="42-ui-tools">New ways to create beautiful UI</h2>
367
368 <h3 id="42-nested-fragments">Nested Fragments</h3>
369
370 <p>For more control over your UI components and to make them more modular,
371 Android 4.2 lets you <strong>nest Fragments inside of Fragments</strong>. For
372 any Fragment, a new Fragment manager lets you insert other Fragments as child
373 nodes in the View hierarchy.</p>
374
375 <p>You can use nested Fragments in a variety of ways, but they are especially
376 useful for implementing dynamic and reusable UI components inside of a UI
377 component that is itself dynamic and reusable. For example, if you use ViewPager
378 to create fragments that swipe left and right, you can now insert fragments into
379 each Fragment of the view pager.</p>
380
381 <p>To let you take advantage of nested Fragments more broadly in your app, this
382 capability is added to the latest version of the <strong>Android Support
383 Library</strong>.</p>
384
385
386 <h2 id="42-accessibility">Accessibility</h2>
387
388 <p>The system now helps accessibility services <strong>distinguish between touch
389 exploration and accessibility gestures</strong> while in touch-exploration mode.
390 When a user touches the screen, the system notifies the service that a generic
391 touch interaction has started. It then tracks the speed of the touch interaction
392 and determines whether it is a touch exploration (slow) or accessibility gesture
393 (fast) and notifies the service. When the touch interaction ends, the system
394 notifies the service.</p>
395
396 <p>The system provides a new global accessibility option that lets an
397 accessibility service open the Quick Settings menu based on an action by the
398 user. Also added in Android 4.2 is a new accessibility feedback type for
399 <strong>Braille devices</strong>.</p>
400
401 <p>To give accessibility services insight into the meaning of Views for
402 accessibility purposes, the framework provides new APIs for associating a View
403 as the label for another View. The label for each View is available to
404 accessibility services through AccessibilityNodeInfo.</p>
405
406
407 <h2 id="42-camera">Improved Camera with HDR</h2>
408
409 <p>Android 4.2 introduces a <strong>new camera hardware interface and
410 pipeline</strong> for improved performance. On supported devices, apps can use a
411 new <strong>HDR camera scene mode</strong> to capture an image using high
412 dynamic range imaging techniques. </p>
413
414 <p>Additionally, the framework now provides an API to let apps check whether the
415 camera shutter sound can be disabled. Apps can then let the user disable the
416 sound or choose an alternative sound  in place of the standard shutter sound,
417 which is recommended.</p>
418
419
420 <h2 id="42-renderscript">Renderscript Computation</h2>
421
422 <p>In Android 4.2, Renderscript Compute introduces new scripting features, new
423 optimizations, and direct GPU integration for the highest performance in
424 computation operations.</p>
425
426 <h3 id="42-filterscript">Filterscript</h3>
427
428 <p>Filterscript is a subset of Renderscript that is focused on <strong>optimized
429 image processing across a broad range of device chipsets</strong>. Developers
430 can write their image processing operations in Filterscript using the standard
431 Renderscript runtime API, but within stricter constraints that ensure wider
432 compatibility and improved optimization across CPUs, GPUs, and DSPs.</p>
433
434 <p>Filterscript is ideal for hardware-accelerating simple image-processing and
435 computation operations such as those that might be written for OpenGL ES
436 fragment shaders. Because it places a relaxed set of constraints on hardware,
437 your operations are optimized and accelerated on more types of device chipsets. 
438 Any app targeting API level 17 or higher can make use of Filterscript.</p>
439
440 <h3 id="42-rs-intrinsics">Script intrinsics</h3>
441
442 <p>In Android 4.2, Renderscript adds support for a set of script intrinsics
443 &mdash; pre-implemented <strong>filtering primitives that are
444 accelerated</strong> to reduce the amount of code that you need to write and to
445 ensure that your app gets the maximum performance gain possible.</p>
446
447 <p>Intrinsics are available for blends, blur, color matrix, 3x3  and 5x5 convolve,
448 per-channel lookup table, and converting an Android YUV buffer to RGB.</p>
449
450 <h3 id="42-rs-groups">Script groups</h3>
451
452 <p>You can now create <strong>groups of Renderscript scripts</strong> and
453 execute them all with a single call as though they were part of a single script.
454 This allows Renderscript to optimize execution of the scripts in ways that it
455 could not do if the scripts were executed individually.</p>
456
457 <div style="float:right;padding-top:1em;width:400px;margin-left:2em;">
458 <img src="{@docRoot}images/jb-rs-chart-versions.png" alt="Renderscipt optimizations chart" width="360" height="252"
459 style="border:1px solid #ddd;border-radius: 6px;" />
460 <p style="image-caption">Renderscript image-processing 
461 benchmarks run on different Android platform versions (Android 4.0, 4.1, and 4.2)
462 in CPU only on a Galaxy Nexus device.</p>
463 <img src="{@docRoot}images/jb-rs-chart-gpu.png" style="border:1px solid #ddd;border-radius: 6px; alt="" width="360" height="252" />
464 <p style="image-caption">Renderscript image-processing benchmarks comparing operations run with GPU + CPU to those run in CPU only on the same Nexus 10 device.</p>
465 </div>
466
467 <p>If you have a directed acyclic graph of Renderscript operations to run, you can
468 use a builder class to create a script group defining the operations. At
469 execution time, Renderscript optimizes the run order and the connections between
470 these operations for best performance.</p>
471
472
473 <h3 id="42-rs-optimization">Ongoing optimization improvements</h3>
474
475 <p>When you use Renderscript for computation operations, you apps benefit from
476 <strong>ongoing performance and optimization improvements</strong> in the
477 Renderscript engine itself, without any impact on your app code or any need for
478 recompilation.</p>
479
480 <p>As optimization improves, your operations execute faster and on more
481 chipsets, without any work on your part. The chart at right highlights
482 the performance gain delivered by ongoing Renderscript optimization improvements
483 across successive versions of the Android platform.</p>
484
485 <h3 id="42-gpu-compute">GPU Compute</h3>
486
487 <p>Renderscript Compute is the first computation platform ported to run directly on a mobile device GPU. It now
488 automatically takes advantage of <strong>GPU computation</strong> resources
489 whenver possible to improve performance. With GPU integration, even the most
490 complex computations for graphics or image processing can execute with
491 dramatically improved performance.</p>
492
493 <p>Any app using Renderscript on a supported device can benefit immediately from
494 this GPU integration, without recompiling. The Nexus 10 tablet is the first
495 device to support this integration.</p>
496
497 <h2  id="42-dev-options" style="clear:right;margin-top:1em;">New built-in developer options</h2>
498
499 <p>The Android 4.2 system includes a variety of new developer options that make
500 it easier to create great looking apps that perform well. The new options expose
501 features for <strong>debugging and profiling</strong> your app from any device
502 or emulator.</p>
503
504 <p class="caution" style="clear:right;">On devices running Android 4.2,
505 developer options are hidden by default, helping to create a better experience
506 for users. You can reveal the developer options at any time by tapping 7 times
507 on <strong>Settings</strong> > <strong>About phone</strong> > <strong>Build
508 number</strong> on any compatible Android device.</p>
509
510 <div style="float:left;margin:20px 42px 0px 0px;width:290px;">
511 <div>
512 <img src="{@docRoot}images/jb-dev-options-device.png" width="280" height="548">
513 </div>
514 <p class="image-caption" style="padding:.5em">New <span
515 style="font-weight:500;">developer options</span> give you more ways to profile and debug on a device.</p>
516 </div>
517
518 <p style="margin-top:2em;">New developer options in Android 4.2 include:</p>
519
520 <ul>
521 <li><strong>Take bug report</strong> &mdash; immediately takes a screen shot and
522 dumps device state information to local file storage, then attaches them to a
523 new outgoing email message.</li>
524 <li><strong>Power menu bug reports</strong> &mdash; Adds a new option to the
525 device power menu and quick settings to take a bug report (see above).</li>
526 <li><strong>Verify apps over usb</strong> &mdash; Allows you to disable app
527 checks for sideloading apps over USB, while still checking apps from other
528 sources like the browser. This can speed up the development process while
529 keeping the security feature enabled.</li>
530 <li><strong>Show hardware layers updates</strong> &mdash; Flashes hardware
531 layers green when they update.</li>
532 <li><strong>Show GPU overdraw</strong> &mdash; Highlights GPU overdraw
533 areas.</li>
534 <li><strong>Force 4x MSAA</strong> &mdash; Enables 4x MSAA in Open GL ES 2.0
535 apps.</li>
536 <li><strong>Simulate secondary displays</strong> &mdash; Creates one or more
537 non-secure overlay windows on the current screen for use as a simulated remote
538 display. You can control the simulated display’s size and density.</li>
539 <li><strong>Enable OpenGL traces</strong> &mdash; Lets you trace OpenGL
540 execution using Logcat, Systrace, or callstack on glGetError.</li>
541 </ul>
542
543 <h2 id="42-platform-tech" style="padding-top:1em;clear:left;">New Platform Technologies</h2>
544
545 <p>Android 4.2 includes a variety of new and <strong>enhanced platform technologies</strong> to
546 support innovative communications use-cases across a broad range of hardware
547 devices. In most cases, the new platform technologies and enhancements do not directly
548 affect your apps, so you can benefit from them without any modification.</p>
549
550 <h3 id="42-security">Security enhancements</h3>
551
552 <p>Every Android release includes dozens of security enhancements to protect
553 users.  Here are some of the enhancements in Android 4.2:</p>
554
555 <ul>
556 <li><strong>Application verification</strong> &mdash; Users can choose to enable
557 “Verify Apps" and have applications screened by an application verifier, prior
558 to installation.  App verification can alert the user if they try to install an
559 app that might be harmful; if an application is especially bad, it can block
560 installation.</li>
561 <li><strong>More control of premium SMS</strong> &mdash; Android will provide a
562 notification if an application attempts to send SMS to a short code that uses
563 premium services which might cause additional charges.  The user can choose
564 whether to allow the application to send the message or block it.</li>
565 <li><strong>Always-on VPN</strong> &mdash;  VPN can be configured so that
566 applications will not have access to the network until a VPN connection is
567 established.  This prevents applications from sending data across other
568 networks.</li>
569 <li><strong>Certificate Pinning</strong> &mdash; The libcore SSL implementation
570 now supports certificate pinning.  Pinned domains will receive a certificate
571 validation failure if the certificate does not chain to a set of expected
572 certificates.  This protects against possible compromise of Certificate
573 Authorities.</li>
574 <li><strong>Improved display of Android permissions</strong> &mdash; Permissions
575 have been organized into groups that are more easily understood by users. 
576 During review of the permissions, the user can click on the permission to see
577 more detailed information about the permission.</li>
578 <li><strong>installd hardening</strong> &mdash; The installd daemon does not run
579 as the root user, reducing potential attack surface for root privilege
580 escalation.</li>
581 <li><strong>init script hardening</strong> &mdash;  init scripts now apply
582 O_NOFOLLOW semantics to prevent symlink related attacks.</li>
583 <li><strong>FORTIFY_SOURCE</strong> &mdash;  Android now implements
584 FORTIFY_SOURCE. This is used by system libraries and applications to prevent
585 memory corruption.</li>
586 <li><strong>ContentProvider default configuration</strong> &mdash; Applications
587 which target API level 17 will have “export” set to “false” by default for each
588 ContentProvider, reducing default attack surface for applications.</li>
589 <li><strong>Cryptography</strong> &mdash; Modified the default implementations
590 of SecureRandom and Cipher.RSA to use OpenSSL.  Added  SSLSocket support for
591 TLSv1.1 and TLSv1.2 using OpenSSL 1.0.1</li>
592 <li><strong>Security Fixes</strong> &mdash; Upgraded open source libraries with
593 security fixes include WebKit, libpng, OpenSSL, and LibXML. Android 4.2 also
594 includes fixes for Android-specific vulnerabilities. Information about these
595 vulnerabilities has been provided to Open Handset Alliance members and fixes are
596 available in Android Open Source Project.  To improve security, some devices
597 with earlier versions of Android may also include these fixes.</li>
598 </ul>
599
600 <h3 id="42-bt-stack">New Bluetooth stack</h3>
601
602 Android 4.2 introduces a new Bluetooth stack optimized for use with Android
603 devices. The new Bluetooth stack developed in collaboration between Google and
604 Broadcom replaces the stack based on BlueZ and provides improved compatibility
605 and reliability.
606
607 <h3 id="42-audio">Low-latency audio</h3>
608
609 <p>Android 4.2 improves support for low-latency audio playback, starting from the
610 improvements made in Android 4.1 release for audio output latency using OpenSL
611 ES, Soundpool and tone generator APIs. These improvements depend on hardware
612 support &mdash; devices that offer these low-latency audio features can
613 advertise their support to apps through a hardware feature constant. New
614 AudioManager APIs are provided to query the native audio sample rate and buffer
615 size, for use on devices which claim this feature.</p>
616
617 <h3 id="42-camera-interface">New camera hardware interface</h3>
618
619 Android 4.2 introduces a new implementation of the camera stack. The camera
620 subsystem includes the implementations for components in the camera pipeline
621 such as burst mode capture with processing controls.
622
623 <h3 id="42-nfc-interface">New NFC hardware interface and controller interface</h3>
624
625 Android 4.2 introduces support for controllers based on the NCI standard from
626 the NFC-Forum. NCI provides a standard communication protocol between an NFC
627 Controller (NFCC) and a device Host, and the new NFC stack developed in
628 collaboration between Google and Broadcom supports it.  
629
630 <h3 id="42-dalvik">Dalvik runtime optimizations</h3>
631
632 <p>The Dalvik runtime includes enhancements for performance and security across
633 a wider range of architectures:</p>
634 <ul>
635 <li>x86 JIT support from Intel and MIPS JIT support from MIPS</li>
636 <li>Optimized garbage-collection parameters for devices with > 512MB</li>
637 <li>Default implementations of SecureRandom and Cipher.RSA now use OpenSSL</li>
638 <li>SSLSocket support for TLSv1.1 and TLSv1.2 via OpenSSL 1.0.1</li>
639 <li>New intrinsic support for StrictMath methods abs, min, max, and sqrt</li>
640 <li>BouncyCastle updated to 1.47</li>
641 <li>zlib updated to 1.27</li>
642 <li>dlmalloc updated to 2.8.6</li>
643 </ul>
644
645 </div> <!-- END ANDROID 4.2 -->
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670 <!-- BEGIN ANDROID 4.1 -->
671 <div id="android-41" class="version-section">
672
673 <div style="float:right;width:320px;padding:0px 0px 0px 34px;clear:both">
674 <div>
675 <img src="{@docRoot}images/jb-android-4.1.png" height="426" width="320">
676 </div>
677 </div>
678 <p>Welcome to Android 4.1 the first version of Jelly Bean!</p>
679
680 <p>Android 4.1 is the fastest and smoothest version of Android yet. We’ve made 
681 improvements throughout the platform and added great new features
682 for users and developers. This document provides a glimpse of what's new for developers.
683
684 <p>See the <a href="{@docRoot}about/versions/android-4.1.html">Android 4.1 APIs</a> document for a detailed look at the new developer APIs.</p>
685
686 <p>Find out more about the Jelly Bean features for users at <a href="http://www.android.com/whatsnew">www.android.com</a>.</p>
687
688
689 <h2 id="performance">Faster, Smoother, More Responsive</h2>
690
691 <p>Android 4.1 is optimized to deliver Android's best performance and lowest touch latency, in an effortless, intuitive UI.</p>
692
693 <p>To ensure a consistent framerate, Android 4.1 extends <strong>vsync timing</strong> across all drawing and animation done by the Android framework. Everything runs in lockstep against a 16 millisecond vsync heartbeat &mdash; application rendering, touch events, screen composition, and display refresh &mdash; so frames don’t get ahead or behind.</p>
694
695 <p>Android 4.1 also adds <strong>triple buffering</strong> in the graphics pipeline, for more consistent rendering that makes everything feel smoother, from scrolling to paging and animations.</p>
696
697 <p>Android 4.1 reduces touch latency not only by <strong>synchronizing touch</strong> to vsync timing, but also by actually <strong>anticipating</strong> where 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 <strong>CPU input boost</strong> at the next touch event, to make sure there’s no latency.</p>
698
699 <p><strong>Tooling</strong> can help you get the absolute best performance out of your apps. Android 4.1 is designed to work with a new tool called <strong>systrace</strong>, 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 <a href="{@docRoot}tools/index.html">Android SDK</a> (Tools R20 or higher)</p>
700
701
702 <div style="float:left;margin:12px 24px 0px 0px;">
703 <img src="{@docRoot}images/jb-accessibility-focus-250.png" width="240px" height="469">
704 </div>
705
706 <div style="width:85%;padding-top:16px;">
707 <h2 id="accessibility">Enhanced Accessibility</h2>
708
709 <p>New APIs for accessibility services let you handle gestures and manage <strong>accessibility focus</strong> 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.</p>
710
711 <p>Accessibility services can link their own <strong>tutorials</strong> into the Accessibility settings, to help users configure and use their services.</p>
712
713 <p>Apps that use standard View components <strong>inherit support</strong> 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. </p>
714
715 </div>
716
717 <div style="clear:both;padding-top:1px;">
718
719 <h2 id="intl">Support for International Users</h2>
720
721 <div style="clear:both;padding-top:16px;float:right;">
722
723 <div style="float:right;margin-left:18px;fpadding-top:90px;padding-bottom:60px">
724 <img src="{@docRoot}images/jb-r2l.png" width="280" height="356">
725 </div>
726 </div>
727
728 <h3>Bi-Directional Text and Other Language Support</h3>
729
730 <p>Android 4.1 helps you to reach more users through support for <strong>bi-directional text</strong> 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.</p>
731
732 <p>Other types of new language support include:</p>
733 <ul>
734 <li>Additional Indic languages: Kannada, Telugu, and Malayalam</li>
735 <li>The new Emoji characters from Unicode version 6.0</li>
736 <li>Better glyph support for Japanese users (renders Japanese-specific versions of glyphs when system language is set to Japanese)</li>
737 <li>Arabic glyphs optimized for WebViews in addition to the Arabic glyphs for TextViews</li>
738 <li>Vertical Text support in WebViews, including Ruby Text and additional Vertical Text glyphs</li>
739 <li>Synthetic Bold is now available for all fonts that don't have dedicated bold glyphs</li>
740 </ul>
741
742 <h3>User-installable keymaps</h3>
743
744 <p>The platform now supports <strong>user-installable keyboard maps</strong>, 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).</p>
745
746 <p>You can create an app to <strong>publish additional keymaps</strong> 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. </p>
747 </div>
748
749
750 <h2 id="ui">New Ways to Create Beautiful UI</h2>
751
752
753 <div style="float:right;margin:22px 0px 0px 24px;width:280px;">
754 <div>
755 <!-- <img src="{@docRoot}images/jd-notif-cd.png" style="width:200px"> -->
756 <img src="{@docRoot}images/jb-notif-ex1.png" width="280" height="548">
757 </div>
758 <p class="image-caption" style="padding:.5em">Developers can create custom notification styles
759 like those shown in the examples above to display rich content and actions.</p>
760 </div>
761
762 <h3>Expandable notifications</h3>
763
764 <p>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.</p>
765
766 <p>Android 4.1 brings a major update to the Android notifications framework. Apps can now display <strong>larger, richer notifications</strong> to users that can be expanded and collapsed with a pinch or swipe. Notifications support <strong>new types of content</strong>, including photos, have configurable priority, and can even include multiple actions.</p>
767
768 <p>Through an improved <strong>notification builder</strong>, apps can create notifications that use a larger area, up to 256 dp in height. Three <strong>templated notification styles</strong> are available:</p>
769
770 <ul>
771 <li>BigTextStyle &mdash; a notification that includes a multiline TextView object.</li>
772 <li>BigInboxStyle &mdash; a notification that shows any kind of list such as messages, headlines, and so on.</li>
773 <li>BigPictureStyle &mdash; a notification that showcases visual content such as a bitmap.</li>
774 </ul>
775
776 <p>In addition to the templated styles, you can create your own notification styles <strong>using any remote View</strong>.</p>
777
778 <p>Apps can add up to three <strong>actions</strong> 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.</p>
779
780 <p>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.</p>
781
782 <div style="float:left;margin:66px 30px 0px 0px;width:280px;">
783 <div>
784 <img src="{@docRoot}images/jb-appwidgets.png" width="280" height="548">
785 </div>
786 <p class="image-caption" style="padding:.5em"><span
787 style="font-weight:500;">App Widgets</span> can resize automatically to fit the home screen and load different content as their sizes change.</p>
788 </div>
789
790 <div style="padding-top:1px;clear:right;">
791
792
793 <h3>Resizable app widgets</h3>
794
795 <p>Android 4.1 introduces improved App Widgets that can <strong>automatically resize</strong>, 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 to <strong>optimize your app widget content</strong> as the size of widgets changes.</p>
796
797 <p>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. </p>
798
799 <p>You can also supply separate landscape and portrait layouts for your widgets, which the system inflates as appropriate when the screen orientation changes.</p>
800
801 <p>App widgets can now be displayed in third party launchers and other host apps through a new bind Intent (AppWidgetManager.ACTION_APPWIDGET_BIND).</p>
802
803 </div>
804
805 <h3>Simplified task navigation</h3>
806
807 <p>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.</p>
808
809 <p>You can <strong>define the intended Up navigation</strong> for individual Activity components of your UI by adding a new <strong>XML attribute</strong> 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.</p>
810
811 <p>Also available is a new <strong>TaskStackBuilder</strong> 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.</p>
812
813 <h3>Easy animations for Activity launch</h3>
814
815 <p>You can use a new helper class, <strong>ActivityOptions</strong>, 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.</p>
816
817 <h3>Transitions to Lights Out and Full Screen Modes</h3>
818
819 <p>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). </p>
820
821 <h3>New types of remoteable Views</h3>
822
823 <p>Developers can now use <strong>GridLayout</strong> and <strong>ViewStub</strong> 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.</p>
824
825 <h3>Live wallpaper preview</h3>
826
827 <p>Android 4.1 makes it easier for users to <strong>find and install Live Wallpapers</strong> 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.</p>
828
829 <h3>Higher-resolution contact photos</h3>
830
831 <p>With Android 4.1, you can store <strong>contact photos</strong> that are as large as <strong>720 x 720</strong>, 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 <strong>query the built-in contacts provider</strong> at run time to obtain the max size for the current device. </p>
832
833
834 <h2 id="input">New Input Types and Capabilities</h2>
835
836 <h3>Find out about devices being added and removed</h3>
837
838 <p>Apps can <strong>register to be notified</strong> when any new input devices are attached, by USB, Bluetooth, or any other connection type. They can use this information to change state or capabilities as needed. For example, a game could receive notification that a new keyboard or joystick is attached, indicating the presence of a new player.</p>
839
840 <h3>Query the capabilities of input devices</h3>
841
842 <p>Android 4.1 includes APIs that let apps and games take full advantage of all input devices that are connected and available.</p>
843
844 <p>Apps can query the device manager to enumerate all of the input devices currently attached and learn about the capabilities of each.</p>
845
846 <h3>Control vibrator on input devices</h3>
847
848 <p>Among other capabilities, apps can now make use of any <strong>vibrator service</strong> associated with an attached input device, such as for <strong>Rumble Pak</strong> controllers.</p>
849
850
851 <h2 id="graphics">Animation and Graphics</h2>
852
853 <h3>Vsync for apps</h3>
854
855 <p>Extending vsync across the Android framework leads to a more consistent framerate and a smooth, steady UI. So that apps also benefit, Android 4.1 <strong>extends vsync timing</strong> to all drawing and animations initiated by apps. This lets them optimize operations on the UI thread and provides a stable timebase for synchronization.</p>
856
857 <p>Apps can take advantage of vsync timing for free, through Android’s <strong>animation framework</strong>. The animation framework now uses vsync timing to automatically handle synchronization across animators.</p>
858
859 <p>For specialized uses, apps can access vsync timing through APIs exposed by a new Choreographer class. Apps can request invalidation on the next vsync frame &mdash; a good way to schedule animation when the app is not using the animation framework. For more advanced uses, apps can post a callback that the Choreographer class will run on the next frame. </p>
860
861 <h3>New animation actions and transition types</h3>
862
863 <p>The animation framework now lets you define start and end actions to take when running ViewPropertyAnimator animations, to help synchronize them with other animations or actions in the application. The action can run any runnable object. For example, the runnable might specify another animation to start when the previous one finishes.</p>
864
865 <p>You can also now specify that a ViewPropertyAnimator use a layer during the course of its animation. Previously, it was a best practice to animate complicated views by setting up a layer prior to starting an animation and then handling an onAnimationEnd() event to remove the layer when the animation finishes. Now, the withLayer() method on ViewPropertyAnimator simplifies this process with a single method call.</p>
866
867 <p>A new transition type in LayoutTransition enables you to automate animations in response to all layout changes in a ViewGroup.</p>
868
869
870 <h2 id="connectivity">New Types of Connectivity</h2>
871
872 <h3>Android Beam</h3>
873
874 <p>Android Beam is a popular NFC-based technology that lets users instantly share, just by touching two NFC-enabled phones together.</p>
875
876 <p>In Android 4.1, Android Beam makes it easier to share images, videos, or other payloads by <strong>leveraging Bluetooth for the data transfer</strong>. When the user triggers a transfer, Android Beam hands over from NFC to Bluetooth, making it really easy to manage the transfer of a file from one device to another.</p>
877
878 <h3>Wi-Fi Network Service Discovery</h3>
879
880 <p>Android 4.1 introduces support for multicast <strong>DNS-based service discovery</strong>, which lets applications find and connect to services offered by peer devices over Wi-Fi networks &mdash; including mobile devices, printers, cameras, media players, and others. Developers can take advantage of Wi-Fi network service discovery to build cross-platform or multiplayer games and application experiences.</p>
881
882 <p>Using the service discovery API, apps can create and register any kind of service, for any other NSD-enabled device to discover. The service is advertised by multicast across the network using a human-readable string identifier, which lets user more easily identify the type of service.  </p>
883
884 <p>Consumer devices can use the API to scan and discover services available from devices connected to the local Wi-Fi network. After discovery, apps can use the API to resolve the service to an IP address and port through which it can establish a socket connection.</p>
885
886 <p>You can take advantage of this API to build new features into your apps. For example, you could let users connect to a webcam, a printer, or an app on another mobile device that supports Wi-Fi peer-to-peer connections.  </p>
887
888 <h3>Wi-Fi Direct Service Discovery</h3>
889
890 <p>Ice Cream Sandwich introduced support for Wi-Fi Direct, a technology that lets apps <strong>discover and pair directly</strong>, over a high-bandwidth peer-to-peer connection. Wi-Fi Direct is an ideal way to share media, photos, files and other types of data and sessions, even where there is no cell network or Wi-Fi available.</p>
891
892 <p>Android 4.1 takes Wi-Fi Direct further, adding API support for <strong>pre-associated service discovery</strong>. Pre-associated service discovery lets your apps get more useful information from nearby devices about the services they support, before they attempt to connect.  Apps can initiate discovery for a specific service and filter the list of discovered devices to those that actually support the target service or application.</p>
893
894 <p>For example, this means that your app could discover only devices that are “printers” or that have a specific game available, instead of discovering all nearby Wi-Fi Direct devices. On the other hand, your app can advertise the service it provides to other devices, which can discover it and then negotiate a connection. This greatly simplifies discovery and pairing for users and lets apps take advantage of Wi-Fi Direct more effectively.</p>
895
896 <p>With Wi-Fi Direct service discovery, you can create apps and <strong>multiplayer games</strong> that can share photos, videos, gameplay, scores, or almost anything else &mdash; all without requiring any Internet or mobile network. Your users can connect using only a direct p2p connection, which avoids using mobile bandwidth.</p>
897
898 <h3>Network Bandwidth Management</h3>
899
900 <p>Android 4.1 helps apps <strong>manage data usage</strong> appropriately when the device is <strong>connected to a metered network</strong>, including tethering to a mobile hotspot. Apps can query whether the current network is metered before beginning a large download that might otherwise be relatively expensive to the user. Through the API, you can now get a clear picture of which networks are sensitive to data usage and manage your network activity accordingly.</p>
901
902
903 <h2 id="media">New Media Capabilities</h2>
904
905 <h3>Media codec access</h3>
906
907 <p>Android 4.1 provides low-level access to platform hardware and software codecs. Apps can query the system to discover what <strong>low-level media codecs</strong> are available on the device and then and use them in the ways they need. For example, you can now create multiple instances of a media codec, queue input buffers, and receive output buffers in return. In addition, the media codec framework supports protected content. Apps can query for an available codec that is able to play protected content with a DRM solution available on the the device.</p>
908
909 <h3>USB Audio</h3>
910
911 <p>USB audio output support allows hardware vendors to build hardware such as <strong>audio docks</strong> that interface with Android devices. This functionality is also exposed with the Android <strong>Open Accessory Development Kit</strong> (ADK) to give all developers the chance to create their own hardware.</p>
912
913 <h3>Audio record triggering</h3>
914
915 <p>Android now lets you <strong>trigger audio recording</strong> based on the completion of an audio playback track. This is useful for  situations such as playing back a tone to cue your users to begin speaking to record their voices. This feature helps you sync up recording so you don’t record audio that is currently being played back and prevents recordings from beginning too late.</p>
916
917 <h3>Multichannel audio</h3>
918
919 <p>Android 4.1 supports <strong>multichannel audio</strong> on devices that have hardware multichannel audio out through the <strong>HDMI port</strong>. Multichannel audio lets you deliver rich media experiences to users for applications such as games, music apps, and video players. For devices that do not have the supported hardware, Android automatically downmixes the audio to the number of channels that are supported by the device (usually stereo).</p>
920
921 <p>Android 4.1 also adds built-in support for encoding/decoding AAC 5.1 audio.</p>
922
923 <h3>Audio preprocessing</h3>
924
925 <p>Developers can apply <strong>preprocessing effects</strong> to audio being recorded, such as to apply noise suppression for improving speech recording quality, echo cancellation for acoustic echo, and auto gain control for audio with inconsistent volume levels. Apps that require high quality and clean audio recording will benefit from these preprocessors.</p>
926
927 <h3>Audio chaining</h3>
928
929 <p>MediaPlayer supports <strong>chaining audio streams together</strong> to play audio files without pauses. This is useful for apps that require seamless transitions between audio files such as music players to play albums with continuous tracks or games.</p>
930
931 <h3 id="media-router">Media Router</h3>
932
933 <p>The new APIs MediaRouter, MediaRouteActionProvider, and MediaRouteButton provide standard mechanisms and UI for <strong>choosing where to play media</strong>. Support is built-in for wired headsets and a2dp bluetooth headsets and speakers, and you can add your own routing options within your own app.</p>
934
935 <h2 id="renderscript">Renderscript Computation</h2>
936
937 <p>Android 4.1 extends Renderscript computation to give you more flexibility. You can now <strong>sample textures</strong> in your Renderscript compute scripts, and <strong>new pragmas</strong> are available to define the floating point precision required by your scripts. This lets you enable <strong>NEON instructions</strong> such as fast vector math operations on the CPU path, that wouldn’t otherwise be possible with the full IEEE 754-2008 standard.</p>
938
939 <p>You can now <strong>debug</strong> your Renderscript compute scripts on <strong>x86-based emulator and hardware devices</strong>. You can also define multiple root-style kernels in a single Renderscript source file.</p>
940
941
942 <h2 id="browser">Android Browser and WebView</h2>
943
944 <p>In Android 4.1, the Android Browser and WebViews include these enhancements:</p>
945 <ul>
946 <li>Better HTML5 video user experience, including touch-to-play/pause and smooth transition from inline to full screen mode. </li>
947 <li>Improved rendering speed and reduced memory usage for better scrolling and zooming performance.</li>
948 <li>Improved HTML5/CSS3/Canvas animation performance.</li>
949 <li>Improved text input.</li>
950 <li>Updated JavaScript Engine (V8) for better JavaScript performance.</li>
951 <li>Support for the updated HTML5 Media Capture specification (the "capture" attribute on input type=file elements).</li>
952 </ul>
953
954
955 <h2 id="google">Google APIs and services</h2>
956
957 <p>To extend the capabilities of Android even further, several new services for Android are available.</p>
958
959 <h3 id="gcm">Google Cloud Messaging for Android</h3>
960
961 <p>Google Cloud Messaging (GCM) is a service that lets developers send <strong>short message data</strong> to their users on Android devices, without needing a proprietary sync solution. </p>
962
963 <p>GCM handles all the details of <strong>queuing messages and delivering them</strong> efficiently to the targeted Android devices. It supports message <strong>multicasting</strong> and can reach up to 1000 connected devices simultaneously with a single request. It also supports message <strong>payloads</strong>, which means that in addition to sending tickle messages to an app on the device, developers can send up to 4K of data. </p>
964
965 <p>Google Cloud Messaging is completely <strong>free for all developers</strong> and sign-up is easy. See the <a href="{@docRoot}google/gcm/index.html">Google Cloud Messaging</a> page for registration, downloads, and documentation.</p>
966
967 <h3>App Encryption</h3>
968
969 <p>Starting with Android 4.1, Google Play will help protect application assets by encrypting all paid apps with a device-specific key before they are delivered and stored on a device.</p>
970
971 <h3>Smart App Updates</h3>
972
973 <p>Smart app updates is a new feature of Google Play that introduces a better way of delivering <strong>app updates</strong> to devices. When developers publish an update, Google Play now delivers only the <strong>bits that have changed</strong> to devices, rather than the entire APK. This makes the updates much lighter-weight in most cases, so they are faster to download, save the device’s battery, and conserve bandwidth usage on users’ mobile data plan. On average, a smart app update is about <strong>1/3 the size</strong> of a full APK update.</p>
974
975 <h3 id="gps">Google Play services</h3>
976
977 <p>Google Play services helps developers to <strong>integrate Google services</strong> such as authentication and Google+ into their apps delivered through Google Play.</p> 
978
979 <p>Google Play services is automatically provisioned to end user devices by Google Play, so all you need is a <strong>thin client library</strong> in your apps.</p>
980
981 <p>Because your app only contains the small client library, you can take advantage of these services without a big increase in download size and storage footprint. Also, Google Play will <strong>deliver regular updates</strong> to the services, without developers needing to publish app updates to take advantage of them.</p>
982
983 <p>For more information about the APIs included in Google Play Services, see the <a href="http://developers.google.com/android/google-play-services/index.html">Google Play services</a> developer page.</p>
984
985 </div> <!-- END ANDROID 4.1 -->
986
987
988
989
990
991