blob: 5438adc135f5d548089eac983c348b438b5216a0 [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
54href="http://developer.android.com/sdk/android-{@sdkPlatformVersion}-highlights.html">Platform Highlights</a>.</p>
55
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
127<h3 id="sip">SIP-based VOIP</h3>
128
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
228<p>For API details, see {@link android.hardware.Sensor}</p>
229
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>
241<li>New {@link android.hardware.Camera#getNumberOfCameras()}, {@link
242android.hardware.Camera#getCameraInfo(int,CameraInfo) getCameraInfo()}, and
243{@link android.hardware.Camera#getNumberOfCameras()} methods in the {@link
244android.hardware.Camera} class let applications query for the cameras available
245and open the camera that they need.</li>
246<li>New {@link android.media.CamcorderProfile get(int,int) method lets
247applications retrieve a CamcorderProfile for a specific camera. </li>
248<li>New {@link android media.CameraProfile#getJpegEncodingQualityParameter(int, int)
249getJpegEncodingQualityParameter()} lets applications obtain the still-image
250capture quality level for a specific camera.</li>
251</ul>
252
253<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>
254in the ApiDemos sample application.</p>
255
256<p>The Camera API also adds: </p>
257<ul>
258<li>New parameters for cameras, including focus distance, focus mode, and
259preview fps maximum/minimum. New {@link
260android.hardware.Camera.Parameters#getFocusDistances(float[])
261getFocusDistances()}, {@link
262android.hardware.Camera.Parameters#getPreviewFpsRange(int[])
263getPreviewFpsRange()}, and {@link
264android.hardware.Camera.Parameters#getSupportedPreviewFpsRange()
265getSupportedPreviewFpsRange()} for getting camera parameters, as well as {@link
266android.hardware.Camera.Parameters#setPreviewFpsRange(int, int)
267setPreviewFpsRange()} for setting preview framerate. </li>
268</ul>
269
270<h3 id="media">Mixable audio effects</h3>
271
272<p>The platform's media framework adds support for new per-track or global audio effects,
273including bass boost, headphone virtualization, equalization, and reverb.</p>
274<ul>
275<li>New {@link android.media.audiofx android.media.audiofx} package provides the
276API to access audio effects.</li>
277<li>New {@link android.media.audiofx.AudioEffect AudioEffect} is the base class
278for controlling audio effects provided by the Android audio framework.
279<li>New audio session ID that lets an application associate a set of audio
280effects with an instance of {@link android.media.AudioTrack} or {@link
281android.media.MediaPlayer}.</li>
282<li>New {@link android.media.AudioTrack#AudioTrack(int, int, int, int, int, int,
283int) AudioTrack} class constructor that lets you create an {@link
284android.media.AudioTrack} with a specific session ID. New {@link
285android.media.AudioTrack#attachAuxEffect(int) attachAuxEffect()}, {@link
286android.media.AudioTrack#getAudioSessionId() getAudioSessionId()}, and {@link
287android.media.AudioTrack#setAuxEffectSendLevel(float) setAuxEffectSendLevel()}
288methods.</li>
289<li>New {@link android.media.MediaPlayer#attachAuxEffect(int)
290attachAuxEffect()}, {@link android.media.MediaPlayer#getAudioSessionId()
291getAudioSessionId()}, {@link android.media.MediaPlayer#setAudioSessionId(int)
292setAudioSessionId(int)}, and {@link
293android.media.MediaPlayer#setAuxEffectSendLevel(float) setAuxEffectSendLevel()}
294methods and supporting types.</li>
295</ul>
296
297<p class="note">To look at sample code for audio effects, see
298<a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/media/AudioFxDemo.html">AudioFxDemo.java</a>
299in the ApiDemos sample application.</p>
300
301<p>The media framework also adds:</p>
302<ul>
303<li>New support for altitude tag in EXIF metadata for JPEG files. New method
304{@link android.media.ExifInterface#getAltitude(double) getAltitude()} method to
305retrieve the value of the EXIF altitude tag.</li>
306<li>New {@link android.media.MediaRecorder#setOrientationHint(int)
307setOrientationHint()} method lets an application tell {@link
308android.media.MediaRecorder} of the orientation during video capture.</li>
309</ul>
310
311<h3 id="download">Download manager</h3>
312
313<p>The platform includes a new {@link android.app.DownloadManager} system service
314that handles long-running HTTP downloads. Applications can request that a URI be
315downloaded to a particular destination file. The <code>DownloadManager</code>
316will conduct the download in the background, taking care of HTTP interactions
317and retrying downloads after failures or across connectivity changes and system
318reboots. </p>
319<ul>
320<li>Applications can obtain an instance of the {@link android.app.DownloadManager}
321class by calling {@link
322android.content.Context#getSystemService(String)} and passing
323{@link android.content.Context#DOWNLOAD_SERVICE}. Applications that request
324downloads through this API should register a broadcast receiver for {@link
325android.app.DownloadManager#ACTION_NOTIFICATION_CLICKED}, to appropriately
326handle when the user clicks on a running download in a notification or from the
327Downloads UI.</li>
328<li>The {@link android.app.DownloadManager.Request} class lets an
329application provide all the information necessary to request a new download,
330such as request URI and download destination. A request URI is the only required
331parameter. Note that the default download destination is a shared volume where
332the system can delete your file if it needs to reclaim space for system use. For
333persistent storage of a download, specify a download destination on external
334storage (see {@link
335android.app.DownloadManager.Request#setDestinationUri(Uri)}).</li>
336<li>The {@link android.app.DownloadManager.Query} class provides methods that let
337an application query for and filter active downloads.</li>
338</ul>
339
340<h3 id="strictmode">StrictMode</h3>
341
342<p>To help developers monitor and improve the performance of their applications,
343the platform offers a new system facility called {@link android.os.StrictMode}.
344When implemented in an application, StrictMode catches and notifies the
345developer of accidental disk or network activity that could degrade application
346performance, such as activity taking place on the application's main thread
347(where UI operations are received and animations are also taking place).
348Developers can evaluate the network and disk usages issues raised in StrictMode
349and correct them if needed, keeping the main thread more responsive and
350preventing ANR dialogs from being shown to users.
351
352<ul>
353<li>{@link android.os.StrictMode} is the core class and is the main integration
354point with the system and VM. The class provides convenience methods for
355managing the thread and VM policies that apply to the instance.</li>
356<li>{@link android.os.StrictMode.ThreadPolicy} and {@link
357android.os.StrictMode.VmPolicy} hold the policies that you define and apply to
358thread and VM instances.</li>
359</ul>
360
361<p>For more information about how to use StrictMode to optimize your
362application, see the class documentation and sample code at {@link
363android.os.StrictMode android.os.StrictMode}.</p>
364
365<h3 id="ui">UI Framework</h3>
366
367<ul>
368<li>Support for overscroll
369<ul>
370<li>New support for overscroll in Views and Widgets. In Views, applications can
371enable/disable overscroll for a given view, set the overscoll mode, control the
372overscroll distance, and handle the results of overscrolling. </li>
373<li>In Widgets, applications can control overscroll characteristics such as
374animation, springback, and overscroll distance. For more information, see {@link
375android.view.View android.view.View} and {@link android.widget.OverScroller
376android.widget.OverScroller}. </li>
377<li>{@link android.view.ViewConfiguration} also provides methods {@link
378android.view.ViewConfiguration#getScaledOverflingDistance()} and {@link
379android.view.ViewConfiguration#getScaledOverscrollDistance()}.</li>
380<li>New <code>overScrollMode</code>, <code>overScrollFooter</code>, and
381<code>overScrollHeader</code> attributes for <code>&lt;ListView&gt;</code> elements,
382for controlling overscroll behavior.</li>
383</ul>
384</li>
385
386<li>Support for touch filtering
387<ul>
388<li>New support for touch filtering, which lets an application improve the
389security of Views that provide access to sensitive functionality. For example,
390touch filtering is appropriate to ensure the security of user actions such as
391granting a permission request, making a purchase, or clicking on an
392advertisement. For details, see the <a
393href="{@docRoot}reference/android/view/View.html#security">View class
394documentation</a>.</li>
395<li>New <code>filterTouchesWhenObscured</code> attribute for view elements,
396which declares whether to filter touches when the view's window is obscured by
397another visible window. When set to <code>"true"</code>, the view will not
398receive touches whenever a toast, dialog or other window appears above the
399view's window. Refer to <a
400href="{@docRoot}reference/android/view/View.html#security">View security
401documentation</a> for details.</li>
402</ul>
403
404<p class="note">To look at sample code for touch filtering, see
405<a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/SecureView.html">SurfaceView.java</a>
406in the ApiDemos sample application.</p>
407</li>
408
409<li>Improved event management
410<ul>
411<li>New base class for input events, {@link android.view.InputEvent}. The class
412provides methods that let applications determine the meaning of the event, such
413as by querying for the InputDevice from which the event orginated. The {@link
414android.view.KeyEvent} and {@link android.view.MotionEvent} are subclasses of
415{@link android.view.InputEvent}.</li>
416<li>New base class for input devices, {@link android.view.InputDevice}. The
417class stores information about the capabilities of a particular input device and
418provides methods that let applications determine how to interpret events from an
419input device.</li>
420</ul>
421</li>
422
423<li>Improved motion events
424<ul>
425<li>The {@link android.view.MotionEvent} API is extended to include "pointer ID"
426information, which lets applications to keep track of individual fingers as they
427move up and down. The class adds a variety of methods that let an application
428work efficiently with motion events.</li>
429<li>The input system now has logic to generate motion events with the new
430pointer ID information, synthesizing identifiers as new pointers are down. The
431system tracks multiple pointer IDs separately during a motion event, and
432ensures proper continuity of pointers by evaluating at the distance
433between the last and next set of pointers.</li>
434</ul>
435</li>
436
437<li>Text selection controls
438<ul>
439<li>A new <code>setComposingRegion</code> method lets an application mark a
440region of text as composing text, maintaining the current styling. A
441<code>getSelectedText</code> method returns the selected text to the
442application. The methods are available in {@link
443android.view.inputmethod.BaseInputConnection}, {@link
444android.view.inputmethod.InputConnection}, and {@link
445android.view.inputmethod.InputConnectionWrapper}.</li>
446<li>New <code>textSelectHandle</code>, <code>textSelectHandleLeft</code>,
447<code>textSelectHandleRight</code>, and <code>textSelectHandleWindowStyle</code>
448attributes for <code>&lt;TextView&gt;</code>, for referencing drawables that will be
449used to display text-selection anchors and the style for the containing
450window.</li>
451</ul>
452</li>
453
454<li>Activity controls
455<ul>
456<li>{@link android.content.pm.ActivityInfo} adds new constants for managing
457Activity orientation:
458{@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_FULL_SENSOR},
459{@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_REVERSE_LANDSCAPE},
460{@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_REVERSE_PORTRAIT},
461{@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_SENSOR_LANDSCAPE},
462and
463{@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_SENSOR_PORTRAIT}.
464</li>
465<li>New constant {@link
466android.app.ActivityManager.RunningAppProcessInfo#IMPORTANCE_PERCEPTIBLE} for
467the {@link android.app.ActivityManager.RunningAppProcessInfo#importance} field
468in {@link android.app.ActivityManager.RunningAppProcessInfo}. The value
469indicates that a specific process is running something that is considered to be
470actively perceptible to the user. An example would be an application performing
471background music playback.</li>
472<li>The {@link android.app.Activity#setPersistent(boolean)} method to mark an
473Activity as persistent is now deprecated and the implementation is a no-op.</li>
474</ul>
475</li>
476
477<li>Notification text and icon styles
478<ul>
479<li>New {@link android.R.style#TextAppearance_StatusBar_EventContent
480TextAppearance.StatusBar.EventContent},
481{@link android.R.style#TextAppearance_StatusBar_EventContent_Title
482TextAppearance.StatusBar.EventContent.Title},
483{@link android.R.style#TextAppearance_StatusBar_Icon
484TextAppearance.StatusBar.Icon}, and
485{@link android.R.style#TextAppearance_StatusBar_Title
486TextAppearance.StatusBar.Title} for managing
487notification style.</li>
488</ul>
489</li>
490
491<li>WebView
492<ul>
493<li>New {@link
494android.webkit.WebSettings#setUseWebViewBackgroundForOverscrollBackground(
495boolean) setUseWebViewBackgroundForOverscrollBackground()} method lets a {@link
496android.webkit.WebView} specify whether to use its own background for the
497overscroll background. </li>
498</ul>
499</li>
500</ul>
501
502<h3 id="extralargescreens">Extra Large Screens</h3>
503
504<p>The platform now supports extra large screen sizes, such as those that might
505be found on tablet devices. Developers can indicate that their applications are
506designed to support extra large screen sizes by adding a <code>&lt;supports
507screens ... android:xlargeScreens="true"&gt;</code> element to their manifest
508files. Applications can use a new resource qualifier, <code>xlarge</code>, to
509tag resources that are specific to extra large screens. For
510details on how to support extra large and other screen sizes, see <a
511href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
512Screens</a>.</p>
513
514<h3 id="graphics">Graphics</h3>
515
516<ul>
517<li>Adds remaining OpenGL ES 2.0 methods {@link
518android.opengl.GLES20#glDrawElements(int, int, int, int) glDrawElements()} and
519{@link android.opengl.GLES20#glVertexAttribPointer(int, int, int, boolean, int,
520int) glVertexAttribPointer()} in the {@link android.opengl.GLES20
521android.opengl.GLES20} class.</li>
522<li>Adds support for {@link android.graphics.ImageFormat#YV12} pixel format, a
523planar 4:2:0 YCrCb format.</li>
524</ul>
525
526<h3 id="providers">Content Providers</h3>
527
528<ul>
529<li>New {@link android.provider.AlarmClock} provider class for setting an alarm
530or handling an alarm. The provider contains a <code>ACTION_SET_ALARM</code> Intent
531action and extras that can be used to start an Activity to set a new alarm in an
532alarm clock application. Applications that wish to receive the
533<code>SET_ALARM</code> Intent should create an activity that requires the
534the SET_ALARM permission. Applications that wish to create a new
535alarm should use {@link
536android.content.Context#startActivity(android.content.Intent)
537Context.startActivity()}, so that the user has the option of choosing
538which alarm clock application to use.</li>
539
540<li>{@link android.provider.MediaStore} supports a new Intent action, {@link
541android.provider.MediaStore#INTENT_ACTION_MEDIA_PLAY_FROM_SEARCH
542PLAY_FROM_SEARCH}, that lets an application search for music media and
543automatically play content from the result when possible. For example, an
544application could fire this Intent as the result of a voice recognition command
545to listen to music.</li>
546<li>{@link android.provider.MediaStore} also adds a new {@link
547android.provider.MediaStore#MEDIA_IGNORE_FILENAME} flag that tells the media
548scanner to ignore media in the containing directory and its subdirectories.
549Developers can use this to avoid having graphics appear in the Gallery and
550likewise prevent application sounds and music from showing up in the Music
551app.</li>
552
553<li>The {@link android.provider.Settings} provider adds the new Activity actions
554{@link android.provider.Settings#ACTION_APPLICATION_DETAILS_SETTINGS
555APPLICATION_DETAILS_SETTINGS} and {@link
556android.provider.Settings#ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS
557MANAGE_ALL_APPLICATIONS_SETTINGS}, which let an application show the details
558screen for a specific application or show the Manage Applications screen. </li>
559
560<li>The {@link android.provider.ContactsContract} provider adds the {@link
561android.provider.ContactsContract.CommonDataKinds.SipAddress} data kind, for
562storing a contact's SIP (Internet telephony) address. </li>
563</ul>
564
565<h3 id="location">Location</h3>
566
567<ul>
568<li>The {@link android.location.LocationManager} now tracks application
569requests that result in wake locks or wifi locks according to
570{@link android.os.WorkSource}, a system-managed class that identifies the
571application.
572<p>The <code>LocationManager</code> keeps track
573of all clients requesting periodic updates, and tells its providers
574about them as a <code>WorkSource</code> parameter, when setting their minimum
575update times.
576The network location provider uses <code>WorkSource</code> to track the
577wake and wifi locks initiated by an application and adds it to the application's
578battery usage reported in Manage Applications. </p></li>
579<li>The {@link android.location.LocationManager} adds several new methods that
580let an Activity register to receive periodic or one-time location updates based
581on specified criteria (see below).</li>
582<li>A new {@link android.location.Criteria} class lets an application specify a
583set of criteria for selecting a location provider. For example, providers may be
584ordered according to accuracy, power usage, ability to report altitude, speed,
585and bearing, and monetary cost. </li>
586</ul>
587
588<h3 id="storage">Storage</h3>
589
590<ul>
591<li>Android 2.3 adds a new {@link android.os.storage.StorageManager} that
592supports OBB (Opaque Binary Blob) files. Although platform support for OBB is
593available in Android 2.3, development tools for creating and managing OBB files
594will not be availble until early 2011.</li>
595<li>The Android 2.3 platform adds official support for devices that do not
596include SD cards (although it provides virtual SD Card partition, when no
597physical SD card is available). A convenience method, {@link
598android.os.Environment#isExternalStorageRemovable()}, lets applications
599determine whether a physical SD card is present.</li>
600</ul>
601
602<h3 id="packagemanager">Package Manager</h3>
603
604<ul>
605<li>New constants for declaring hardware and software features. See the list in
606the <a href="#feature_constants">New Feature Constants</a> section, below.</li>
607<li>{@link android.content.pm.PackageInfo} adds new {@link
608android.content.pm.PackageInfo#firstInstallTime} and {@link
609android.content.pm.PackageInfo#lastUpdateTime} fields that store the time of the
610package installation and last update. </li>
611<li>New {@link
612android.content.pm.PackageManager#getProviderInfo(android.content.ComponentName,
613int) getProviderInfo()} method for retrieving all of the information known about
614a particular content provider class.</li>
615</ul>
616
617<h3 id="telephony">Telephony</h3>
618
619<ul>
620<li>The {@link android.telephony.TelephonyManager} adds the constant {@link
621android.telephony.TelephonyManager#NETWORK_TYPE_EVDO_B} for specifying the CDMA
622EVDO Rev B network type.</li>
623<li>New {@link android.telephony.gsm.GsmCellLocation#getPsc()} method returns
624the primary scrambling code of the serving cell on a UMTS network.</li>
625</ul>
626
627<h3 id="native">Native access to Activity lifecycle, windows</h3>
628
629<p>Android 2.3 exposes a broad set of APIs to applications that use native
630code. Framework classes of interest to such applications include: </p>
631
632<ul>
633<li>{@link android.app.NativeActivity} is a new type of Activity class, whose
634lifecycle callbacks are implemented directly in native code. A
635<code>NativeActivity</code> and its underlying native code run in the system
636just as do other Activities &mdash; specifically they run in the Android
637application's system process and execute on the application's main UI thread,
638and they receive the same lifecycle callbacks as do other Activities. </li>
639<li>New {@link android.view.InputQueue} class and callback interface lets native
640code manage event queueing. </li>
641<li>New {@link android.view.SurfaceHolder.Callback2} interface lets native code
642manage a {@link android.view.SurfaceHolder}. </li>
643<li>New {@link
644android.view.Window#takeInputQueue(android.view.InputQueue.Callback)
645takeInputQueue} and {@link
646android.view.Window#takeSurface(android.view.SurfaceHolder.Callback2)
647takeSurface()} methods in {@link android.view.Window} let native code manage
648events and surfaces.</li>
649</ul>
650
651<p>For full information on working with native code or to download the NDK,
652see the <a href="{@docRoot}sdk/ndk/index.html">Android NDK</a> page.</p>
653
654
655<h3 id="dalvik">Dalvik Runtime</h3>
656
657<ul>
658<li>{@link dalvik.system dalvik.system}
659removes several classes that were previously deprecated.</li>
660<li>Dalvik core libraries:
661<ul>
662 <li>New collections: {@link java.util.ArrayDeque}, {@link java.util.NavigableMap},
663 {@link java.util.concurrent.ConcurrentSkipListMap},
664 {@link java.util.concurrent.LinkedBlockingDeque}</li>
665 <li>New {@link java.util.Arrays} utilities: <code>binarySearch()</code>,
666 <code>copyOf()</code>, <code>copyOfRange()</code>, and others.</li>
667 <li>{@link java.net.CookieManager} for {@link java.net.HttpURLConnection}.</li>
668 <li>More complete network APIs: {@link java.net.InterfaceAddress},
669 {@link java.net.NetworkInterface} and {@link java.net.IDN}</li>
670 <li>{@link java.io.File} read and write controls</li>
671 <li>{@link java.lang.String#isEmpty() String.isEmpty()}</li>
672 <li>{@link java.text.Normalizer} and {@link java.text.Normalizer.Form}</li>
673 <li>Improved {@link javax.net.ssl} server sockets.</li>
674</ul>
675</li>
676</ul>
677
678<h3 id="manifest">New manifest elements and attributes</h3>
679
680<ul>
681<li>New <code>xlargeScreens</code> attribute for <a
682href="{@docRoot}guide/topics/manifest/supports-screens.html"><code>&lt;supports-screens&gt;</code></a>
683element, 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>
693<li><code>"reversePortait"</code> &mdash; The Activity would like to have the
694screen 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
721{@link android.nfc NFC API} to make or receive internet calls.</li>
722</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
750android.software.sip.voip} &mdash; The application uses a SIP-based VOIP
751service 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
756up to five points fully independently.</li>
757</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>