blob: e7aa0fac727a4ec2c5086934c085a802ed801679 [file] [log] [blame]
Dirk Dougherty50f8445e2010-11-11 11:52:05 -08001page.title=Android 2.3 Platform
2sdk.platform.version=2.3
3sdk.platform.apiLevel=9
4
5
6@jd:body
7
8<div id="qv-wrapper">
9<div id="qv">
10
11<h2>In this document</h2>
12<ol>
13 <li><a href="#relnotes">Revisions</a></li>
14 <li><a href="#api">API Overview</a></li>
15 <li><a href="#api-level">API Level</a></li>
16 <li><a href="#apps">Built-in Applications</a></li>
17 <li><a href="#locs">Locales</a></li>
18 <li><a href="#skins">Emulator Skins</a></li>
19</ol>
20
21<h2>Reference</h2>
22<ol>
23<li><a
24href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
25Differences Report &raquo;</a> </li>
26</ol>
27
28<h2>See Also</h2>
29<ol>
30 <li><a href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a></li>
31</ol>
32
33</div>
34</div>
35
36<p>
37<em>API Level:</em>&nbsp;<strong>{@sdkPlatformApiLevel}</strong></p>
38
39<p>For developers, the Android {@sdkPlatformVersion} platform is available as a
40downloadable component for the Android SDK. The downloadable platform includes
41an Android library and system image, as well as a set of emulator
42skins and more. The downloadable platform
43includes no external libraries.</p>
44
45<p>To get started developing or testing against Android
46{@sdkPlatformVersion}, use the Android SDK Manager to
47download the platform into your SDK. For more information,
48see <a href="{@docRoot}sdk/adding-components.html">Adding SDK
49Components</a>. If you are new to Android, <a
50href="{@docRoot}sdk/index.html">download the SDK Starter Package</a>
51first.</p>
52
53<p>For a high-level introduction to Android {@sdkPlatformVersion}, see the <a
Scott Mainea723292011-02-09 16:01:04 -080054href="{@docRoot}sdk/android-{@sdkPlatformVersion}-highlights.html">Platform Highlights</a>.</p>
Dirk Dougherty50f8445e2010-11-11 11:52:05 -080055
56
57<h2 id="relnotes">Revisions</h2>
58
59<p>The sections below provide notes about successive releases of
60the Android {@sdkPlatformVersion} platform component for the Android SDK, as denoted by
61revision number. To determine what revision(s) of the Android
62{@sdkPlatformVersion} platforms are installed in your SDK environment, refer to
63the "Installed Packages" listing in the Android SDK and AVD Manager.</p>
64
65<script type="text/javascript">
66function toggleDiv(link) {
67 var toggleable = $(link).parent();
68 if (toggleable.hasClass("closed")) {
69 //$(".toggleme", toggleable).slideDown("fast");
70 toggleable.removeClass("closed");
71 toggleable.addClass("open");
72 $(".toggle-img", toggleable).attr("title", "hide").attr("src", (toRoot + "assets/images/triangle-opened.png"));
73 } else {
74 //$(".toggleme", toggleable).slideUp("fast");
75 toggleable.removeClass("open");
76 toggleable.addClass("closed");
77 $(".toggle-img", toggleable).attr("title", "show").attr("src", (toRoot + "assets/images/triangle-closed.png"));
78 }
79 return false;
80}
81</script>
82<style>
83.toggleable {
84 padding: .25em 1em 0em 1em;
85 margin-bottom: 0;
86}
87.toggleme {
88 padding: 1em 1em 0 2em;
89 line-height:1em;
90}
91.toggleable a {
92 text-decoration:none;
93}
94.toggleme a {
95 text-decoration:underline;
96}
97.toggleable.closed .toggleme {
98 display:none;
99}
100#jd-content .toggle-img {
101 margin:0;
102}
103</style>
104
105<div class="toggleable opened">
106 <a href="#" onclick="return toggleDiv(this)">
107 <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-img" height="9px" width="9px" />
108 Android {@sdkPlatformVersion}, Revision 1</a> <em>(December 2010)</em></a>
109 <div class="toggleme">
110<dl>
111<dt>Dependencies:</dt>
112<dd>
113<p>Requires SDK Tools r8 or higher.</p>
114</dd>
115
116</dl>
117 </div>
118</div>
119
120<h2 id="api">API Overview</h2>
121
122<p>The sections below provide a technical overview of what's new for developers
123in {@sdkPlatformVersion}, including new features and changes in the framework
124API since the previous version.</p>
125
126
Scott Maine9123962010-12-06 16:19:32 -0800127<h3 id="sip">SIP-based VoIP</h3>
Dirk Dougherty50f8445e2010-11-11 11:52:05 -0800128
129<p>The platform now includes a SIP protocol stack and framework API that lets
130developers build internet telephony applications. Using the API, applications can offer
131voice calling features without having to manage sessions, transport-level
132communication, or audio &mdash; these are handled
133transparently by the platform's SIP API and services.</p>
134
135<p>The SIP API is available in the {@link android.net.sip android.net.sip}
136package. The key class is {@link android.net.sip.SipManager}, which applications
137use to set up and manage SIP profiles, then initiate audio calls and receive
138audio calls. Once an audio call is established, applications can mute calls,
139turn on speaker mode, send DTMF tones, and more. Applications can also use the
140{@link android.net.sip.SipManager} to create generic SIP connections.</p>
141
142<p>The platform’s underlying SIP stack and services are available on devices at
143the discretion of the manufacturer and associated carrier. For this reason,
144applications should use the {@link android.net.sip.SipManager#isApiSupported
145isApiSupported()} method to check whether SIP support is available, before
146exposing calling functionality to users. </p>
147
148<p>To use the SIP API, applications must request permission from the user by
149declaring <code>&lt;uses-permission
150android:name="android.permission.INTERNET"&gt;</code> and <code>&lt;uses-permission
151android:name="android.permission.USE_SIP"&gt;</code> in their manifest files.</p>
152
153<p>Additionally, developers can request filtering on Android Market, such that
154their applications are not discoverable to users whose devices do not include
155the platform’s SIP stack and services. To request filtering, add <code>&lt;uses-feature
156android:name="android.software.sip"
157android:required="true"&gt;</code> and <code>&lt;uses-feature
158android:name="android.software.sip.voip"&gt;</code> to the application manifest.</p>
159
160<p class="note">To look at a sample application that uses the SIP API, see <a
161href="{@docRoot}resources/samples/SipDemo/index.html">SIP Demo</a>.</p>
162
163<h3 id="nfc">Near Field Communications (NFC)</h3>
164
165<p>Android 2.3 includes an NFC stack and framework API that lets developers
166read NDEF tags that are discovered as a user touches an NFC-enabled device
167to tag elements embedded in stickers, smart posters, and even other devices.</p>
168
169<p>The platform provides the underlying NFC services that work with the device
170hardware to discover tags when they come into range. On discovering a tag, the
171platform notifies applications by broadcasting an Intent, appending the tag's
172NDEF messages to the Intent as extras. Applications can create Intent filters to
173recognize and handle targeted tags and messages. For example, after receiving a
174tag by Intent, applications extract the NDEF messages, store them, alert the
175user, or handle them in other ways. </p>
176
177<p>The NFC API is available in the {@link android.nfc} package. The key classes are: </p>
178
179<ul><li>{@link android.nfc.NfcAdapter}, which represents the NFC hardware on the device.</li>
180<li>{@link android.nfc.NdefMessage}, which represents an NDEF data message,
181the standard format in which "records" carrying data are transmitted between
182devices and tags. Applications can receive these messages from {@link
183android.nfc.NfcAdapter#ACTION_TAG_DISCOVERED}</code> Intents.</li>
184<li>{@link android.nfc.NdefRecord}, delivered in an
185{@link android.nfc.NdefMessage}, which describes the type of data being shared and
186carries the data itself.</li>
187</ul>
188
189<p>NFC communication relies on wireless technology in the device hardware, so
190support for the platform's NFC features on specific devices is determined by
191their manufacturers. To determine the NFC support on the current device,
192applications can call {@link android.nfc.NfcAdapter#isEnabled isEnabled()} to
193query the {@link android.nfc.NfcAdapter}. The NFC API is always present,
194however, regardless of underlying hardware support.</p>
195
196<p>To use the NFC API, applications must request permission from the user by
197declaring <code>&lt;uses-permission
198android:name="android.permission.NFC"&gt;</code> in their manifest files.</p>
199
200<p>Additionally, developers can request filtering on Android Market, such that
201their applications are not discoverable to users whose devices do not support
202NFC. To request filtering, add
203<code>&lt;uses-feature android:name="android.hardware.nfc"
204android:required="true"&gt;</code> to the application's manifest.</p>
205
206<p class="note">To look at a sample application that uses the NFC API, see
207<a href="{@docRoot}resources/samples/NFCDemo/index.html">NFCDemo</a>.</p>
208
209<h3 id="sensors">Gyroscope and other sensors</h3>
210
211<p>Android 2.3 adds platform and API support for several new sensor reading
212types &mdash; gyroscope, rotation vector, linear acceleration, gravity, and barometer.
213Developers can use the new sensor readings to create applications that respond
214quickly and smoothly to precise changes in device position and motion. The
215Sensor API reports gyroscope and other sensor changes to interested
216applications, whether they are running on the application framework or in native
217code. </p>
218
219<p>Note that the specific set of hardware sensors available on any given device
220varies at the discretion of the device manufacturer. </p>
221
222<p>Developers can request filtering in Android Market, such that their
223applications are not discoverable to users whose devices do not offer a
224gyroscope sensor. To do so, add <code>&lt;uses-feature
225android:name="android.hardware.sensor.gyroscope"
226android:required="true"&gt;</code> to the application manifest.</p>
227
Scott Main60c4e032011-01-07 14:48:18 -0800228<p>For API details, see {@link android.hardware.Sensor}.</p>
Dirk Dougherty50f8445e2010-11-11 11:52:05 -0800229
230
231<h3 id="cameras">Multiple cameras support</h3>
232
233<p>Applications can now make use of any cameras that are available on a device,
234for either photo or video capture. The {@link android.hardware.Camera} lets
235applications query for the number of cameras available and the unique
236characteristics of each. </p>
237
238<ul>
239<li>New {@link android.hardware.Camera.CameraInfo} class stores a camera's
240positional characteristics (orientation, front-facing or back-facing).</li>
Scott Main00410252010-12-20 08:52:16 -0800241<li>New {@link android.hardware.Camera#getNumberOfCameras()} and {@link
242android.hardware.Camera#getCameraInfo(int,CameraInfo) getCameraInfo()} methods in the {@link
Dirk Dougherty50f8445e2010-11-11 11:52:05 -0800243android.hardware.Camera} class let applications query for the cameras available
244and open the camera that they need.</li>
Scott Main60c4e032011-01-07 14:48:18 -0800245<li>New {@link android.media.CamcorderProfile#get get()} method lets
246applications retrieve a {@link android.media.CamcorderProfile} for a specific camera. </li>
247<li>New {@link android.media.CameraProfile#getJpegEncodingQualityParameter(int, int)
Dirk Dougherty50f8445e2010-11-11 11:52:05 -0800248getJpegEncodingQualityParameter()} lets applications obtain the still-image
249capture quality level for a specific camera.</li>
250</ul>
251
252<p class="note">To look at sample code for accessing a front-facing camera, see <a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html">CameraPreview.java</a>
253in the ApiDemos sample application.</p>
254
255<p>The Camera API also adds: </p>
256<ul>
257<li>New parameters for cameras, including focus distance, focus mode, and
258preview fps maximum/minimum. New {@link
259android.hardware.Camera.Parameters#getFocusDistances(float[])
260getFocusDistances()}, {@link
261android.hardware.Camera.Parameters#getPreviewFpsRange(int[])
262getPreviewFpsRange()}, and {@link
263android.hardware.Camera.Parameters#getSupportedPreviewFpsRange()
264getSupportedPreviewFpsRange()} for getting camera parameters, as well as {@link
265android.hardware.Camera.Parameters#setPreviewFpsRange(int, int)
266setPreviewFpsRange()} for setting preview framerate. </li>
267</ul>
268
269<h3 id="media">Mixable audio effects</h3>
270
271<p>The platform's media framework adds support for new per-track or global audio effects,
272including bass boost, headphone virtualization, equalization, and reverb.</p>
273<ul>
274<li>New {@link android.media.audiofx android.media.audiofx} package provides the
275API to access audio effects.</li>
276<li>New {@link android.media.audiofx.AudioEffect AudioEffect} is the base class
277for controlling audio effects provided by the Android audio framework.
278<li>New audio session ID that lets an application associate a set of audio
279effects with an instance of {@link android.media.AudioTrack} or {@link
280android.media.MediaPlayer}.</li>
281<li>New {@link android.media.AudioTrack#AudioTrack(int, int, int, int, int, int,
282int) AudioTrack} class constructor that lets you create an {@link
283android.media.AudioTrack} with a specific session ID. New {@link
284android.media.AudioTrack#attachAuxEffect(int) attachAuxEffect()}, {@link
285android.media.AudioTrack#getAudioSessionId() getAudioSessionId()}, and {@link
286android.media.AudioTrack#setAuxEffectSendLevel(float) setAuxEffectSendLevel()}
287methods.</li>
288<li>New {@link android.media.MediaPlayer#attachAuxEffect(int)
289attachAuxEffect()}, {@link android.media.MediaPlayer#getAudioSessionId()
290getAudioSessionId()}, {@link android.media.MediaPlayer#setAudioSessionId(int)
291setAudioSessionId(int)}, and {@link
292android.media.MediaPlayer#setAuxEffectSendLevel(float) setAuxEffectSendLevel()}
293methods and supporting types.</li>
294</ul>
295
296<p class="note">To look at sample code for audio effects, see
297<a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/media/AudioFxDemo.html">AudioFxDemo.java</a>
298in the ApiDemos sample application.</p>
299
300<p>The media framework also adds:</p>
301<ul>
302<li>New support for altitude tag in EXIF metadata for JPEG files. New method
303{@link android.media.ExifInterface#getAltitude(double) getAltitude()} method to
304retrieve the value of the EXIF altitude tag.</li>
305<li>New {@link android.media.MediaRecorder#setOrientationHint(int)
306setOrientationHint()} method lets an application tell {@link
307android.media.MediaRecorder} of the orientation during video capture.</li>
308</ul>
309
310<h3 id="download">Download manager</h3>
311
312<p>The platform includes a new {@link android.app.DownloadManager} system service
313that handles long-running HTTP downloads. Applications can request that a URI be
314downloaded to a particular destination file. The <code>DownloadManager</code>
315will conduct the download in the background, taking care of HTTP interactions
316and retrying downloads after failures or across connectivity changes and system
317reboots. </p>
318<ul>
319<li>Applications can obtain an instance of the {@link android.app.DownloadManager}
320class by calling {@link
321android.content.Context#getSystemService(String)} and passing
322{@link android.content.Context#DOWNLOAD_SERVICE}. Applications that request
323downloads through this API should register a broadcast receiver for {@link
324android.app.DownloadManager#ACTION_NOTIFICATION_CLICKED}, to appropriately
325handle when the user clicks on a running download in a notification or from the
326Downloads UI.</li>
327<li>The {@link android.app.DownloadManager.Request} class lets an
328application provide all the information necessary to request a new download,
329such as request URI and download destination. A request URI is the only required
330parameter. Note that the default download destination is a shared volume where
331the system can delete your file if it needs to reclaim space for system use. For
332persistent storage of a download, specify a download destination on external
333storage (see {@link
334android.app.DownloadManager.Request#setDestinationUri(Uri)}).</li>
335<li>The {@link android.app.DownloadManager.Query} class provides methods that let
336an application query for and filter active downloads.</li>
337</ul>
338
339<h3 id="strictmode">StrictMode</h3>
340
341<p>To help developers monitor and improve the performance of their applications,
342the platform offers a new system facility called {@link android.os.StrictMode}.
343When implemented in an application, StrictMode catches and notifies the
344developer of accidental disk or network activity that could degrade application
345performance, such as activity taking place on the application's main thread
346(where UI operations are received and animations are also taking place).
347Developers can evaluate the network and disk usages issues raised in StrictMode
348and correct them if needed, keeping the main thread more responsive and
349preventing ANR dialogs from being shown to users.
350
351<ul>
352<li>{@link android.os.StrictMode} is the core class and is the main integration
353point with the system and VM. The class provides convenience methods for
354managing the thread and VM policies that apply to the instance.</li>
355<li>{@link android.os.StrictMode.ThreadPolicy} and {@link
356android.os.StrictMode.VmPolicy} hold the policies that you define and apply to
357thread and VM instances.</li>
358</ul>
359
360<p>For more information about how to use StrictMode to optimize your
361application, see the class documentation and sample code at {@link
362android.os.StrictMode android.os.StrictMode}.</p>
363
364<h3 id="ui">UI Framework</h3>
365
366<ul>
367<li>Support for overscroll
368<ul>
369<li>New support for overscroll in Views and Widgets. In Views, applications can
370enable/disable overscroll for a given view, set the overscoll mode, control the
371overscroll distance, and handle the results of overscrolling. </li>
372<li>In Widgets, applications can control overscroll characteristics such as
373animation, springback, and overscroll distance. For more information, see {@link
374android.view.View android.view.View} and {@link android.widget.OverScroller
375android.widget.OverScroller}. </li>
376<li>{@link android.view.ViewConfiguration} also provides methods {@link
377android.view.ViewConfiguration#getScaledOverflingDistance()} and {@link
378android.view.ViewConfiguration#getScaledOverscrollDistance()}.</li>
379<li>New <code>overScrollMode</code>, <code>overScrollFooter</code>, and
380<code>overScrollHeader</code> attributes for <code>&lt;ListView&gt;</code> elements,
381for controlling overscroll behavior.</li>
382</ul>
383</li>
384
385<li>Support for touch filtering
386<ul>
387<li>New support for touch filtering, which lets an application improve the
388security of Views that provide access to sensitive functionality. For example,
389touch filtering is appropriate to ensure the security of user actions such as
390granting a permission request, making a purchase, or clicking on an
391advertisement. For details, see the <a
Scott Main60c4e032011-01-07 14:48:18 -0800392href="{@docRoot}reference/android/view/View.html#Security">View class
Dirk Dougherty50f8445e2010-11-11 11:52:05 -0800393documentation</a>.</li>
394<li>New <code>filterTouchesWhenObscured</code> attribute for view elements,
395which declares whether to filter touches when the view's window is obscured by
396another visible window. When set to <code>"true"</code>, the view will not
397receive touches whenever a toast, dialog or other window appears above the
398view's window. Refer to <a
Scott Main60c4e032011-01-07 14:48:18 -0800399href="{@docRoot}reference/android/view/View.html#Security">View security
Dirk Dougherty50f8445e2010-11-11 11:52:05 -0800400documentation</a> for details.</li>
401</ul>
402
403<p class="note">To look at sample code for touch filtering, see
Scott Main60c4e032011-01-07 14:48:18 -0800404<a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/SecureView.html">SecureView.java</a>
Dirk Dougherty50f8445e2010-11-11 11:52:05 -0800405in the ApiDemos sample application.</p>
406</li>
407
408<li>Improved event management
409<ul>
410<li>New base class for input events, {@link android.view.InputEvent}. The class
411provides methods that let applications determine the meaning of the event, such
412as by querying for the InputDevice from which the event orginated. The {@link
413android.view.KeyEvent} and {@link android.view.MotionEvent} are subclasses of
414{@link android.view.InputEvent}.</li>
415<li>New base class for input devices, {@link android.view.InputDevice}. The
416class stores information about the capabilities of a particular input device and
417provides methods that let applications determine how to interpret events from an
418input device.</li>
419</ul>
420</li>
421
422<li>Improved motion events
423<ul>
424<li>The {@link android.view.MotionEvent} API is extended to include "pointer ID"
425information, which lets applications to keep track of individual fingers as they
426move up and down. The class adds a variety of methods that let an application
427work efficiently with motion events.</li>
428<li>The input system now has logic to generate motion events with the new
429pointer ID information, synthesizing identifiers as new pointers are down. The
430system tracks multiple pointer IDs separately during a motion event, and
431ensures proper continuity of pointers by evaluating at the distance
432between the last and next set of pointers.</li>
433</ul>
434</li>
435
436<li>Text selection controls
437<ul>
438<li>A new <code>setComposingRegion</code> method lets an application mark a
439region of text as composing text, maintaining the current styling. A
440<code>getSelectedText</code> method returns the selected text to the
441application. The methods are available in {@link
442android.view.inputmethod.BaseInputConnection}, {@link
443android.view.inputmethod.InputConnection}, and {@link
444android.view.inputmethod.InputConnectionWrapper}.</li>
445<li>New <code>textSelectHandle</code>, <code>textSelectHandleLeft</code>,
446<code>textSelectHandleRight</code>, and <code>textSelectHandleWindowStyle</code>
447attributes for <code>&lt;TextView&gt;</code>, for referencing drawables that will be
448used to display text-selection anchors and the style for the containing
449window.</li>
450</ul>
451</li>
452
453<li>Activity controls
454<ul>
455<li>{@link android.content.pm.ActivityInfo} adds new constants for managing
456Activity orientation:
457{@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_FULL_SENSOR},
458{@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_REVERSE_LANDSCAPE},
459{@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_REVERSE_PORTRAIT},
460{@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_SENSOR_LANDSCAPE},
461and
462{@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_SENSOR_PORTRAIT}.
463</li>
464<li>New constant {@link
465android.app.ActivityManager.RunningAppProcessInfo#IMPORTANCE_PERCEPTIBLE} for
466the {@link android.app.ActivityManager.RunningAppProcessInfo#importance} field
467in {@link android.app.ActivityManager.RunningAppProcessInfo}. The value
468indicates that a specific process is running something that is considered to be
469actively perceptible to the user. An example would be an application performing
470background music playback.</li>
Dianne Hackborn4f3867e2010-12-14 22:09:51 -0800471<li>The Activity.setPersistent(boolean) method to mark an
Dirk Dougherty50f8445e2010-11-11 11:52:05 -0800472Activity as persistent is now deprecated and the implementation is a no-op.</li>
473</ul>
474</li>
475
476<li>Notification text and icon styles
477<ul>
478<li>New {@link android.R.style#TextAppearance_StatusBar_EventContent
479TextAppearance.StatusBar.EventContent},
480{@link android.R.style#TextAppearance_StatusBar_EventContent_Title
481TextAppearance.StatusBar.EventContent.Title},
482{@link android.R.style#TextAppearance_StatusBar_Icon
483TextAppearance.StatusBar.Icon}, and
484{@link android.R.style#TextAppearance_StatusBar_Title
485TextAppearance.StatusBar.Title} for managing
486notification style.</li>
487</ul>
488</li>
489
490<li>WebView
491<ul>
492<li>New {@link
493android.webkit.WebSettings#setUseWebViewBackgroundForOverscrollBackground(
494boolean) setUseWebViewBackgroundForOverscrollBackground()} method lets a {@link
495android.webkit.WebView} specify whether to use its own background for the
496overscroll background. </li>
497</ul>
498</li>
499</ul>
500
501<h3 id="extralargescreens">Extra Large Screens</h3>
502
503<p>The platform now supports extra large screen sizes, such as those that might
504be found on tablet devices. Developers can indicate that their applications are
505designed to support extra large screen sizes by adding a <code>&lt;supports
506screens ... android:xlargeScreens="true"&gt;</code> element to their manifest
507files. Applications can use a new resource qualifier, <code>xlarge</code>, to
508tag resources that are specific to extra large screens. For
509details on how to support extra large and other screen sizes, see <a
510href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
511Screens</a>.</p>
512
513<h3 id="graphics">Graphics</h3>
514
515<ul>
516<li>Adds remaining OpenGL ES 2.0 methods {@link
517android.opengl.GLES20#glDrawElements(int, int, int, int) glDrawElements()} and
518{@link android.opengl.GLES20#glVertexAttribPointer(int, int, int, boolean, int,
519int) glVertexAttribPointer()} in the {@link android.opengl.GLES20
520android.opengl.GLES20} class.</li>
521<li>Adds support for {@link android.graphics.ImageFormat#YV12} pixel format, a
522planar 4:2:0 YCrCb format.</li>
523</ul>
524
525<h3 id="providers">Content Providers</h3>
526
527<ul>
528<li>New {@link android.provider.AlarmClock} provider class for setting an alarm
529or handling an alarm. The provider contains a <code>ACTION_SET_ALARM</code> Intent
530action and extras that can be used to start an Activity to set a new alarm in an
531alarm clock application. Applications that wish to receive the
532<code>SET_ALARM</code> Intent should create an activity that requires the
533the SET_ALARM permission. Applications that wish to create a new
534alarm should use {@link
535android.content.Context#startActivity(android.content.Intent)
536Context.startActivity()}, so that the user has the option of choosing
537which alarm clock application to use.</li>
538
539<li>{@link android.provider.MediaStore} supports a new Intent action, {@link
540android.provider.MediaStore#INTENT_ACTION_MEDIA_PLAY_FROM_SEARCH
541PLAY_FROM_SEARCH}, that lets an application search for music media and
542automatically play content from the result when possible. For example, an
543application could fire this Intent as the result of a voice recognition command
544to listen to music.</li>
545<li>{@link android.provider.MediaStore} also adds a new {@link
546android.provider.MediaStore#MEDIA_IGNORE_FILENAME} flag that tells the media
547scanner to ignore media in the containing directory and its subdirectories.
548Developers can use this to avoid having graphics appear in the Gallery and
549likewise prevent application sounds and music from showing up in the Music
550app.</li>
551
552<li>The {@link android.provider.Settings} provider adds the new Activity actions
553{@link android.provider.Settings#ACTION_APPLICATION_DETAILS_SETTINGS
554APPLICATION_DETAILS_SETTINGS} and {@link
555android.provider.Settings#ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS
556MANAGE_ALL_APPLICATIONS_SETTINGS}, which let an application show the details
557screen for a specific application or show the Manage Applications screen. </li>
558
559<li>The {@link android.provider.ContactsContract} provider adds the {@link
560android.provider.ContactsContract.CommonDataKinds.SipAddress} data kind, for
561storing a contact's SIP (Internet telephony) address. </li>
562</ul>
563
564<h3 id="location">Location</h3>
565
566<ul>
567<li>The {@link android.location.LocationManager} now tracks application
568requests that result in wake locks or wifi locks according to
569{@link android.os.WorkSource}, a system-managed class that identifies the
570application.
571<p>The <code>LocationManager</code> keeps track
572of all clients requesting periodic updates, and tells its providers
573about them as a <code>WorkSource</code> parameter, when setting their minimum
574update times.
575The network location provider uses <code>WorkSource</code> to track the
576wake and wifi locks initiated by an application and adds it to the application's
577battery usage reported in Manage Applications. </p></li>
578<li>The {@link android.location.LocationManager} adds several new methods that
579let an Activity register to receive periodic or one-time location updates based
580on specified criteria (see below).</li>
581<li>A new {@link android.location.Criteria} class lets an application specify a
582set of criteria for selecting a location provider. For example, providers may be
583ordered according to accuracy, power usage, ability to report altitude, speed,
584and bearing, and monetary cost. </li>
585</ul>
586
587<h3 id="storage">Storage</h3>
588
589<ul>
590<li>Android 2.3 adds a new {@link android.os.storage.StorageManager} that
591supports OBB (Opaque Binary Blob) files. Although platform support for OBB is
592available in Android 2.3, development tools for creating and managing OBB files
593will not be availble until early 2011.</li>
594<li>The Android 2.3 platform adds official support for devices that do not
595include SD cards (although it provides virtual SD Card partition, when no
596physical SD card is available). A convenience method, {@link
597android.os.Environment#isExternalStorageRemovable()}, lets applications
598determine whether a physical SD card is present.</li>
599</ul>
600
601<h3 id="packagemanager">Package Manager</h3>
602
603<ul>
604<li>New constants for declaring hardware and software features. See the list in
605the <a href="#feature_constants">New Feature Constants</a> section, below.</li>
606<li>{@link android.content.pm.PackageInfo} adds new {@link
607android.content.pm.PackageInfo#firstInstallTime} and {@link
608android.content.pm.PackageInfo#lastUpdateTime} fields that store the time of the
609package installation and last update. </li>
610<li>New {@link
611android.content.pm.PackageManager#getProviderInfo(android.content.ComponentName,
612int) getProviderInfo()} method for retrieving all of the information known about
613a particular content provider class.</li>
614</ul>
615
616<h3 id="telephony">Telephony</h3>
617
618<ul>
619<li>The {@link android.telephony.TelephonyManager} adds the constant {@link
620android.telephony.TelephonyManager#NETWORK_TYPE_EVDO_B} for specifying the CDMA
621EVDO Rev B network type.</li>
622<li>New {@link android.telephony.gsm.GsmCellLocation#getPsc()} method returns
623the primary scrambling code of the serving cell on a UMTS network.</li>
624</ul>
625
626<h3 id="native">Native access to Activity lifecycle, windows</h3>
627
628<p>Android 2.3 exposes a broad set of APIs to applications that use native
629code. Framework classes of interest to such applications include: </p>
630
631<ul>
632<li>{@link android.app.NativeActivity} is a new type of Activity class, whose
633lifecycle callbacks are implemented directly in native code. A
634<code>NativeActivity</code> and its underlying native code run in the system
635just as do other Activities &mdash; specifically they run in the Android
636application's system process and execute on the application's main UI thread,
637and they receive the same lifecycle callbacks as do other Activities. </li>
638<li>New {@link android.view.InputQueue} class and callback interface lets native
639code manage event queueing. </li>
640<li>New {@link android.view.SurfaceHolder.Callback2} interface lets native code
641manage a {@link android.view.SurfaceHolder}. </li>
642<li>New {@link
643android.view.Window#takeInputQueue(android.view.InputQueue.Callback)
644takeInputQueue} and {@link
645android.view.Window#takeSurface(android.view.SurfaceHolder.Callback2)
646takeSurface()} methods in {@link android.view.Window} let native code manage
647events and surfaces.</li>
648</ul>
649
650<p>For full information on working with native code or to download the NDK,
651see the <a href="{@docRoot}sdk/ndk/index.html">Android NDK</a> page.</p>
652
653
654<h3 id="dalvik">Dalvik Runtime</h3>
655
656<ul>
657<li>{@link dalvik.system dalvik.system}
658removes several classes that were previously deprecated.</li>
659<li>Dalvik core libraries:
660<ul>
661 <li>New collections: {@link java.util.ArrayDeque}, {@link java.util.NavigableMap},
662 {@link java.util.concurrent.ConcurrentSkipListMap},
663 {@link java.util.concurrent.LinkedBlockingDeque}</li>
664 <li>New {@link java.util.Arrays} utilities: <code>binarySearch()</code>,
665 <code>copyOf()</code>, <code>copyOfRange()</code>, and others.</li>
666 <li>{@link java.net.CookieManager} for {@link java.net.HttpURLConnection}.</li>
667 <li>More complete network APIs: {@link java.net.InterfaceAddress},
668 {@link java.net.NetworkInterface} and {@link java.net.IDN}</li>
669 <li>{@link java.io.File} read and write controls</li>
670 <li>{@link java.lang.String#isEmpty() String.isEmpty()}</li>
671 <li>{@link java.text.Normalizer} and {@link java.text.Normalizer.Form}</li>
672 <li>Improved {@link javax.net.ssl} server sockets.</li>
673</ul>
674</li>
675</ul>
676
677<h3 id="manifest">New manifest elements and attributes</h3>
678
679<ul>
680<li>New <code>xlargeScreens</code> attribute for <a
Scott Main1bcfd852010-12-06 16:19:32 -0800681href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
682&lt;supports-screens&gt;}</a>
Dirk Dougherty50f8445e2010-11-11 11:52:05 -0800683element, to indicate whether the application supports
684extra large screen form-factors. For details, see <a
685href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
686Screens</a>.</li>
687<li>New values for <code>android:screenOrientation</code> attribute of
688<code>&lt;activity&gt;</code> element:
689<ul>
690<li><code>"reverseLandscape"</code> &mdash; The Activity would like to have the
691screen in landscape orientation, turned in the opposite direction from normal
692landscape.</li>
Scott Main00410252010-12-20 08:52:16 -0800693<li><code>"reversePortrait"</code> &mdash; The Activity would like to have the
Dirk Dougherty50f8445e2010-11-11 11:52:05 -0800694screen in portrait orientation, turned in the opposite direction from normal
695portrait.</li>
696<li><code>"sensorLandscape"</code> &mdash; The Activity would like to have the
697screen in landscape orientation, but can use the sensor to change which
698direction the screen is facing.</li>
699<li><code>"sensorPortrait"</code> &mdash; The Activity would like to have the
700screen in portrait orientation, but can use the sensor to change which direction
701the screen is facing.</li>
702<li><code>"fullSensor"</code> &mdash; Orientation is determined by a physical
703orientation sensor: the display will rotate based on how the user moves the
704device. This allows any of the 4 possible rotations, regardless of what the
705device will normally do (for example some devices won't normally use 180 degree
706rotation).</li>
707</ul>
708</li>
709</ul>
710
711<h3 id="permissions">New Permissions</h3>
712
713<ul>
714<li><code>com.android.permission.SET_ALARM</code> &mdash; Allows an application
715to broadcast an Intent to set an alarm for the user. An Activity that handles
716the {@link android.provider.AlarmClock#ACTION_SET_ALARM SET_ALARM} Intent action
717should require this permission.</li>
718<li><code>android.permission.USE_SIP</code> &mdash; Allows an application to use
719the {@link android.net.sip SIP API} to make or receive internet calls.
720<li><code>android.permission.NFC</code> &mdash; Allows an application to use the
Scott Maine9123962010-12-06 16:19:32 -0800721{@link android.nfc NFC API} to read NFC tags.</li>
Dirk Dougherty50f8445e2010-11-11 11:52:05 -0800722</ul>
723
724<h3 id="feature_constants">New Feature Constants</h3>
725
726<p>The platform adds several new hardware features that developers can declare
727in their application manifests as being required by their applications. This
728lets developers control how their application is filtered, when published on
729Android Market. </p>
730
731<ul>
732<li>{@link android.content.pm.PackageManager#FEATURE_AUDIO_LOW_LATENCY
733android.hardware.audio.low_latency} &mdash; The application uses a low-latency
734audio pipeline on the device and is sensitive to delays or lag in sound input or
735output.</li>
736<li>{@link android.content.pm.PackageManager#FEATURE_CAMERA_FRONT
737android.hardware.camera.front} &mdash; The application uses a front-facing
738camera on the device.</li>
739<li>{@link android.content.pm.PackageManager#FEATURE_NFC android.hardware.nfc}
740&mdash; The application uses NFC radio features in the device.</li>
741<li>{@link android.content.pm.PackageManager#FEATURE_SENSOR_BAROMETER
742android.hardware.sensor.barometer} &mdash; The application uses the device's
743barometer.</li>
744<li>{@link android.content.pm.PackageManager#FEATURE_SENSOR_GYROSCOPE
745android.hardware.sensor.gyroscope} &mdash; The application uses the device's
746gyroscope sensor.</li>
747<li>{@link android.content.pm.PackageManager#FEATURE_SIP android.software.sip}
748&mdash; The application uses the SIP API on the device.</li>
749<li>{@link android.content.pm.PackageManager#FEATURE_SIP_VOIP
Scott Maine9123962010-12-06 16:19:32 -0800750android.software.sip.voip} &mdash; The application uses a SIP-based VoIP
Dirk Dougherty50f8445e2010-11-11 11:52:05 -0800751service on the device.</li>
752<li>{@link
753android.content.pm.PackageManager#FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND
754android.hardware.touchscreen.multitouch.jazzhand} &mdash; The application uses
755advanced multipoint multitouch capabilities on the device screen, for tracking
Scott Maine9123962010-12-06 16:19:32 -0800756five or more points fully independently.</li>
Dirk Dougherty50f8445e2010-11-11 11:52:05 -0800757</ul>
758
759<p>For full information about how to declare features and use them for
760filtering, see the documentation for <a
761href="{@docRoot}guide/topics/manifest/uses-feature-element.html"><code>&lt;uses-feature&gt;</code></a>.</p>
762
763<h3 id="api-diff">API differences report</h3>
764
765<p>For a detailed view of all API changes in Android {@sdkPlatformVersion} (API
766Level {@sdkPlatformApiLevel}), see the <a
767href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
768Differences Report</a>.</p>
769
770
771<h2 id="api-level">API Level</h2>
772
773<p>The Android {@sdkPlatformVersion} platform delivers an updated version of
774the framework API. The Android {@sdkPlatformVersion} API
775is assigned an integer identifier &mdash;
776<strong>{@sdkPlatformApiLevel}</strong> &mdash; that is
777stored in the system itself. This identifier, called the "API Level", allows the
778system to correctly determine whether an application is compatible with
779the system, prior to installing the application. </p>
780
781<p>To use APIs introduced in Android {@sdkPlatformVersion} in your application,
782you need compile the application against the Android library that is provided in
783the Android {@sdkPlatformVersion} SDK platform. Depending on your needs, you might
784also need to add an <code>android:minSdkVersion="{@sdkPlatformApiLevel}"</code>
785attribute to the <code>&lt;uses-sdk&gt;</code> element in the application's
786manifest. If your application is designed to run only on Android 2.3 and higher,
787declaring the attribute prevents the application from being installed on earlier
788versions of the platform.</p>
789
790<p>For more information about how to use API Level, see the <a
791href="{@docRoot}guide/appendix/api-levels.html">API Levels</a> document. </p>
792
793<h2 id="apps">Built-in Applications</h2>
794
795<p>The system image included in the downloadable platform provides these
796built-in applications:</p>
797
798<table style="border:0;padding-bottom:0;margin-bottom:0;">
799<tr>
800<td style="border:0;padding-bottom:0;margin-bottom:0;">
801<ul>
802<li>Browser</li>
803<li>Calculator</li>
804<li>Camera</li>
805<li>Clock</li>
806<li>Contacts</li>
807<li>Cusom Locale</li>
808<li>Dev Tools</li>
809<li>Downloads</li>
810<li>Email</li>
811</ul>
812</td>
813<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
814<ul>
815<li>Gallery</li>
816<li>IMEs for Japanese, Chinese, and Latin text input</li>
817<li>Messaging</li>
818<li>Music</li>
819<li>Phone</li>
820<li>Search</li>
821<li>Settings</li>
822<li>Spare Parts (developer app)</li>
823<li>Speech Recorder</li>
824</ul>
825</td>
826</tr>
827</table>
828
829
830<h2 id="locs" style="margin-top:.75em;">Locales</h2>
831
832<p>The system image included in the downloadable SDK platform provides a variety of
833built-in locales. In some cases, region-specific strings are available for the
834locales. In other cases, a default version of the language is used. The
835languages that are available in the Android {@sdkPlatformVersion} system
836image are listed below (with <em>language</em>_<em>country/region</em> locale
837descriptor).</p>
838
839<table style="border:0;padding-bottom:0;margin-bottom:0;">
840<tr>
841<td style="border:0;padding-bottom:0;margin-bottom:0;">
842<ul>
843<li>Arabic, Egypt (ar_EG)</li>
844<li>Arabic, Israel (ar_IL)</li>
845<li>Bulgarian, Bulgaria (bg_BG)</li>
846<li>Catalan, Spain (ca_ES)</li>
847<li>Czech, Czech Republic (cs_CZ)</li>
848<li>Danish, Denmark(da_DK)</li>
849<li>German, Austria (de_AT)</li>
850<li>German, Switzerland (de_CH)</li>
851<li>German, Germany (de_DE)</li>
852<li>German, Liechtenstein (de_LI)</li>
853<li>Greek, Greece (el_GR)</li>
854<li>English, Australia (en_AU)</li>
855<li>English, Canada (en_CA)</li>
856<li>English, Britain (en_GB)</li>
857<li>English, Ireland (en_IE)</li>
858<li>English, India (en_IN)</li>
859<li>English, New Zealand (en_NZ)</li>
860<li>English, Singapore(en_SG)</li>
861<li>English, US (en_US)</li>
862<li>English, Zimbabwe (en_ZA)</li>
863<li>Spanish (es_ES)</li>
864<li>Spanish, US (es_US)</li>
865<li>Finnish, Finland (fi_FI)</li>
866<li>French, Belgium (fr_BE)</li>
867<li>French, Canada (fr_CA)</li>
868<li>French, Switzerland (fr_CH)</li>
869<li>French, France (fr_FR)</li>
870<li>Hebrew, Israel (he_IL)</li>
871<li>Hindi, India (hi_IN)</li>
872</ul>
873</td>
874<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
875<li>Croatian, Croatia (hr_HR)</li>
876<li>Hungarian, Hungary (hu_HU)</li>
877<li>Indonesian, Indonesia (id_ID)</li>
878<li>Italian, Switzerland (it_CH)</li>
879<li>Italian, Italy (it_IT)</li>
880<li>Japanese (ja_JP)</li>
881<li>Korean (ko_KR)</li>
882<li>Lithuanian, Lithuania (lt_LT)</li>
883<li>Latvian, Latvia (lv_LV)</li>
884<li>Norwegian-Bokmol, Norway(nb_NO)</li>
885<li>Dutch, Belgium (nl_BE)</li>
886<li>Dutch, Netherlands (nl_NL)</li>
887<li>Polish (pl_PL)</li>
888<li>Portuguese, Brazil (pt_BR)</li>
889<li>Portuguese, Portugal (pt_PT)</li>
890<li>Romanian, Romania (ro_RO)</li>
891<li>Russian (ru_RU)</li></li>
892<li>Slovak, Slovakia (sk_SK)</li>
893<li>Slovenian, Slovenia (sl_SI)</li>
894<li>Serbian (sr_RS)</li>
895<li>Swedish, Sweden (sv_SE)</li>
896<li>Thai, Thailand (th_TH)</li>
897<li>Tagalog, Philippines (tl_PH)</li>
898<li>Turkish, Turkey (tr_TR)</li>
899<li>Ukrainian, Ukraine (uk_UA)</li>
900<li>Vietnamese, Vietnam (vi_VN)</li>
901<li>Chinese, PRC (zh_CN)</li>
902<li>Chinese, Taiwan (zh_TW)</li>
903</td>
904</tr>
905</table>
906
907<p class="note"><strong>Note:</strong> The Android platform may support more
908locales than are included in the SDK system image. All of the supported locales
909are available in the <a href="http://source.android.com/">Android Open Source
910Project</a>.</p>
911
912<h2 id="skins">Emulator Skins</h2>
913
914<p>The downloadable platform includes a set of emulator skins that you can use
915for modeling your application in different screen sizes and resolutions. The
916emulator skins are:</p>
917
918<ul>
919 <li>
920 QVGA (240x320, low density, small screen)
921 </li>
922 <li>
923 WQVGA400 (240x400, low density, normal screen)
924 </li>
925 <li>
926 WQVGA432 (240x432, low density, normal screen)
927 </li>
928 <li>
929 HVGA (320x480, medium density, normal screen)
930 </li>
931 <li>
932 WVGA800 (480x800, high density, normal screen)
933 </li>
934 <li>
935 WVGA854 (480x854 high density, normal screen)
936 </li>
937</ul>
938
939<p>For more information about how to develop an application that displays
940and functions properly on all Android-powered devices, see <a
941href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
942Screens</a>.</p>