Home | History | Annotate | Download | only in versions
      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="#api">API Overview</a></li>
     14   <li><a href="#api-level">API Level</a></li>
     15 </ol>
     16 
     17 <h2>Reference</h2>
     18 <ol>
     19 <li><a
     20 href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
     21 Differences Report &raquo;</a> </li>
     22 </ol>
     23 
     24 </div>
     25 </div>
     26 
     27 <p>
     28 <em>API Level:</em>&nbsp;<strong>{@sdkPlatformApiLevel}</strong></p>
     29 
     30 <p>For developers, the Android {@sdkPlatformVersion} platform is available as a
     31 downloadable component for the Android SDK. The downloadable platform includes
     32 an Android library and system image, as well as a set of emulator skins and
     33 more. To get started developing or testing against Android {@sdkPlatformVersion},
     34 use the Android SDK Manager to download the platform into your SDK.</p>
     35 
     36 
     37 
     38 
     39 <h2 id="api">API Overview</h2>
     40 
     41 <p>The sections below provide a technical overview of what's new for developers
     42 in {@sdkPlatformVersion}, including new features and changes in the framework
     43 API since the previous version.</p>
     44 
     45 
     46 <h3 id="sip">SIP-based VoIP</h3>
     47 
     48 <p>The platform now includes a SIP protocol stack and framework API that lets
     49 developers build internet telephony applications. Using the API, applications can offer
     50 voice calling features without having to manage sessions, transport-level
     51 communication, or audio &mdash; these are handled
     52 transparently by the platform's SIP API and services.</p>
     53 
     54 <p>The SIP API is available in the {@link android.net.sip android.net.sip}
     55 package. The key class is {@link android.net.sip.SipManager}, which applications
     56 use to set up and manage SIP profiles, then initiate audio calls and receive
     57 audio calls. Once an audio call is established, applications can mute calls,
     58 turn on speaker mode, send DTMF tones, and more. Applications can also use the
     59 {@link android.net.sip.SipManager} to create generic SIP connections.</p>
     60 
     61 <p>The platforms underlying SIP stack and services are available on devices at
     62 the discretion of the manufacturer and associated carrier. For this reason,
     63 applications should use the  {@link android.net.sip.SipManager#isApiSupported
     64 isApiSupported()} method to check whether SIP support is available, before
     65 exposing calling functionality to users. </p>
     66 
     67 <p>To use the SIP API, applications must request permission from the user by
     68 declaring <code>&lt;uses-permission
     69 android:name="android.permission.INTERNET"&gt;</code> and <code>&lt;uses-permission
     70 android:name="android.permission.USE_SIP"&gt;</code> in their manifest files.</p>
     71 
     72 <p>Additionally, developers can request filtering on Google Play, such that
     73 their applications are not discoverable to users whose devices do not include
     74 the platforms SIP stack and services. To request filtering, add <code>&lt;uses-feature
     75 android:name="android.software.sip"
     76 android:required="true"&gt;</code> and <code>&lt;uses-feature
     77 android:name="android.software.sip.voip"&gt;</code> to the application manifest.</p>
     78 
     79 <p class="note">To look at a sample application that uses the SIP API, see <a
     80 href="{@docRoot}resources/samples/SipDemo/index.html">SIP Demo</a>.</p>
     81 
     82 <h3 id="nfc">Near Field Communications (NFC)</h3>
     83 
     84 <p>Android 2.3 includes an NFC stack and framework API that lets developers
     85 read NDEF tags that are discovered as a user touches an NFC-enabled device
     86 to tag elements embedded in stickers, smart posters, and even other devices.</p>
     87 
     88 <p>The platform provides the underlying NFC services that work with the device
     89 hardware to discover tags when they come into range. On discovering a tag, the
     90 platform notifies applications by broadcasting an Intent, appending the tag's
     91 NDEF messages to the Intent as extras. Applications can create Intent filters to
     92 recognize and handle targeted tags and messages. For example, after receiving a
     93 tag by Intent, applications extract the NDEF messages, store them, alert the
     94 user, or handle them in other ways. </p>
     95 
     96 <p>The NFC API is available in the {@link android.nfc} package. The key classes are: </p>
     97 
     98 <ul><li>{@link android.nfc.NfcAdapter}, which represents the NFC hardware on the device.</li>
     99 <li>{@link android.nfc.NdefMessage}, which represents an NDEF data message,
    100 the standard format in which "records" carrying data are transmitted between
    101 devices and tags. Applications can receive these messages from {@link
    102 android.nfc.NfcAdapter#ACTION_TAG_DISCOVERED}</code> Intents.</li>
    103 <li>{@link android.nfc.NdefRecord}, delivered in an
    104 {@link android.nfc.NdefMessage}, which describes the type of data being shared and
    105 carries the data itself.</li>
    106 </ul>
    107 
    108 <p>NFC communication relies on wireless technology in the device hardware, so
    109 support for the platform's NFC features on specific devices is determined by
    110 their manufacturers. To determine the NFC support on the current device,
    111 applications can call {@link android.nfc.NfcAdapter#isEnabled isEnabled()} to
    112 query the {@link android.nfc.NfcAdapter}. The NFC API is always present,
    113 however, regardless of underlying hardware support.</p>
    114 
    115 <p>To use the NFC API, applications must request permission from the user by
    116 declaring <code>&lt;uses-permission
    117 android:name="android.permission.NFC"&gt;</code> in their manifest files.</p>
    118 
    119 <p>Additionally, developers can request filtering on Google Play, such that
    120 their applications are not discoverable to users whose devices do not support
    121 NFC. To request filtering, add
    122 <code>&lt;uses-feature android:name="android.hardware.nfc"
    123 android:required="true"&gt;</code> to the application's manifest.</p>
    124 
    125 <p class="note">To look at a sample application that uses the NFC API, see
    126 <a href="{@docRoot}resources/samples/NFCDemo/index.html">NFCDemo</a>.</p>
    127 
    128 <h3 id="sensors">Gyroscope and other sensors</h3>
    129 
    130 <p>Android 2.3 adds platform and API support for several new sensor reading
    131 types &mdash; gyroscope, rotation vector, linear acceleration, gravity, and barometer.
    132 Developers can use the new sensor readings to create applications that respond
    133 quickly and smoothly to precise changes in device position and motion. The
    134 Sensor API reports gyroscope and other sensor changes to interested
    135 applications, whether they are running on the application framework or in native
    136 code. </p>
    137 
    138 <p>Note that the specific set of hardware sensors available on any given device
    139 varies at the discretion of the device manufacturer. </p>
    140 
    141 <p>Developers can request filtering on Google Play, such that their
    142 applications are not discoverable to users whose devices do not offer a
    143 gyroscope sensor. To do so, add <code>&lt;uses-feature
    144 android:name="android.hardware.sensor.gyroscope"
    145 android:required="true"&gt;</code> to the application manifest.</p>
    146 
    147 <p>For API details, see {@link android.hardware.Sensor}.</p>
    148 
    149 
    150 <h3 id="cameras">Multiple cameras support</h3>
    151 
    152 <p>Applications can now make use of any cameras that are available on a device,
    153 for either photo or video capture. The {@link android.hardware.Camera} lets
    154 applications query for the number of cameras available and the unique
    155 characteristics of each. </p>
    156 
    157 <ul>
    158 <li>New {@link android.hardware.Camera.CameraInfo} class stores a camera's
    159 positional characteristics (orientation, front-facing or back-facing).</li>
    160 <li>New {@link android.hardware.Camera#getNumberOfCameras()} and {@link
    161 android.hardware.Camera#getCameraInfo(int,CameraInfo) getCameraInfo()} methods in the {@link
    162 android.hardware.Camera} class let applications query for the cameras available
    163 and open the camera that they need.</li>
    164 <li>New {@link android.media.CamcorderProfile#get get()} method lets
    165 applications retrieve a {@link android.media.CamcorderProfile} for a specific camera. </li>
    166 <li>New {@link android.media.CameraProfile#getJpegEncodingQualityParameter(int, int)
    167 getJpegEncodingQualityParameter()} lets applications obtain the still-image
    168 capture quality level for a specific camera.</li>
    169 </ul>
    170 
    171 <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>
    172 in the ApiDemos sample application.</p>
    173 
    174 <p>The Camera API also adds: </p>
    175 <ul>
    176 <li>New parameters for cameras, including focus distance, focus mode, and
    177 preview fps maximum/minimum. New {@link
    178 android.hardware.Camera.Parameters#getFocusDistances(float[])
    179 getFocusDistances()}, {@link
    180 android.hardware.Camera.Parameters#getPreviewFpsRange(int[])
    181 getPreviewFpsRange()}, and {@link
    182 android.hardware.Camera.Parameters#getSupportedPreviewFpsRange()
    183 getSupportedPreviewFpsRange()} for getting camera parameters, as well as {@link
    184 android.hardware.Camera.Parameters#setPreviewFpsRange(int, int)
    185 setPreviewFpsRange()} for setting preview framerate. </li>
    186 </ul>
    187 
    188 <h3 id="media">Mixable audio effects</h3>
    189 
    190 <p>The platform's media framework adds support for new per-track or global audio effects,
    191 including bass boost, headphone virtualization, equalization, and reverb.</p>
    192 <ul>
    193 <li>New {@link android.media.audiofx android.media.audiofx} package provides the
    194 API to access audio effects.</li>
    195 <li>New {@link android.media.audiofx.AudioEffect AudioEffect} is the  base class
    196 for controlling audio effects provided by the Android audio framework.
    197 <li>New audio session ID that lets an application associate a set of audio
    198 effects with an instance of {@link android.media.AudioTrack} or {@link
    199 android.media.MediaPlayer}.</li>
    200 <li>New {@link android.media.AudioTrack#AudioTrack(int, int, int, int, int, int,
    201 int) AudioTrack} class constructor that lets you create an {@link
    202 android.media.AudioTrack} with a specific session ID. New {@link
    203 android.media.AudioTrack#attachAuxEffect(int) attachAuxEffect()}, {@link
    204 android.media.AudioTrack#getAudioSessionId() getAudioSessionId()}, and {@link
    205 android.media.AudioTrack#setAuxEffectSendLevel(float) setAuxEffectSendLevel()}
    206 methods.</li>
    207 <li>New {@link android.media.MediaPlayer#attachAuxEffect(int)
    208 attachAuxEffect()}, {@link android.media.MediaPlayer#getAudioSessionId()
    209 getAudioSessionId()}, {@link android.media.MediaPlayer#setAudioSessionId(int)
    210 setAudioSessionId(int)}, and {@link
    211 android.media.MediaPlayer#setAuxEffectSendLevel(float) setAuxEffectSendLevel()}
    212 methods and supporting types.</li>
    213 </ul>
    214 
    215 <p class="note">To look at sample code for audio effects, see
    216 <a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/media/AudioFxDemo.html">AudioFxDemo.java</a>
    217 in the ApiDemos sample application.</p>
    218 
    219 <p>The media framework also adds:</p>
    220 <ul>
    221 <li>New support for altitude tag in EXIF metadata for JPEG files. New method
    222 {@link android.media.ExifInterface#getAltitude(double) getAltitude()} method to
    223 retrieve the value of the EXIF altitude tag.</li>
    224 <li>New {@link android.media.MediaRecorder#setOrientationHint(int)
    225 setOrientationHint()} method lets an application tell {@link
    226 android.media.MediaRecorder} of the orientation during video capture.</li>
    227 </ul>
    228 
    229 <h3 id="download">Download manager</h3>
    230 
    231 <p>The platform includes a new {@link android.app.DownloadManager} system service
    232 that handles long-running HTTP downloads. Applications can request that a URI be
    233 downloaded to a particular destination file. The <code>DownloadManager</code>
    234 will conduct the download in the background, taking care of HTTP interactions
    235 and retrying downloads after failures or across connectivity changes and system
    236 reboots. </p>
    237 <ul>
    238 <li>Applications can obtain an instance of the {@link android.app.DownloadManager}
    239 class by calling {@link
    240 android.content.Context#getSystemService(String)} and passing
    241 {@link android.content.Context#DOWNLOAD_SERVICE}. Applications that request 
    242 downloads through this API should register a broadcast receiver for {@link
    243 android.app.DownloadManager#ACTION_NOTIFICATION_CLICKED}, to appropriately
    244 handle when the user clicks on a running download in a notification or from the
    245 Downloads UI.</li>
    246 <li>The {@link android.app.DownloadManager.Request} class lets an
    247 application provide all the information necessary to request a new download,
    248 such as request URI and download destination. A request URI is the only required
    249 parameter. Note that the default download destination is a shared volume where
    250 the system can delete your file if it needs to reclaim space for system use. For
    251 persistent storage of a download, specify a download destination on external
    252 storage (see {@link
    253 android.app.DownloadManager.Request#setDestinationUri(Uri)}).</li>
    254 <li>The {@link android.app.DownloadManager.Query} class provides methods that let
    255 an application query for and filter active downloads.</li>
    256 </ul>
    257 
    258 <h3 id="strictmode">StrictMode</h3>
    259 
    260 <p>To help developers monitor and improve the performance of their applications,
    261 the platform offers a new system facility called {@link android.os.StrictMode}.
    262 When implemented in an application, StrictMode catches and notifies the
    263 developer of accidental disk or network activity that could degrade application
    264 performance, such as activity taking place on the application's main thread
    265 (where UI operations are received and animations are also taking place).
    266 Developers can evaluate the network and disk usages issues raised in StrictMode
    267 and correct them if needed, keeping the main thread more responsive and
    268 preventing ANR dialogs from being shown to users.
    269 
    270 <ul>
    271 <li>{@link android.os.StrictMode} is the core class and is the main integration
    272 point with the system and VM. The class provides convenience methods for
    273 managing the thread and VM policies that apply to the instance.</li>
    274 <li>{@link android.os.StrictMode.ThreadPolicy} and {@link
    275 android.os.StrictMode.VmPolicy} hold the policies that you define and apply to
    276 thread and VM instances.</li>
    277 </ul>
    278 
    279 <p>For more information about how to use StrictMode to optimize your
    280 application, see the class documentation and sample code at {@link
    281 android.os.StrictMode android.os.StrictMode}.</p>
    282 
    283 <h3 id="ui">UI Framework</h3>
    284 
    285 <ul>
    286 <li>Support for overscroll
    287 <ul>
    288 <li>New support for overscroll in Views and Widgets. In Views, applications can
    289 enable/disable overscroll for a given view, set the overscoll mode, control the
    290 overscroll distance, and handle the results of overscrolling. </li>
    291 <li>In Widgets, applications can control overscroll characteristics such as
    292 animation, springback, and overscroll distance. For more information, see {@link
    293 android.view.View android.view.View} and {@link android.widget.OverScroller
    294 android.widget.OverScroller}. </li>
    295 <li>{@link android.view.ViewConfiguration} also provides methods {@link
    296 android.view.ViewConfiguration#getScaledOverflingDistance()} and {@link
    297 android.view.ViewConfiguration#getScaledOverscrollDistance()}.</li>
    298 <li>New <code>overScrollMode</code>, <code>overScrollFooter</code>, and
    299 <code>overScrollHeader</code> attributes for <code>&lt;ListView&gt;</code> elements,
    300 for controlling overscroll behavior.</li>
    301 </ul>
    302 </li>
    303 
    304 <li>Support for touch filtering
    305 <ul>
    306 <li>New support for touch filtering, which lets an application improve the
    307 security of Views that provide access to sensitive functionality. For example,
    308 touch filtering is appropriate to ensure the security of user actions such as
    309 granting a permission request, making a purchase, or clicking on an
    310 advertisement. For details, see the <a
    311 href="{@docRoot}reference/android/view/View.html#Security">View class
    312 documentation</a>.</li>
    313 <li>New <code>filterTouchesWhenObscured</code> attribute for view elements,
    314 which declares whether to filter touches when the view's window is obscured by
    315 another visible window. When set to <code>"true"</code>, the view will not
    316 receive touches whenever a toast, dialog or other window appears above the
    317 view's window. Refer to <a
    318 href="{@docRoot}reference/android/view/View.html#Security">View security
    319 documentation</a> for details.</li>
    320 </ul>
    321 
    322 <p class="note">To look at sample code for touch filtering, see
    323 <a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/SecureView.html">SecureView.java</a>
    324 in the ApiDemos sample application.</p>
    325 </li>
    326 
    327 <li>Improved event management
    328 <ul>
    329 <li>New base class for input events, {@link android.view.InputEvent}. The class
    330 provides methods that let applications determine the meaning of the event, such
    331 as by querying for the InputDevice from which the event orginated. The {@link
    332 android.view.KeyEvent} and {@link android.view.MotionEvent} are subclasses of
    333 {@link android.view.InputEvent}.</li>
    334 <li>New base class for input devices, {@link android.view.InputDevice}. The
    335 class stores information about the capabilities of a particular input device and
    336 provides methods that let applications determine how to interpret events from an
    337 input device.</li>
    338 </ul>
    339 </li>
    340 
    341 <li>Improved motion events
    342 <ul>
    343 <li>The {@link android.view.MotionEvent} API is extended to include "pointer ID"
    344 information, which lets applications to keep track of individual fingers as they
    345 move up and down. The class adds a variety of methods that let an application
    346 work efficiently with motion events.</li>
    347 <li>The input system now has logic to generate motion events with the new
    348 pointer ID information, synthesizing identifiers as new pointers are down. The
    349 system tracks multiple pointer IDs separately during a motion event, and
    350 ensures proper continuity of pointers by evaluating at the distance
    351 between the last and next set of pointers.</li>
    352 </ul>
    353 </li>
    354 
    355 <li>Text selection controls
    356 <ul>
    357 <li>A new <code>setComposingRegion</code> method lets an application mark a
    358 region of text as composing text, maintaining the current styling. A
    359 <code>getSelectedText</code> method returns the selected text to the
    360 application. The methods are available in {@link
    361 android.view.inputmethod.BaseInputConnection}, {@link
    362 android.view.inputmethod.InputConnection}, and {@link
    363 android.view.inputmethod.InputConnectionWrapper}.</li>
    364 <li>New <code>textSelectHandle</code>, <code>textSelectHandleLeft</code>,
    365 <code>textSelectHandleRight</code>, and <code>textSelectHandleWindowStyle</code>
    366 attributes for <code>&lt;TextView&gt;</code>, for referencing drawables that will be
    367 used to display text-selection anchors and the style for the containing
    368 window.</li>
    369 </ul>
    370 </li>
    371 
    372 <li>Activity controls
    373 <ul>
    374 <li>{@link android.content.pm.ActivityInfo} adds new constants for managing
    375 Activity orientation:
    376 {@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_FULL_SENSOR},
    377 {@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_REVERSE_LANDSCAPE},
    378 {@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_REVERSE_PORTRAIT},
    379 {@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_SENSOR_LANDSCAPE},
    380 and
    381 {@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_SENSOR_PORTRAIT}.
    382 </li>
    383 <li>New constant {@link
    384 android.app.ActivityManager.RunningAppProcessInfo#IMPORTANCE_PERCEPTIBLE} for
    385 the {@link android.app.ActivityManager.RunningAppProcessInfo#importance} field
    386 in {@link android.app.ActivityManager.RunningAppProcessInfo}. The value
    387 indicates that a specific process is running something that is considered to be
    388 actively perceptible to the user. An example would be an application performing
    389 background music playback.</li>
    390 <li>The Activity.setPersistent(boolean) method to mark an
    391 Activity as persistent is now deprecated and the implementation is a no-op.</li>
    392 </ul>
    393 </li>
    394 
    395 <li>Notification text and icon styles
    396 <ul>
    397 <li>New {@link android.R.style#TextAppearance_StatusBar_EventContent
    398 TextAppearance.StatusBar.EventContent},
    399 {@link android.R.style#TextAppearance_StatusBar_EventContent_Title
    400 TextAppearance.StatusBar.EventContent.Title},
    401 {@link android.R.style#TextAppearance_StatusBar_Icon
    402 TextAppearance.StatusBar.Icon}, and
    403 {@link android.R.style#TextAppearance_StatusBar_Title
    404 TextAppearance.StatusBar.Title} for managing
    405 notification style.</li>
    406 </ul>
    407 </li>
    408 
    409 <li>WebView
    410 <ul>
    411 <li>New {@link
    412 android.webkit.WebSettings#setUseWebViewBackgroundForOverscrollBackground(
    413 boolean) setUseWebViewBackgroundForOverscrollBackground()} method lets a {@link
    414 android.webkit.WebView} specify whether to use its own background for the
    415 overscroll background. </li>
    416 </ul>
    417 </li>
    418 </ul>
    419 
    420 <h3 id="extralargescreens">Extra Large Screens</h3>
    421 
    422 <p>The platform now supports extra large screen sizes, such as those that might
    423 be found on tablet devices. Developers can indicate that their applications are
    424 designed to support extra large screen sizes by adding a <code>&lt;supports
    425 screens ... android:xlargeScreens="true"&gt;</code> element to their manifest
    426 files. Applications can use a new resource qualifier, <code>xlarge</code>, to
    427 tag resources that are specific to extra large screens. For
    428 details on how to support extra large and other screen sizes, see <a
    429 href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
    430 Screens</a>.</p>
    431 
    432 <h3 id="graphics">Graphics</h3>
    433 
    434 <ul>
    435 <li>Adds remaining OpenGL ES 2.0 methods {@link
    436 android.opengl.GLES20#glDrawElements(int, int, int, int) glDrawElements()} and
    437 {@link android.opengl.GLES20#glVertexAttribPointer(int, int, int, boolean, int,
    438 int) glVertexAttribPointer()} in the {@link android.opengl.GLES20
    439 android.opengl.GLES20} class.</li>
    440 <li>Adds support for {@link android.graphics.ImageFormat#YV12} pixel format, a
    441 planar 4:2:0 YCrCb format.</li>
    442 </ul>
    443 
    444 <h3 id="providers">Content Providers</h3>
    445 
    446 <ul>
    447 <li>New {@link android.provider.AlarmClock} provider class for setting an alarm
    448 or handling an alarm. The provider contains a <code>ACTION_SET_ALARM</code> Intent
    449 action and extras that can be used to start an Activity to set a new alarm in an
    450 alarm clock application. Applications that wish to receive the
    451 <code>SET_ALARM</code> Intent should create an activity that requires the
    452 the SET_ALARM permission. Applications that wish to create a new
    453 alarm should use {@link
    454 android.content.Context#startActivity(android.content.Intent)
    455 Context.startActivity()}, so that the user has the option of choosing
    456 which alarm clock application to use.</li>
    457 
    458 <li>{@link android.provider.MediaStore} supports a new Intent action, {@link
    459 android.provider.MediaStore#INTENT_ACTION_MEDIA_PLAY_FROM_SEARCH
    460 PLAY_FROM_SEARCH}, that lets an application search for music media and
    461 automatically play content from the result when possible. For example, an
    462 application could fire this Intent as the result of a voice recognition command
    463 to listen to music.</li>
    464 <li>{@link android.provider.MediaStore} also adds a new {@link
    465 android.provider.MediaStore#MEDIA_IGNORE_FILENAME} flag that tells the media
    466 scanner to ignore media in the containing directory and its subdirectories.
    467 Developers can use this to avoid having graphics appear in the Gallery and
    468 likewise prevent application sounds and music from showing up in the Music
    469 app.</li>
    470 
    471 <li>The {@link android.provider.Settings} provider adds the new Activity actions
    472 {@link android.provider.Settings#ACTION_APPLICATION_DETAILS_SETTINGS
    473 APPLICATION_DETAILS_SETTINGS} and {@link
    474 android.provider.Settings#ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS
    475 MANAGE_ALL_APPLICATIONS_SETTINGS}, which let an application show the details
    476 screen for a specific application or show the Manage Applications screen. </li>
    477 
    478 <li>The {@link android.provider.ContactsContract} provider adds the {@link
    479 android.provider.ContactsContract.CommonDataKinds.SipAddress} data kind, for
    480 storing a contact's SIP (Internet telephony) address. </li>
    481 </ul>
    482 
    483 <h3 id="location">Location</h3>
    484 
    485 <ul>
    486 <li>The {@link android.location.LocationManager} now tracks application
    487 requests that result in wake locks or wifi locks according to
    488 {@link android.os.WorkSource}, a system-managed class that identifies the
    489 application.
    490 <p>The <code>LocationManager</code> keeps track
    491 of all clients requesting periodic updates, and tells its providers
    492 about them as a <code>WorkSource</code> parameter, when setting their minimum
    493 update times.
    494 The network location provider uses <code>WorkSource</code> to track the
    495 wake and wifi locks initiated by an application and adds it to the application's
    496 battery usage reported in Manage Applications. </p></li>
    497 <li>The {@link android.location.LocationManager} adds several new methods that
    498 let an Activity register to receive periodic or one-time location updates based
    499 on specified criteria (see below).</li>
    500 <li>A new  {@link android.location.Criteria} class lets an application specify a
    501 set of criteria for selecting a location provider. For example, providers may be
    502 ordered according to accuracy, power usage, ability to report altitude, speed,
    503 and bearing, and monetary cost. </li>
    504 </ul>
    505 
    506 <h3 id="storage">Storage</h3>
    507 
    508 <ul>
    509 <li>Android 2.3 adds a new {@link android.os.storage.StorageManager} that
    510 supports OBB (Opaque Binary Blob) files. Although platform support for OBB is
    511 available in Android 2.3, development tools for creating and managing OBB files
    512 will not be availble until early 2011.</li>
    513 <li>The Android 2.3 platform adds official support for devices that do not
    514 include SD cards (although it provides virtual SD Card partition, when no
    515 physical SD card is available). A convenience method, {@link
    516 android.os.Environment#isExternalStorageRemovable()}, lets applications
    517 determine whether a physical SD card is present.</li>
    518 </ul>
    519 
    520 <h3 id="packagemanager">Package Manager</h3>
    521 
    522 <ul>
    523 <li>New constants for declaring hardware and software features. See the list in
    524 the <a href="#feature_constants">New Feature Constants</a> section, below.</li>
    525 <li>{@link android.content.pm.PackageInfo} adds new {@link
    526 android.content.pm.PackageInfo#firstInstallTime} and {@link
    527 android.content.pm.PackageInfo#lastUpdateTime} fields that store the time of the
    528 package installation and last update. </li>
    529 <li>New {@link
    530 android.content.pm.PackageManager#getProviderInfo(android.content.ComponentName,
    531 int) getProviderInfo()} method for retrieving all of the information known about
    532 a particular content provider class.</li>
    533 </ul>
    534 
    535 <h3 id="telephony">Telephony</h3>
    536 
    537 <ul>
    538 <li>The {@link android.telephony.TelephonyManager} adds the constant {@link
    539 android.telephony.TelephonyManager#NETWORK_TYPE_EVDO_B} for specifying the CDMA
    540 EVDO Rev B network type.</li>
    541 <li>New {@link android.telephony.gsm.GsmCellLocation#getPsc()} method returns
    542 the primary scrambling code of the serving cell on a UMTS network.</li>
    543 </ul>
    544 
    545 <h3 id="native">Native access to Activity lifecycle, windows</h3>
    546 
    547 <p>Android 2.3 exposes a broad set of APIs to applications that use native
    548 code. Framework classes of interest to such applications include: </p>
    549 
    550 <ul>
    551 <li>{@link android.app.NativeActivity} is a new type of Activity class, whose
    552 lifecycle callbacks are implemented directly in native code. A
    553 <code>NativeActivity</code> and its underlying native code run in the system
    554 just as do other Activities &mdash; specifically they run in the Android
    555 application's system process and execute on the application's main UI thread,
    556 and they receive the same lifecycle callbacks as do other Activities. </li>
    557 <li>New {@link android.view.InputQueue} class and callback interface lets native
    558 code manage event queueing. </li>
    559 <li>New {@link android.view.SurfaceHolder.Callback2} interface lets native code
    560 manage a {@link android.view.SurfaceHolder}. </li>
    561 <li>New {@link
    562 android.view.Window#takeInputQueue(android.view.InputQueue.Callback)
    563 takeInputQueue} and {@link
    564 android.view.Window#takeSurface(android.view.SurfaceHolder.Callback2)
    565 takeSurface()} methods in {@link android.view.Window} let native code manage
    566 events and surfaces.</li>
    567 </ul>
    568 
    569 <p>For full information on working with native code or to download the NDK,
    570 see the <a href="{@docRoot}tools/sdk/ndk/index.html">Android NDK</a> page.</p>
    571 
    572 
    573 <h3 id="dalvik">Dalvik Runtime</h3>
    574 
    575 <ul>
    576 <li>{@link dalvik.system dalvik.system}
    577 removes several classes that were previously deprecated.</li>
    578 <li>Dalvik core libraries:
    579 <ul>
    580   <li>New collections: {@link java.util.ArrayDeque}, {@link java.util.NavigableMap},
    581   {@link java.util.concurrent.ConcurrentSkipListMap},
    582   {@link java.util.concurrent.LinkedBlockingDeque}</li>
    583   <li>New {@link java.util.Arrays} utilities: <code>binarySearch()</code>,
    584   <code>copyOf()</code>, <code>copyOfRange()</code>, and others.</li>
    585   <li>{@link java.net.CookieManager} for {@link java.net.HttpURLConnection}.</li>
    586   <li>More complete network APIs: {@link java.net.InterfaceAddress},
    587   {@link java.net.NetworkInterface} and {@link java.net.IDN}</li>
    588   <li>{@link java.io.File} read and write controls</li>
    589   <li>{@link java.lang.String#isEmpty() String.isEmpty()}</li>
    590   <li>{@link java.text.Normalizer} and {@link java.text.Normalizer.Form}</li>
    591   <li>Improved {@link javax.net.ssl} server sockets.</li>
    592 </ul>
    593 </li>
    594 </ul>
    595 
    596 <h3 id="manifest">New manifest elements and attributes</h3>
    597 
    598 <ul>
    599 <li>New <code>xlargeScreens</code> attribute for <a
    600 href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
    601 &lt;supports-screens&gt;}</a>
    602 element, to indicate whether the application supports
    603 extra large screen form-factors. For details, see <a
    604 href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
    605 Screens</a>.</li>
    606 <li>New values for <code>android:screenOrientation</code> attribute of
    607 <code>&lt;activity&gt;</code> element:
    608 <ul>
    609 <li><code>"reverseLandscape"</code> &mdash; The Activity would like to have the
    610 screen in landscape orientation, turned in the opposite direction from normal
    611 landscape.</li>
    612 <li><code>"reversePortrait"</code> &mdash; The Activity would like to have the
    613 screen in portrait orientation, turned in the opposite direction from normal
    614 portrait.</li>
    615 <li><code>"sensorLandscape"</code> &mdash; The Activity would like to have the
    616 screen in landscape orientation, but can use the sensor to change which
    617 direction the screen is facing.</li>
    618 <li><code>"sensorPortrait"</code> &mdash; The Activity would like to have the
    619 screen in portrait orientation, but can use the sensor to change which direction
    620 the screen is facing.</li>
    621 <li><code>"fullSensor"</code> &mdash; Orientation is determined by a physical
    622 orientation sensor: the display will rotate based on how the user moves the
    623 device. This allows any of the 4 possible rotations, regardless of what the
    624 device will normally do (for example some devices won't normally use 180 degree
    625 rotation).</li>
    626 </ul>
    627 </li>
    628 </ul>
    629 
    630 <h3 id="permissions">New Permissions</h3>
    631 
    632 <ul>
    633 <li><code>com.android.permission.SET_ALARM</code> &mdash; Allows an application
    634 to broadcast an Intent to set an alarm for the user. An Activity that handles
    635 the {@link android.provider.AlarmClock#ACTION_SET_ALARM SET_ALARM} Intent action
    636 should require this permission.</li>
    637 <li><code>android.permission.USE_SIP</code> &mdash; Allows an application to use
    638 the {@link android.net.sip SIP API} to make or receive internet calls.
    639 <li><code>android.permission.NFC</code> &mdash; Allows an application to use the
    640 {@link android.nfc NFC API} to read NFC tags.</li>
    641 </ul>
    642 
    643 <h3 id="feature_constants">New Feature Constants</h3>
    644 
    645 <p>The platform adds several new hardware features that developers can declare
    646 in their application manifests as being required by their applications. This
    647 lets developers control how their application is filtered, when published on
    648 Google Play. </p>
    649 
    650 <ul>
    651 <li>{@link android.content.pm.PackageManager#FEATURE_AUDIO_LOW_LATENCY
    652 android.hardware.audio.low_latency} &mdash; The application uses a low-latency
    653 audio pipeline on the device and is sensitive to delays or lag in sound input or
    654 output.</li>
    655 <li>{@link android.content.pm.PackageManager#FEATURE_CAMERA_FRONT
    656 android.hardware.camera.front} &mdash; The application uses a front-facing
    657 camera on the device.</li>
    658 <li>{@link android.content.pm.PackageManager#FEATURE_NFC android.hardware.nfc}
    659 &mdash; The application uses NFC radio features in the device.</li>
    660 <li>{@link android.content.pm.PackageManager#FEATURE_SENSOR_BAROMETER
    661 android.hardware.sensor.barometer} &mdash; The application uses the device's
    662 barometer.</li>
    663 <li>{@link android.content.pm.PackageManager#FEATURE_SENSOR_GYROSCOPE
    664 android.hardware.sensor.gyroscope} &mdash; The application uses the device's
    665 gyroscope sensor.</li>
    666 <li>{@link android.content.pm.PackageManager#FEATURE_SIP android.software.sip}
    667 &mdash; The application uses the SIP API on the device.</li>
    668 <li>{@link android.content.pm.PackageManager#FEATURE_SIP_VOIP
    669 android.software.sip.voip} &mdash; The application uses a SIP-based VoIP
    670 service on the device.</li>
    671 <li>{@link
    672 android.content.pm.PackageManager#FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND
    673 android.hardware.touchscreen.multitouch.jazzhand} &mdash; The application uses
    674 advanced multipoint multitouch capabilities on the device screen, for tracking
    675 five or more points fully independently.</li>
    676 </ul>
    677 
    678 <p>For full information about how to declare features and use them for
    679 filtering, see the documentation for <a
    680 href="{@docRoot}guide/topics/manifest/uses-feature-element.html"><code>&lt;uses-feature&gt;</code></a>.</p>
    681 
    682 <h3 id="api-diff">API differences report</h3>
    683 
    684 <p>For a detailed view of all API changes in Android {@sdkPlatformVersion} (API
    685 Level {@sdkPlatformApiLevel}), see the <a
    686 href="{@docRoot}sdk/api_diff/{@sdkPlatformApiLevel}/changes.html">API
    687 Differences Report</a>.</p>
    688 
    689 
    690 <h2 id="api-level">API Level</h2>
    691 
    692 <p>The Android {@sdkPlatformVersion} platform delivers an updated version of
    693 the framework API. The Android {@sdkPlatformVersion} API
    694 is assigned an integer identifier &mdash;
    695 <strong>{@sdkPlatformApiLevel}</strong> &mdash; that is
    696 stored in the system itself. This identifier, called the "API Level", allows the
    697 system to correctly determine whether an application is compatible with
    698 the system, prior to installing the application. </p>
    699 
    700 <p>To use APIs introduced in Android {@sdkPlatformVersion} in your application,
    701 you need compile the application against the Android library that is provided in
    702 the Android {@sdkPlatformVersion} SDK platform. Depending on your needs, you might 
    703 also need to add an <code>android:minSdkVersion="{@sdkPlatformApiLevel}"</code>
    704 attribute to the <code>&lt;uses-sdk&gt;</code> element in the application's
    705 manifest. If your application is designed to run only on Android 2.3 and higher,
    706 declaring the attribute prevents the application from being installed on earlier
    707 versions of the platform.</p>
    708 
    709 <p>For more information, read <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">What is API
    710 Level?</a></p>