1 page.title=Android 2.3 Platform 2 sdk.platform.version=2.3 3 sdk.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 24 href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API 25 Differences Report »</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> <strong>{@sdkPlatformApiLevel}</strong></p> 38 39 <p>For developers, the Android {@sdkPlatformVersion} platform is available as a 40 downloadable component for the Android SDK. The downloadable platform includes 41 an Android library and system image, as well as a set of emulator 42 skins and more. The downloadable platform 43 includes no external libraries.</p> 44 45 <p>To get started developing or testing against Android 46 {@sdkPlatformVersion}, use the Android SDK Manager to 47 download the platform into your SDK. For more information, 48 see <a href="{@docRoot}sdk/adding-components.html">Adding SDK 49 Components</a>. If you are new to Android, <a 50 href="{@docRoot}sdk/index.html">download the SDK Starter Package</a> 51 first.</p> 52 53 <p>For a high-level introduction to Android {@sdkPlatformVersion}, see the <a 54 href="{@docRoot}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 60 the Android {@sdkPlatformVersion} platform component for the Android SDK, as denoted by 61 revision number. To determine what revision(s) of the Android 62 {@sdkPlatformVersion} platforms are installed in your SDK environment, refer to 63 the "Installed Packages" listing in the Android SDK and AVD Manager.</p> 64 65 <script type="text/javascript"> 66 function 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 123 in {@sdkPlatformVersion}, including new features and changes in the framework 124 API 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 130 developers build internet telephony applications. Using the API, applications can offer 131 voice calling features without having to manage sessions, transport-level 132 communication, or audio — these are handled 133 transparently 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} 136 package. The key class is {@link android.net.sip.SipManager}, which applications 137 use to set up and manage SIP profiles, then initiate audio calls and receive 138 audio calls. Once an audio call is established, applications can mute calls, 139 turn 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 platforms underlying SIP stack and services are available on devices at 143 the discretion of the manufacturer and associated carrier. For this reason, 144 applications should use the {@link android.net.sip.SipManager#isApiSupported 145 isApiSupported()} method to check whether SIP support is available, before 146 exposing calling functionality to users. </p> 147 148 <p>To use the SIP API, applications must request permission from the user by 149 declaring <code><uses-permission 150 android:name="android.permission.INTERNET"></code> and <code><uses-permission 151 android:name="android.permission.USE_SIP"></code> in their manifest files.</p> 152 153 <p>Additionally, developers can request filtering on Android Market, such that 154 their applications are not discoverable to users whose devices do not include 155 the platforms SIP stack and services. To request filtering, add <code><uses-feature 156 android:name="android.software.sip" 157 android:required="true"></code> and <code><uses-feature 158 android:name="android.software.sip.voip"></code> to the application manifest.</p> 159 160 <p class="note">To look at a sample application that uses the SIP API, see <a 161 href="{@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 166 read NDEF tags that are discovered as a user touches an NFC-enabled device 167 to 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 170 hardware to discover tags when they come into range. On discovering a tag, the 171 platform notifies applications by broadcasting an Intent, appending the tag's 172 NDEF messages to the Intent as extras. Applications can create Intent filters to 173 recognize and handle targeted tags and messages. For example, after receiving a 174 tag by Intent, applications extract the NDEF messages, store them, alert the 175 user, 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, 181 the standard format in which "records" carrying data are transmitted between 182 devices and tags. Applications can receive these messages from {@link 183 android.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 186 carries the data itself.</li> 187 </ul> 188 189 <p>NFC communication relies on wireless technology in the device hardware, so 190 support for the platform's NFC features on specific devices is determined by 191 their manufacturers. To determine the NFC support on the current device, 192 applications can call {@link android.nfc.NfcAdapter#isEnabled isEnabled()} to 193 query the {@link android.nfc.NfcAdapter}. The NFC API is always present, 194 however, regardless of underlying hardware support.</p> 195 196 <p>To use the NFC API, applications must request permission from the user by 197 declaring <code><uses-permission 198 android:name="android.permission.NFC"></code> in their manifest files.</p> 199 200 <p>Additionally, developers can request filtering on Android Market, such that 201 their applications are not discoverable to users whose devices do not support 202 NFC. To request filtering, add 203 <code><uses-feature android:name="android.hardware.nfc" 204 android:required="true"></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 212 types — gyroscope, rotation vector, linear acceleration, gravity, and barometer. 213 Developers can use the new sensor readings to create applications that respond 214 quickly and smoothly to precise changes in device position and motion. The 215 Sensor API reports gyroscope and other sensor changes to interested 216 applications, whether they are running on the application framework or in native 217 code. </p> 218 219 <p>Note that the specific set of hardware sensors available on any given device 220 varies at the discretion of the device manufacturer. </p> 221 222 <p>Developers can request filtering in Android Market, such that their 223 applications are not discoverable to users whose devices do not offer a 224 gyroscope sensor. To do so, add <code><uses-feature 225 android:name="android.hardware.sensor.gyroscope" 226 android:required="true"></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, 234 for either photo or video capture. The {@link android.hardware.Camera} lets 235 applications query for the number of cameras available and the unique 236 characteristics of each. </p> 237 238 <ul> 239 <li>New {@link android.hardware.Camera.CameraInfo} class stores a camera's 240 positional characteristics (orientation, front-facing or back-facing).</li> 241 <li>New {@link android.hardware.Camera#getNumberOfCameras()} and {@link 242 android.hardware.Camera#getCameraInfo(int,CameraInfo) getCameraInfo()} methods in the {@link 243 android.hardware.Camera} class let applications query for the cameras available 244 and open the camera that they need.</li> 245 <li>New {@link android.media.CamcorderProfile#get get()} method lets 246 applications retrieve a {@link android.media.CamcorderProfile} for a specific camera. </li> 247 <li>New {@link android.media.CameraProfile#getJpegEncodingQualityParameter(int, int) 248 getJpegEncodingQualityParameter()} lets applications obtain the still-image 249 capture 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> 253 in 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 258 preview fps maximum/minimum. New {@link 259 android.hardware.Camera.Parameters#getFocusDistances(float[]) 260 getFocusDistances()}, {@link 261 android.hardware.Camera.Parameters#getPreviewFpsRange(int[]) 262 getPreviewFpsRange()}, and {@link 263 android.hardware.Camera.Parameters#getSupportedPreviewFpsRange() 264 getSupportedPreviewFpsRange()} for getting camera parameters, as well as {@link 265 android.hardware.Camera.Parameters#setPreviewFpsRange(int, int) 266 setPreviewFpsRange()} 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, 272 including bass boost, headphone virtualization, equalization, and reverb.</p> 273 <ul> 274 <li>New {@link android.media.audiofx android.media.audiofx} package provides the 275 API to access audio effects.</li> 276 <li>New {@link android.media.audiofx.AudioEffect AudioEffect} is the base class 277 for controlling audio effects provided by the Android audio framework. 278 <li>New audio session ID that lets an application associate a set of audio 279 effects with an instance of {@link android.media.AudioTrack} or {@link 280 android.media.MediaPlayer}.</li> 281 <li>New {@link android.media.AudioTrack#AudioTrack(int, int, int, int, int, int, 282 int) AudioTrack} class constructor that lets you create an {@link 283 android.media.AudioTrack} with a specific session ID. New {@link 284 android.media.AudioTrack#attachAuxEffect(int) attachAuxEffect()}, {@link 285 android.media.AudioTrack#getAudioSessionId() getAudioSessionId()}, and {@link 286 android.media.AudioTrack#setAuxEffectSendLevel(float) setAuxEffectSendLevel()} 287 methods.</li> 288 <li>New {@link android.media.MediaPlayer#attachAuxEffect(int) 289 attachAuxEffect()}, {@link android.media.MediaPlayer#getAudioSessionId() 290 getAudioSessionId()}, {@link android.media.MediaPlayer#setAudioSessionId(int) 291 setAudioSessionId(int)}, and {@link 292 android.media.MediaPlayer#setAuxEffectSendLevel(float) setAuxEffectSendLevel()} 293 methods 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> 298 in 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 304 retrieve the value of the EXIF altitude tag.</li> 305 <li>New {@link android.media.MediaRecorder#setOrientationHint(int) 306 setOrientationHint()} method lets an application tell {@link 307 android.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 313 that handles long-running HTTP downloads. Applications can request that a URI be 314 downloaded to a particular destination file. The <code>DownloadManager</code> 315 will conduct the download in the background, taking care of HTTP interactions 316 and retrying downloads after failures or across connectivity changes and system 317 reboots. </p> 318 <ul> 319 <li>Applications can obtain an instance of the {@link android.app.DownloadManager} 320 class by calling {@link 321 android.content.Context#getSystemService(String)} and passing 322 {@link android.content.Context#DOWNLOAD_SERVICE}. Applications that request 323 downloads through this API should register a broadcast receiver for {@link 324 android.app.DownloadManager#ACTION_NOTIFICATION_CLICKED}, to appropriately 325 handle when the user clicks on a running download in a notification or from the 326 Downloads UI.</li> 327 <li>The {@link android.app.DownloadManager.Request} class lets an 328 application provide all the information necessary to request a new download, 329 such as request URI and download destination. A request URI is the only required 330 parameter. Note that the default download destination is a shared volume where 331 the system can delete your file if it needs to reclaim space for system use. For 332 persistent storage of a download, specify a download destination on external 333 storage (see {@link 334 android.app.DownloadManager.Request#setDestinationUri(Uri)}).</li> 335 <li>The {@link android.app.DownloadManager.Query} class provides methods that let 336 an 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, 342 the platform offers a new system facility called {@link android.os.StrictMode}. 343 When implemented in an application, StrictMode catches and notifies the 344 developer of accidental disk or network activity that could degrade application 345 performance, such as activity taking place on the application's main thread 346 (where UI operations are received and animations are also taking place). 347 Developers can evaluate the network and disk usages issues raised in StrictMode 348 and correct them if needed, keeping the main thread more responsive and 349 preventing 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 353 point with the system and VM. The class provides convenience methods for 354 managing the thread and VM policies that apply to the instance.</li> 355 <li>{@link android.os.StrictMode.ThreadPolicy} and {@link 356 android.os.StrictMode.VmPolicy} hold the policies that you define and apply to 357 thread and VM instances.</li> 358 </ul> 359 360 <p>For more information about how to use StrictMode to optimize your 361 application, see the class documentation and sample code at {@link 362 android.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 370 enable/disable overscroll for a given view, set the overscoll mode, control the 371 overscroll distance, and handle the results of overscrolling. </li> 372 <li>In Widgets, applications can control overscroll characteristics such as 373 animation, springback, and overscroll distance. For more information, see {@link 374 android.view.View android.view.View} and {@link android.widget.OverScroller 375 android.widget.OverScroller}. </li> 376 <li>{@link android.view.ViewConfiguration} also provides methods {@link 377 android.view.ViewConfiguration#getScaledOverflingDistance()} and {@link 378 android.view.ViewConfiguration#getScaledOverscrollDistance()}.</li> 379 <li>New <code>overScrollMode</code>, <code>overScrollFooter</code>, and 380 <code>overScrollHeader</code> attributes for <code><ListView></code> elements, 381 for 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 388 security of Views that provide access to sensitive functionality. For example, 389 touch filtering is appropriate to ensure the security of user actions such as 390 granting a permission request, making a purchase, or clicking on an 391 advertisement. For details, see the <a 392 href="{@docRoot}reference/android/view/View.html#Security">View class 393 documentation</a>.</li> 394 <li>New <code>filterTouchesWhenObscured</code> attribute for view elements, 395 which declares whether to filter touches when the view's window is obscured by 396 another visible window. When set to <code>"true"</code>, the view will not 397 receive touches whenever a toast, dialog or other window appears above the 398 view's window. Refer to <a 399 href="{@docRoot}reference/android/view/View.html#Security">View security 400 documentation</a> for details.</li> 401 </ul> 402 403 <p class="note">To look at sample code for touch filtering, see 404 <a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/SecureView.html">SecureView.java</a> 405 in 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 411 provides methods that let applications determine the meaning of the event, such 412 as by querying for the InputDevice from which the event orginated. The {@link 413 android.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 416 class stores information about the capabilities of a particular input device and 417 provides methods that let applications determine how to interpret events from an 418 input 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" 425 information, which lets applications to keep track of individual fingers as they 426 move up and down. The class adds a variety of methods that let an application 427 work efficiently with motion events.</li> 428 <li>The input system now has logic to generate motion events with the new 429 pointer ID information, synthesizing identifiers as new pointers are down. The 430 system tracks multiple pointer IDs separately during a motion event, and 431 ensures proper continuity of pointers by evaluating at the distance 432 between 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 439 region of text as composing text, maintaining the current styling. A 440 <code>getSelectedText</code> method returns the selected text to the 441 application. The methods are available in {@link 442 android.view.inputmethod.BaseInputConnection}, {@link 443 android.view.inputmethod.InputConnection}, and {@link 444 android.view.inputmethod.InputConnectionWrapper}.</li> 445 <li>New <code>textSelectHandle</code>, <code>textSelectHandleLeft</code>, 446 <code>textSelectHandleRight</code>, and <code>textSelectHandleWindowStyle</code> 447 attributes for <code><TextView></code>, for referencing drawables that will be 448 used to display text-selection anchors and the style for the containing 449 window.</li> 450 </ul> 451 </li> 452 453 <li>Activity controls 454 <ul> 455 <li>{@link android.content.pm.ActivityInfo} adds new constants for managing 456 Activity 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}, 461 and 462 {@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_SENSOR_PORTRAIT}. 463 </li> 464 <li>New constant {@link 465 android.app.ActivityManager.RunningAppProcessInfo#IMPORTANCE_PERCEPTIBLE} for 466 the {@link android.app.ActivityManager.RunningAppProcessInfo#importance} field 467 in {@link android.app.ActivityManager.RunningAppProcessInfo}. The value 468 indicates that a specific process is running something that is considered to be 469 actively perceptible to the user. An example would be an application performing 470 background music playback.</li> 471 <li>The Activity.setPersistent(boolean) method to mark an 472 Activity 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 479 TextAppearance.StatusBar.EventContent}, 480 {@link android.R.style#TextAppearance_StatusBar_EventContent_Title 481 TextAppearance.StatusBar.EventContent.Title}, 482 {@link android.R.style#TextAppearance_StatusBar_Icon 483 TextAppearance.StatusBar.Icon}, and 484 {@link android.R.style#TextAppearance_StatusBar_Title 485 TextAppearance.StatusBar.Title} for managing 486 notification style.</li> 487 </ul> 488 </li> 489 490 <li>WebView 491 <ul> 492 <li>New {@link 493 android.webkit.WebSettings#setUseWebViewBackgroundForOverscrollBackground( 494 boolean) setUseWebViewBackgroundForOverscrollBackground()} method lets a {@link 495 android.webkit.WebView} specify whether to use its own background for the 496 overscroll 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 504 be found on tablet devices. Developers can indicate that their applications are 505 designed to support extra large screen sizes by adding a <code><supports 506 screens ... android:xlargeScreens="true"></code> element to their manifest 507 files. Applications can use a new resource qualifier, <code>xlarge</code>, to 508 tag resources that are specific to extra large screens. For 509 details on how to support extra large and other screen sizes, see <a 510 href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple 511 Screens</a>.</p> 512 513 <h3 id="graphics">Graphics</h3> 514 515 <ul> 516 <li>Adds remaining OpenGL ES 2.0 methods {@link 517 android.opengl.GLES20#glDrawElements(int, int, int, int) glDrawElements()} and 518 {@link android.opengl.GLES20#glVertexAttribPointer(int, int, int, boolean, int, 519 int) glVertexAttribPointer()} in the {@link android.opengl.GLES20 520 android.opengl.GLES20} class.</li> 521 <li>Adds support for {@link android.graphics.ImageFormat#YV12} pixel format, a 522 planar 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 529 or handling an alarm. The provider contains a <code>ACTION_SET_ALARM</code> Intent 530 action and extras that can be used to start an Activity to set a new alarm in an 531 alarm clock application. Applications that wish to receive the 532 <code>SET_ALARM</code> Intent should create an activity that requires the 533 the SET_ALARM permission. Applications that wish to create a new 534 alarm should use {@link 535 android.content.Context#startActivity(android.content.Intent) 536 Context.startActivity()}, so that the user has the option of choosing 537 which alarm clock application to use.</li> 538 539 <li>{@link android.provider.MediaStore} supports a new Intent action, {@link 540 android.provider.MediaStore#INTENT_ACTION_MEDIA_PLAY_FROM_SEARCH 541 PLAY_FROM_SEARCH}, that lets an application search for music media and 542 automatically play content from the result when possible. For example, an 543 application could fire this Intent as the result of a voice recognition command 544 to listen to music.</li> 545 <li>{@link android.provider.MediaStore} also adds a new {@link 546 android.provider.MediaStore#MEDIA_IGNORE_FILENAME} flag that tells the media 547 scanner to ignore media in the containing directory and its subdirectories. 548 Developers can use this to avoid having graphics appear in the Gallery and 549 likewise prevent application sounds and music from showing up in the Music 550 app.</li> 551 552 <li>The {@link android.provider.Settings} provider adds the new Activity actions 553 {@link android.provider.Settings#ACTION_APPLICATION_DETAILS_SETTINGS 554 APPLICATION_DETAILS_SETTINGS} and {@link 555 android.provider.Settings#ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS 556 MANAGE_ALL_APPLICATIONS_SETTINGS}, which let an application show the details 557 screen for a specific application or show the Manage Applications screen. </li> 558 559 <li>The {@link android.provider.ContactsContract} provider adds the {@link 560 android.provider.ContactsContract.CommonDataKinds.SipAddress} data kind, for 561 storing 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 568 requests that result in wake locks or wifi locks according to 569 {@link android.os.WorkSource}, a system-managed class that identifies the 570 application. 571 <p>The <code>LocationManager</code> keeps track 572 of all clients requesting periodic updates, and tells its providers 573 about them as a <code>WorkSource</code> parameter, when setting their minimum 574 update times. 575 The network location provider uses <code>WorkSource</code> to track the 576 wake and wifi locks initiated by an application and adds it to the application's 577 battery usage reported in Manage Applications. </p></li> 578 <li>The {@link android.location.LocationManager} adds several new methods that 579 let an Activity register to receive periodic or one-time location updates based 580 on specified criteria (see below).</li> 581 <li>A new {@link android.location.Criteria} class lets an application specify a 582 set of criteria for selecting a location provider. For example, providers may be 583 ordered according to accuracy, power usage, ability to report altitude, speed, 584 and 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 591 supports OBB (Opaque Binary Blob) files. Although platform support for OBB is 592 available in Android 2.3, development tools for creating and managing OBB files 593 will not be availble until early 2011.</li> 594 <li>The Android 2.3 platform adds official support for devices that do not 595 include SD cards (although it provides virtual SD Card partition, when no 596 physical SD card is available). A convenience method, {@link 597 android.os.Environment#isExternalStorageRemovable()}, lets applications 598 determine 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 605 the <a href="#feature_constants">New Feature Constants</a> section, below.</li> 606 <li>{@link android.content.pm.PackageInfo} adds new {@link 607 android.content.pm.PackageInfo#firstInstallTime} and {@link 608 android.content.pm.PackageInfo#lastUpdateTime} fields that store the time of the 609 package installation and last update. </li> 610 <li>New {@link 611 android.content.pm.PackageManager#getProviderInfo(android.content.ComponentName, 612 int) getProviderInfo()} method for retrieving all of the information known about 613 a 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 620 android.telephony.TelephonyManager#NETWORK_TYPE_EVDO_B} for specifying the CDMA 621 EVDO Rev B network type.</li> 622 <li>New {@link android.telephony.gsm.GsmCellLocation#getPsc()} method returns 623 the 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 629 code. 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 633 lifecycle callbacks are implemented directly in native code. A 634 <code>NativeActivity</code> and its underlying native code run in the system 635 just as do other Activities — specifically they run in the Android 636 application's system process and execute on the application's main UI thread, 637 and they receive the same lifecycle callbacks as do other Activities. </li> 638 <li>New {@link android.view.InputQueue} class and callback interface lets native 639 code manage event queueing. </li> 640 <li>New {@link android.view.SurfaceHolder.Callback2} interface lets native code 641 manage a {@link android.view.SurfaceHolder}. </li> 642 <li>New {@link 643 android.view.Window#takeInputQueue(android.view.InputQueue.Callback) 644 takeInputQueue} and {@link 645 android.view.Window#takeSurface(android.view.SurfaceHolder.Callback2) 646 takeSurface()} methods in {@link android.view.Window} let native code manage 647 events and surfaces.</li> 648 </ul> 649 650 <p>For full information on working with native code or to download the NDK, 651 see 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} 658 removes 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 681 href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code 682 <supports-screens>}</a> 683 element, to indicate whether the application supports 684 extra large screen form-factors. For details, see <a 685 href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple 686 Screens</a>.</li> 687 <li>New values for <code>android:screenOrientation</code> attribute of 688 <code><activity></code> element: 689 <ul> 690 <li><code>"reverseLandscape"</code> — The Activity would like to have the 691 screen in landscape orientation, turned in the opposite direction from normal 692 landscape.</li> 693 <li><code>"reversePortrait"</code> — The Activity would like to have the 694 screen in portrait orientation, turned in the opposite direction from normal 695 portrait.</li> 696 <li><code>"sensorLandscape"</code> — The Activity would like to have the 697 screen in landscape orientation, but can use the sensor to change which 698 direction the screen is facing.</li> 699 <li><code>"sensorPortrait"</code> — The Activity would like to have the 700 screen in portrait orientation, but can use the sensor to change which direction 701 the screen is facing.</li> 702 <li><code>"fullSensor"</code> — Orientation is determined by a physical 703 orientation sensor: the display will rotate based on how the user moves the 704 device. This allows any of the 4 possible rotations, regardless of what the 705 device will normally do (for example some devices won't normally use 180 degree 706 rotation).</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> — Allows an application 715 to broadcast an Intent to set an alarm for the user. An Activity that handles 716 the {@link android.provider.AlarmClock#ACTION_SET_ALARM SET_ALARM} Intent action 717 should require this permission.</li> 718 <li><code>android.permission.USE_SIP</code> — Allows an application to use 719 the {@link android.net.sip SIP API} to make or receive internet calls. 720 <li><code>android.permission.NFC</code> — Allows an application to use the 721 {@link android.nfc NFC API} to read NFC tags.</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 727 in their application manifests as being required by their applications. This 728 lets developers control how their application is filtered, when published on 729 Android Market. </p> 730 731 <ul> 732 <li>{@link android.content.pm.PackageManager#FEATURE_AUDIO_LOW_LATENCY 733 android.hardware.audio.low_latency} — The application uses a low-latency 734 audio pipeline on the device and is sensitive to delays or lag in sound input or 735 output.</li> 736 <li>{@link android.content.pm.PackageManager#FEATURE_CAMERA_FRONT 737 android.hardware.camera.front} — The application uses a front-facing 738 camera on the device.</li> 739 <li>{@link android.content.pm.PackageManager#FEATURE_NFC android.hardware.nfc} 740 — The application uses NFC radio features in the device.</li> 741 <li>{@link android.content.pm.PackageManager#FEATURE_SENSOR_BAROMETER 742 android.hardware.sensor.barometer} — The application uses the device's 743 barometer.</li> 744 <li>{@link android.content.pm.PackageManager#FEATURE_SENSOR_GYROSCOPE 745 android.hardware.sensor.gyroscope} — The application uses the device's 746 gyroscope sensor.</li> 747 <li>{@link android.content.pm.PackageManager#FEATURE_SIP android.software.sip} 748 — The application uses the SIP API on the device.</li> 749 <li>{@link android.content.pm.PackageManager#FEATURE_SIP_VOIP 750 android.software.sip.voip} — The application uses a SIP-based VoIP 751 service on the device.</li> 752 <li>{@link 753 android.content.pm.PackageManager#FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND 754 android.hardware.touchscreen.multitouch.jazzhand} — The application uses 755 advanced multipoint multitouch capabilities on the device screen, for tracking 756 five or more points fully independently.</li> 757 </ul> 758 759 <p>For full information about how to declare features and use them for 760 filtering, see the documentation for <a 761 href="{@docRoot}guide/topics/manifest/uses-feature-element.html"><code><uses-feature></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 766 Level {@sdkPlatformApiLevel}), see the <a 767 href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API 768 Differences 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 774 the framework API. The Android {@sdkPlatformVersion} API 775 is assigned an integer identifier — 776 <strong>{@sdkPlatformApiLevel}</strong> — that is 777 stored in the system itself. This identifier, called the "API Level", allows the 778 system to correctly determine whether an application is compatible with 779 the system, prior to installing the application. </p> 780 781 <p>To use APIs introduced in Android {@sdkPlatformVersion} in your application, 782 you need compile the application against the Android library that is provided in 783 the Android {@sdkPlatformVersion} SDK platform. Depending on your needs, you might 784 also need to add an <code>android:minSdkVersion="{@sdkPlatformApiLevel}"</code> 785 attribute to the <code><uses-sdk></code> element in the application's 786 manifest. If your application is designed to run only on Android 2.3 and higher, 787 declaring the attribute prevents the application from being installed on earlier 788 versions of the platform.</p> 789 790 <p>For more information about how to use API Level, see the <a 791 href="{@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 796 built-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 833 built-in locales. In some cases, region-specific strings are available for the 834 locales. In other cases, a default version of the language is used. The 835 languages that are available in the Android {@sdkPlatformVersion} system 836 image are listed below (with <em>language</em>_<em>country/region</em> locale 837 descriptor).</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 908 locales than are included in the SDK system image. All of the supported locales 909 are available in the <a href="http://source.android.com/">Android Open Source 910 Project</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 915 for modeling your application in different screen sizes and resolutions. The 916 emulator 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 940 and functions properly on all Android-powered devices, see <a 941 href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple 942 Screens</a>.</p> 943