*API Level:* **9**

For developers, the Android 2.3
([GINGERBREAD](https://developer.android.com/reference/android/os/Build.VERSION_CODES#GINGERBREAD))platform is available as a
downloadable component for the Android SDK. The downloadable platform includes
an Android library and system image, as well as a set of emulator skins and
more. To get started developing or testing against Android 2.3,
use the Android SDK Manager to download the platform into your SDK.

## API Overview

The sections below provide a technical overview of what's new for developers
in 2.3, including new features and changes in the framework
API since the previous version.

### SIP-based VoIP

The platform now includes a SIP protocol stack and framework API that lets
developers build internet telephony applications. Using the API, applications can offer
voice calling features without having to manage sessions, transport-level
communication, or audio --- these are handled
transparently by the platform's SIP API and services.

The SIP API is available in the [android.net.sip](https://developer.android.com/reference/android/net/sip/package-summary)
package. The key class is [SipManager](https://developer.android.com/reference/android/net/sip/SipManager), which applications
use to set up and manage SIP profiles, then initiate audio calls and receive
audio calls. Once an audio call is established, applications can mute calls,
turn on speaker mode, send DTMF tones, and more. Applications can also use the
[SipManager](https://developer.android.com/reference/android/net/sip/SipManager) to create generic SIP connections.

The platform's underlying SIP stack and services are available on devices at
the discretion of the manufacturer and associated carrier. For this reason,
applications should use the [isApiSupported()](https://developer.android.com/reference/android/net/sip/SipManager#isApiSupported(android.content.Context)) method to check whether SIP support is available, before
exposing calling functionality to users.

To use the SIP API, applications must request permission from the user by
declaring `<uses-permission
android:name="android.permission.INTERNET">` and `<uses-permission
android:name="android.permission.USE_SIP">` in their manifest files.

Additionally, developers can request filtering on Google Play, such that
their applications are not discoverable to users whose devices do not include
the platform's SIP stack and services. To request filtering, add `<uses-feature
android:name="android.software.sip"
android:required="true">` and `<uses-feature
android:name="android.software.sip.voip">` to the application manifest.

For more information, read the [SIP](https://developer.android.com/guide/topics/connectivity/sip) developer guide.

### Near Field Communications (NFC)

Android 2.3 includes an NFC stack and framework API that lets developers
read NDEF tags that are discovered as a user touches an NFC-enabled device
to tag elements embedded in stickers, smart posters, and even other devices.

The platform provides the underlying NFC services that work with the device
hardware to discover tags when they come into range. On discovering a tag, the
platform notifies applications by broadcasting an Intent, appending the tag's
NDEF messages to the Intent as extras. Applications can create Intent filters to
recognize and handle targeted tags and messages. For example, after receiving a
tag by Intent, applications extract the NDEF messages, store them, alert the
user, or handle them in other ways.

The NFC API is available in the [android.nfc](https://developer.android.com/reference/android/nfc/package-summary) package. The key classes are:

- [NfcAdapter](https://developer.android.com/reference/android/nfc/NfcAdapter), which represents the NFC hardware on the device.
- [NdefMessage](https://developer.android.com/reference/android/nfc/NdefMessage), which represents an NDEF data message, the standard format in which "records" carrying data are transmitted between devices and tags. Applications can receive these messages from [ACTION_TAG_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TAG_DISCOVERED) Intents.
- [NdefRecord](https://developer.android.com/reference/android/nfc/NdefRecord), delivered in an [NdefMessage](https://developer.android.com/reference/android/nfc/NdefMessage), which describes the type of data being shared and carries the data itself.

NFC communication relies on wireless technology in the device hardware, so
support for the platform's NFC features on specific devices is determined by
their manufacturers. To determine the NFC support on the current device,
applications can call [isEnabled()](https://developer.android.com/reference/android/nfc/NfcAdapter#isEnabled()) to
query the [NfcAdapter](https://developer.android.com/reference/android/nfc/NfcAdapter). The NFC API is always present,
however, regardless of underlying hardware support.

To use the NFC API, applications must request permission from the user by
declaring `<uses-permission
android:name="android.permission.NFC">` in their manifest files.

Additionally, developers can request filtering on Google Play, such that
their applications are not discoverable to users whose devices do not support
NFC. To request filtering, add
`<uses-feature android:name="android.hardware.nfc"
android:required="true">` to the application's manifest.

To look at a sample application that uses the NFC API, see
[NFCDemo](https://developer.android.com/resources/samples/NFCDemo).

### Gyroscope and other sensors

Android 2.3 adds platform and API support for several new sensor reading
types --- gyroscope, rotation vector, linear acceleration, gravity, and barometer.
Developers can use the new sensor readings to create applications that respond
quickly and smoothly to precise changes in device position and motion. The
Sensor API reports gyroscope and other sensor changes to interested
applications, whether they are running on the application framework or in native
code.

Note that the specific set of hardware sensors available on any given device
varies at the discretion of the device manufacturer.

Developers can request filtering on Google Play, such that their
applications are not discoverable to users whose devices do not offer a
gyroscope sensor. To do so, add `<uses-feature
android:name="android.hardware.sensor.gyroscope"
android:required="true">` to the application manifest.

For API details, see [Sensor](https://developer.android.com/reference/android/hardware/Sensor).

### Multiple cameras support

Applications can now make use of any cameras that are available on a device,
for either photo or video capture. The [Camera](https://developer.android.com/reference/android/hardware/Camera) lets
applications query for the number of cameras available and the unique
characteristics of each.

- New [Camera.CameraInfo](https://developer.android.com/reference/android/hardware/Camera.CameraInfo) class stores a camera's positional characteristics (orientation, front-facing or back-facing).
- New [getNumberOfCameras()](https://developer.android.com/reference/android/hardware/Camera#getNumberOfCameras()) and [getCameraInfo()](https://developer.android.com/reference/android/hardware/Camera#getCameraInfo(int, android.hardware.Camera.CameraInfo)) methods in the [Camera](https://developer.android.com/reference/android/hardware/Camera) class let applications query for the cameras available and open the camera that they need.
- New [get()](https://developer.android.com/reference/android/media/CamcorderProfile#get(int)) method lets applications retrieve a [CamcorderProfile](https://developer.android.com/reference/android/media/CamcorderProfile) for a specific camera.
- New [getJpegEncodingQualityParameter()](https://developer.android.com/reference/android/media/CameraProfile#getJpegEncodingQualityParameter(int, int)) lets applications obtain the still-image capture quality level for a specific camera.

To look at sample code for accessing a front-facing camera, see [CameraPreview.java](https://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview)
in the ApiDemos sample application.

The Camera API also adds:

- New parameters for cameras, including focus distance, focus mode, and preview fps maximum/minimum. New [getFocusDistances()](https://developer.android.com/reference/android/hardware/Camera.Parameters#getFocusDistances(float[])), [getPreviewFpsRange()](https://developer.android.com/reference/android/hardware/Camera.Parameters#getPreviewFpsRange(int[])), and [getSupportedPreviewFpsRange()](https://developer.android.com/reference/android/hardware/Camera.Parameters#getSupportedPreviewFpsRange()) for getting camera parameters, as well as [setPreviewFpsRange()](https://developer.android.com/reference/android/hardware/Camera.Parameters#setPreviewFpsRange(int, int)) for setting preview framerate.

### Mixable audio effects

The platform's media framework adds support for new per-track or global audio effects,
including bass boost, headphone virtualization, equalization, and reverb.

- New [android.media.audiofx](https://developer.android.com/reference/android/media/audiofx/package-summary) package provides the API to access audio effects.
- New [AudioEffect](https://developer.android.com/reference/android/media/audiofx/AudioEffect) is the base class for controlling audio effects provided by the Android audio framework.
- New audio session ID that lets an application associate a set of audio effects with an instance of [AudioTrack](https://developer.android.com/reference/android/media/AudioTrack) or [MediaPlayer](https://developer.android.com/reference/android/media/MediaPlayer).
- New [AudioTrack](https://developer.android.com/reference/android/media/AudioTrack#AudioTrack(int, int, int, int, int, int, int)) class constructor that lets you create an [AudioTrack](https://developer.android.com/reference/android/media/AudioTrack) with a specific session ID. New [attachAuxEffect()](https://developer.android.com/reference/android/media/AudioTrack#attachAuxEffect(int)), [getAudioSessionId()](https://developer.android.com/reference/android/media/AudioTrack#getAudioSessionId()), and [setAuxEffectSendLevel()](https://developer.android.com/reference/android/media/AudioTrack#setAuxEffectSendLevel(float)) methods.
- New [attachAuxEffect()](https://developer.android.com/reference/android/media/MediaPlayer#attachAuxEffect(int)), [getAudioSessionId()](https://developer.android.com/reference/android/media/MediaPlayer#getAudioSessionId()), [setAudioSessionId(int)](https://developer.android.com/reference/android/media/MediaPlayer#setAudioSessionId(int)), and [setAuxEffectSendLevel()](https://developer.android.com/reference/android/media/MediaPlayer#setAuxEffectSendLevel(float)) methods and supporting types.

To look at sample code for audio effects, see
[AudioFxDemo.java](https://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/media/AudioFxDemo)
in the ApiDemos sample application.

The media framework also adds:

- New support for altitude tag in EXIF metadata for JPEG files. New method [getAltitude()](https://developer.android.com/reference/android/media/ExifInterface#getAltitude(double)) method to retrieve the value of the EXIF altitude tag.
- New [setOrientationHint()](https://developer.android.com/reference/android/media/MediaRecorder#setOrientationHint(int)) method lets an application tell [MediaRecorder](https://developer.android.com/reference/android/media/MediaRecorder) of the orientation during video capture.

### Download manager

The platform includes a new [DownloadManager](https://developer.android.com/reference/android/app/DownloadManager) system service
that handles long-running HTTP downloads. Applications can request that a URI be
downloaded to a particular destination file. The `DownloadManager`
will conduct the download in the background, taking care of HTTP interactions
and retrying downloads after failures or across connectivity changes and system
reboots.

- Applications can obtain an instance of the [DownloadManager](https://developer.android.com/reference/android/app/DownloadManager) class by calling [getSystemService(String)](https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)) and passing [DOWNLOAD_SERVICE](https://developer.android.com/reference/android/content/Context#DOWNLOAD_SERVICE). Applications that request downloads through this API should register a broadcast receiver for [ACTION_NOTIFICATION_CLICKED](https://developer.android.com/reference/android/app/DownloadManager#ACTION_NOTIFICATION_CLICKED), to appropriately handle when the user clicks on a running download in a notification or from the Downloads UI.
- The [DownloadManager.Request](https://developer.android.com/reference/android/app/DownloadManager.Request) class lets an application provide all the information necessary to request a new download, such as request URI and download destination. A request URI is the only required parameter. Note that the default download destination is a shared volume where the system can delete your file if it needs to reclaim space for system use. For persistent storage of a download, specify a download destination on external storage (see [setDestinationUri(Uri)](https://developer.android.com/reference/android/app/DownloadManager.Request#setDestinationUri(android.net.Uri))).
- The [DownloadManager.Query](https://developer.android.com/reference/android/app/DownloadManager.Query) class provides methods that let an application query for and filter active downloads.

### StrictMode

To help developers monitor and improve the performance of their applications,
the platform offers a new system facility called [StrictMode](https://developer.android.com/reference/android/os/StrictMode).
When implemented in an application, StrictMode catches and notifies the
developer of accidental disk or network activity that could degrade application
performance, such as activity taking place on the application's main thread
(where UI operations are received and animations are also taking place).
Developers can evaluate the network and disk usages issues raised in StrictMode
and correct them if needed, keeping the main thread more responsive and
preventing ANR dialogs from being shown to users.

- [StrictMode](https://developer.android.com/reference/android/os/StrictMode) is the core class and is the main integration point with the system and VM. The class provides convenience methods for managing the thread and VM policies that apply to the instance.
- [StrictMode.ThreadPolicy](https://developer.android.com/reference/android/os/StrictMode.ThreadPolicy) and [StrictMode.VmPolicy](https://developer.android.com/reference/android/os/StrictMode.VmPolicy) hold the policies that you define and apply to thread and VM instances.

For more information about how to use StrictMode to optimize your
application, see the class documentation and sample code at [android.os.StrictMode](https://developer.android.com/reference/android/os/StrictMode).

### UI Framework

- Support for overscroll
  - New support for overscroll in Views and Widgets. In Views, applications can enable/disable overscroll for a given view, set the overscoll mode, control the overscroll distance, and handle the results of overscrolling.
  - In Widgets, applications can control overscroll characteristics such as animation, springback, and overscroll distance. For more information, see [android.view.View](https://developer.android.com/reference/android/view/View) and [android.widget.OverScroller](https://developer.android.com/reference/android/widget/OverScroller).
  - [ViewConfiguration](https://developer.android.com/reference/android/view/ViewConfiguration) also provides methods [getScaledOverflingDistance()](https://developer.android.com/reference/android/view/ViewConfiguration#getScaledOverflingDistance()) and [getScaledOverscrollDistance()](https://developer.android.com/reference/android/view/ViewConfiguration#getScaledOverscrollDistance()).
  - New `overScrollMode`, `overScrollFooter`, and `overScrollHeader` attributes for `<ListView>` elements, for controlling overscroll behavior.
- Support for touch filtering
  - New support for touch filtering, which lets an application improve the security of Views that provide access to sensitive functionality. For example, touch filtering is appropriate to ensure the security of user actions such as granting a permission request, making a purchase, or clicking on an advertisement. For details, see the [View class
    documentation](https://developer.android.com/reference/android/view/View#Security).
  - New `filterTouchesWhenObscured` attribute for view elements, which declares whether to filter touches when the view's window is obscured by another visible window. When set to `"true"`, the view will not receive touches whenever a toast, dialog or other window appears above the view's window. Refer to [View security
    documentation](https://developer.android.com/reference/android/view/View#Security) for details.

  To look at sample code for touch filtering, see
  [SecureView.java](https://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/SecureView)
  in the ApiDemos sample application.
- Improved event management
  - New base class for input events, [InputEvent](https://developer.android.com/reference/android/view/InputEvent). The class provides methods that let applications determine the meaning of the event, such as by querying for the InputDevice from which the event orginated. The [KeyEvent](https://developer.android.com/reference/android/view/KeyEvent) and [MotionEvent](https://developer.android.com/reference/android/view/MotionEvent) are subclasses of [InputEvent](https://developer.android.com/reference/android/view/InputEvent).
  - New base class for input devices, [InputDevice](https://developer.android.com/reference/android/view/InputDevice). The class stores information about the capabilities of a particular input device and provides methods that let applications determine how to interpret events from an input device.
- Improved motion events
  - The [MotionEvent](https://developer.android.com/reference/android/view/MotionEvent) API is extended to include "pointer ID" information, which lets applications to keep track of individual fingers as they move up and down. The class adds a variety of methods that let an application work efficiently with motion events.
  - The input system now has logic to generate motion events with the new pointer ID information, synthesizing identifiers as new pointers are down. The system tracks multiple pointer IDs separately during a motion event, and ensures proper continuity of pointers by evaluating at the distance between the last and next set of pointers.
- Text selection controls
  - A new `setComposingRegion` method lets an application mark a region of text as composing text, maintaining the current styling. A `getSelectedText` method returns the selected text to the application. The methods are available in [BaseInputConnection](https://developer.android.com/reference/android/view/inputmethod/BaseInputConnection), [InputConnection](https://developer.android.com/reference/android/view/inputmethod/InputConnection), and [InputConnectionWrapper](https://developer.android.com/reference/android/view/inputmethod/InputConnectionWrapper).
  - New `textSelectHandle`, `textSelectHandleLeft`, `textSelectHandleRight`, and `textSelectHandleWindowStyle` attributes for `<TextView>`, for referencing drawables that will be used to display text-selection anchors and the style for the containing window.
- Activity controls
  - [ActivityInfo](https://developer.android.com/reference/android/content/pm/ActivityInfo) adds new constants for managing Activity orientation: [SCREEN_ORIENTATION_FULL_SENSOR](https://developer.android.com/reference/android/content/pm/ActivityInfo#SCREEN_ORIENTATION_FULL_SENSOR), [SCREEN_ORIENTATION_REVERSE_LANDSCAPE](https://developer.android.com/reference/android/content/pm/ActivityInfo#SCREEN_ORIENTATION_REVERSE_LANDSCAPE), [SCREEN_ORIENTATION_REVERSE_PORTRAIT](https://developer.android.com/reference/android/content/pm/ActivityInfo#SCREEN_ORIENTATION_REVERSE_PORTRAIT), [SCREEN_ORIENTATION_SENSOR_LANDSCAPE](https://developer.android.com/reference/android/content/pm/ActivityInfo#SCREEN_ORIENTATION_SENSOR_LANDSCAPE), and [SCREEN_ORIENTATION_SENSOR_PORTRAIT](https://developer.android.com/reference/android/content/pm/ActivityInfo#SCREEN_ORIENTATION_SENSOR_PORTRAIT).
  - New constant [IMPORTANCE_PERCEPTIBLE](https://developer.android.com/reference/android/app/ActivityManager.RunningAppProcessInfo#IMPORTANCE_PERCEPTIBLE) for the [importance](https://developer.android.com/reference/android/app/ActivityManager.RunningAppProcessInfo#importance) field in [ActivityManager.RunningAppProcessInfo](https://developer.android.com/reference/android/app/ActivityManager.RunningAppProcessInfo). The value indicates that a specific process is running something that is considered to be actively perceptible to the user. An example would be an application performing background music playback.
  - The Activity.setPersistent(boolean) method to mark an Activity as persistent is now deprecated and the implementation is a no-op.
- Notification text and icon styles
  - New [TextAppearance.StatusBar.EventContent](https://developer.android.com/reference/android/R.style#TextAppearance_StatusBar_EventContent), [TextAppearance.StatusBar.EventContent.Title](https://developer.android.com/reference/android/R.style#TextAppearance_StatusBar_EventContent_Title), [TextAppearance.StatusBar.Icon](https://developer.android.com/reference/android/R.style#TextAppearance_StatusBar_Icon), and [TextAppearance.StatusBar.Title](https://developer.android.com/reference/android/R.style#TextAppearance_StatusBar_Title) for managing notification style.

### Extra Large Screens

- The platform now supports extra large screen sizes, such as those that might be found on tablet devices. Developers can indicate that their applications are designed to support extra large screen sizes by adding a `<supports
  screens ... android:xlargeScreens="true">` element to their manifest files. Applications can use a new resource qualifier, `xlarge`, to tag resources that are specific to extra large screens. For details on how to support extra large and other screen sizes, see [Supporting Multiple
  Screens](https://developer.android.com/guide/practices/screens_support).

### Graphics

  - Adds remaining OpenGL ES 2.0 methods [glDrawElements()](https://developer.android.com/reference/android/opengl/GLES20#glDrawElements(int, int, int, int)) and [glVertexAttribPointer()](https://developer.android.com/reference/android/opengl/GLES20#glVertexAttribPointer(int, int, int, boolean, int, int)) in the [android.opengl.GLES20](https://developer.android.com/reference/android/opengl/GLES20) class.
  - Adds support for [YV12](https://developer.android.com/reference/android/graphics/ImageFormat#YV12) pixel format, a planar 4:2:0 YCrCb format.

### Content Providers

  - New [AlarmClock](https://developer.android.com/reference/android/provider/AlarmClock) provider class for setting an alarm or handling an alarm. The provider contains a `ACTION_SET_ALARM` Intent action and extras that can be used to start an Activity to set a new alarm in an alarm clock application. Applications that wish to receive the `SET_ALARM` Intent should create an activity that requires the the SET_ALARM permission. Applications that wish to create a new alarm should use [Context.startActivity()](https://developer.android.com/reference/android/content/Context#startActivity(android.content.Intent)), so that the user has the option of choosing which alarm clock application to use.
  - [MediaStore](https://developer.android.com/reference/android/provider/MediaStore) supports a new Intent action, [PLAY_FROM_SEARCH](https://developer.android.com/reference/android/provider/MediaStore#INTENT_ACTION_MEDIA_PLAY_FROM_SEARCH), that lets an application search for music media and automatically play content from the result when possible. For example, an application could fire this Intent as the result of a voice recognition command to listen to music.
  - [MediaStore](https://developer.android.com/reference/android/provider/MediaStore) also adds a new [MEDIA_IGNORE_FILENAME](https://developer.android.com/reference/android/provider/MediaStore#MEDIA_IGNORE_FILENAME) flag that tells the media scanner to ignore media in the containing directory and its subdirectories. Developers can use this to avoid having graphics appear in the Gallery and likewise prevent application sounds and music from showing up in the Music app.
  - The [Settings](https://developer.android.com/reference/android/provider/Settings) provider adds the new Activity actions [APPLICATION_DETAILS_SETTINGS](https://developer.android.com/reference/android/provider/Settings#ACTION_APPLICATION_DETAILS_SETTINGS) and [MANAGE_ALL_APPLICATIONS_SETTINGS](https://developer.android.com/reference/android/provider/Settings#ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS), which let an application show the details screen for a specific application or show the Manage Applications screen.
  - The [ContactsContract](https://developer.android.com/reference/android/provider/ContactsContract) provider adds the [ContactsContract.CommonDataKinds.SipAddress](https://developer.android.com/reference/android/provider/ContactsContract.CommonDataKinds.SipAddress) data kind, for storing a contact's SIP (Internet telephony) address.

### Location

  - The [LocationManager](https://developer.android.com/reference/android/location/LocationManager) now tracks application requests that result in wake locks or wifi locks according to [WorkSource](https://developer.android.com/reference/android/os/WorkSource), a system-managed class that identifies the application.

    The `LocationManager` keeps track
    of all clients requesting periodic updates, and tells its providers
    about them as a `WorkSource` parameter, when setting their minimum
    update times.
    The network location provider uses `WorkSource` to track the
    wake and wifi locks initiated by an application and adds it to the application's
    battery usage reported in Manage Applications.
  - The [LocationManager](https://developer.android.com/reference/android/location/LocationManager) adds several new methods that let an Activity register to receive periodic or one-time location updates based on specified criteria (see below).
  - A new [Criteria](https://developer.android.com/reference/android/location/Criteria) class lets an application specify a set of criteria for selecting a location provider. For example, providers may be ordered according to accuracy, power usage, ability to report altitude, speed, and bearing, and monetary cost.

### Storage

  - Android 2.3 adds a new [StorageManager](https://developer.android.com/reference/android/os/storage/StorageManager) that supports OBB (Opaque Binary Blob) files. Although platform support for OBB is available in Android 2.3, development tools for creating and managing OBB files will not be available until early 2011.
  - The Android 2.3 platform adds official support for devices that do not include SD cards (although it provides virtual SD Card partition, when no physical SD card is available). A convenience method, [isExternalStorageRemovable()](https://developer.android.com/reference/android/os/Environment#isExternalStorageRemovable()), lets applications determine whether a physical SD card is present.

### Package Manager

  - New constants for declaring hardware and software features. See the list in the [New Feature Constants](https://developer.android.com/about/versions/android-2.3#feature_constants) section, below.
  - [PackageInfo](https://developer.android.com/reference/android/content/pm/PackageInfo) adds new [firstInstallTime](https://developer.android.com/reference/android/content/pm/PackageInfo#firstInstallTime) and [lastUpdateTime](https://developer.android.com/reference/android/content/pm/PackageInfo#lastUpdateTime) fields that store the time of the package installation and last update.
  - New [getProviderInfo()](https://developer.android.com/reference/android/content/pm/PackageManager#getProviderInfo(android.content.ComponentName, int)) method for retrieving all of the information known about a particular content provider class.

### Telephony

  - The [TelephonyManager](https://developer.android.com/reference/android/telephony/TelephonyManager) adds the constant [NETWORK_TYPE_EVDO_B](https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_EVDO_B) for specifying the CDMA EVDO Rev B network type.
  - New [getPsc()](https://developer.android.com/reference/android/telephony/gsm/GsmCellLocation#getPsc()) method returns the primary scrambling code of the serving cell on a UMTS network.

### Native access to Activity lifecycle, windows

- Android 2.3 exposes a broad set of APIs to applications that use native code. Framework classes of interest to such applications include:
  - [NativeActivity](https://developer.android.com/reference/android/app/NativeActivity) is a new type of Activity class, whose lifecycle callbacks are implemented directly in native code. A `NativeActivity` and its underlying native code run in the system just as do other Activities --- specifically they run in the Android application's system process and execute on the application's main UI thread, and they receive the same lifecycle callbacks as do other Activities.
  - New [InputQueue](https://developer.android.com/reference/android/view/InputQueue) class and callback interface lets native code manage event queueing.
  - New [SurfaceHolder.Callback2](https://developer.android.com/reference/android/view/SurfaceHolder.Callback2) interface lets native code manage a [SurfaceHolder](https://developer.android.com/reference/android/view/SurfaceHolder).
  - New [takeInputQueue](https://developer.android.com/reference/android/view/Window#takeInputQueue(android.view.InputQueue.Callback)) and [takeSurface()](https://developer.android.com/reference/android/view/Window#takeSurface(android.view.SurfaceHolder.Callback2)) methods in [Window](https://developer.android.com/reference/android/view/Window) let native code manage events and surfaces.
- For full information on working with native code or to download the NDK, see the [Android NDK](https://developer.android.com/tools/sdk/ndk) page.

### Dalvik Runtime

  - [dalvik.system](https://developer.android.com/reference/dalvik/system/package-summary) removes several classes that were previously deprecated.
  - Dalvik core libraries:
    - New collections: [ArrayDeque](https://developer.android.com/reference/java/util/ArrayDeque), [NavigableMap](https://developer.android.com/reference/java/util/NavigableMap), [ConcurrentSkipListMap](https://developer.android.com/reference/java/util/concurrent/ConcurrentSkipListMap), [LinkedBlockingDeque](https://developer.android.com/reference/java/util/concurrent/LinkedBlockingDeque)
    - New [Arrays](https://developer.android.com/reference/java/util/Arrays) utilities: `binarySearch()`, `copyOf()`, `copyOfRange()`, and others.
    - [CookieManager](https://developer.android.com/reference/java/net/CookieManager) for [HttpURLConnection](https://developer.android.com/reference/java/net/HttpURLConnection).
    - More complete network APIs: [InterfaceAddress](https://developer.android.com/reference/java/net/InterfaceAddress), [NetworkInterface](https://developer.android.com/reference/java/net/NetworkInterface) and [IDN](https://developer.android.com/reference/java/net/IDN)
    - [File](https://developer.android.com/reference/java/io/File) read and write controls
    - [String.isEmpty()](https://developer.android.com/reference/java/lang/String#isEmpty())
    - [Normalizer](https://developer.android.com/reference/java/text/Normalizer) and [Normalizer.Form](https://developer.android.com/reference/java/text/Normalizer.Form)
    - Improved [javax.net.ssl](https://developer.android.com/reference/javax/net/ssl/package-summary) server sockets.

### New manifest elements and attributes

  - New `xlargeScreens` attribute for [`<supports-screens>`](https://developer.android.com/guide/topics/manifest/supports-screens-element) element, to indicate whether the application supports extra large screen form-factors. For details, see [Supporting Multiple
    Screens](https://developer.android.com/guide/practices/screens_support).
  - New values for `android:screenOrientation` attribute of `<activity>` element:
    - `"reverseLandscape"` --- The Activity would like to have the screen in landscape orientation, turned in the opposite direction from normal landscape.
    - `"reversePortrait"` --- The Activity would like to have the screen in portrait orientation, turned in the opposite direction from normal portrait.
    - `"sensorLandscape"` --- The Activity would like to have the screen in landscape orientation, but can use the sensor to change which direction the screen is facing.
    - `"sensorPortrait"` --- The Activity would like to have the screen in portrait orientation, but can use the sensor to change which direction the screen is facing.
    - `"fullSensor"` --- Orientation is determined by a physical orientation sensor: the display will rotate based on how the user moves the device. This allows any of the 4 possible rotations, regardless of what the device will normally do (for example some devices won't normally use 180 degree rotation).

### New Permissions

  - `com.android.permission.SET_ALARM` --- Allows an application to broadcast an Intent to set an alarm for the user. An Activity that handles the [SET_ALARM](https://developer.android.com/reference/android/provider/AlarmClock#ACTION_SET_ALARM) Intent action should require this permission.
  - `android.permission.USE_SIP` --- Allows an application to use the [SIP API](https://developer.android.com/reference/android/net/sip/package-summary) to make or receive internet calls.
  - `android.permission.NFC` --- Allows an application to use the [NFC API](https://developer.android.com/reference/android/nfc/package-summary) to read NFC tags.

### New Feature Constants

- The platform adds several new hardware features that developers can declare in their application manifests as being required by their applications. This lets developers control how their application is filtered, when published on Google Play.
  - [android.hardware.audio.low_latency](https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_AUDIO_LOW_LATENCY) --- The application uses a low-latency audio pipeline on the device and is sensitive to delays or lag in sound input or output.
  - [android.hardware.camera.front](https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_CAMERA_FRONT) --- The application uses a front-facing camera on the device.
  - [android.hardware.nfc](https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_NFC) --- The application uses NFC radio features in the device.
  - [android.hardware.sensor.barometer](https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_SENSOR_BAROMETER) --- The application uses the device's barometer.
  - [android.hardware.sensor.gyroscope](https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_SENSOR_GYROSCOPE) --- The application uses the device's gyroscope sensor.
  - [android.software.sip](https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_SIP) --- The application uses the SIP API on the device.
  - [android.software.sip.voip](https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_SIP_VOIP) --- The application uses a SIP-based VoIP service on the device.
  - [android.hardware.touchscreen.multitouch.jazzhand](https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND) --- The application uses advanced multipoint multitouch capabilities on the device screen, for tracking five or more points fully independently.
- For full information about how to declare features and use them for filtering, see the documentation for [`<uses-feature>`](https://developer.android.com/guide/topics/manifest/uses-feature-element).

### API differences report

- For a detailed view of all API changes in Android 2.3 (API Level 9), see the [API
  Differences Report](https://developer.android.com/sdk/api_diff/9/changes).

## API Level

- The Android 2.3 platform delivers an updated version of the framework API. The Android 2.3 API is assigned an integer identifier --- **9** --- that is stored in the system itself. This identifier, called the "API Level", allows the system to correctly determine whether an application is compatible with the system, prior to installing the application.
- To use APIs introduced in Android 2.3 in your application, you need compile the application against the Android library that is provided in the Android 2.3 SDK platform. Depending on your needs, you might also need to add an `android:minSdkVersion="9"` attribute to the `<uses-sdk>` element in the application's manifest. If your application is designed to run only on Android 2.3 and higher, declaring the attribute prevents the application from being installed on earlier versions of the platform.
- For more information, read [What is API
  Level?](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)