page.title=Android 2.3.4 APIs excludeFromSuggestions=true sdk.platform.version=2.3.4 sdk.platform.apiLevel=10 @jd:body

In this document

  1. API Overview
  2. Open Accessory Library
  3. API Level

Reference

  1. API Differences Report »

API Level: {@sdkPlatformApiLevel}

Android 2.3.4 ({@link android.os.Build.VERSION_CODES#GINGERBREAD_MR1}) is a maintenance release that adds several bug fixes and patches to the Android 2.3 platform, without any API changes from Android 2.3.3. Additionally, Android 2.3.4 brings support for the Open Accessory API to mobile devices, through the optional Open Accessory Library.

For developers, the Android {@sdkPlatformVersion} 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 {@sdkPlatformVersion}, use the Android SDK Manager to download the platform into your SDK.

API Overview

Android 2.3.4 provides the same framework API to applications as Android 2.3.3 (API level 10). For a summary of the API, see the Android 2.3.3 version notes.

Open Accessory Library

Open Accessory is a new capability for integrating connected peripherals with applications running on the platform. The capability is based on a USB (Universal Serial Bus) stack built into the platform and an API exposed to applications. Peripherals that attach to Android-powered devices as accessories connect as USB hosts.

Open Accessory is introduced in Android 3.1 (API level 12), but is made available to devices running Android 2.3.4 by means of an optional external library, the Open Accessory Library. The library exposes a framework API that lets applications discover, communicate with, and manage a variety of device types connected over USB. It also provides the implementation of the API against parts of the Android platform that are not directly exposed to applications in Android 2.3.4.

The Open Accessory Library is optional on any given device. Device manufacturers may choose whether to include the Open Accessory Library in their products or exclude it. The library is forward-compatible with Android 3.1, so applications developed against Android 2.3.4 will run properly on devices running Android 3.1, if those devices support USB accessories.

The API provided by the Open Accessory Library is based on the Open Accessory API provided in Android 3.1. In most areas, you can use the same techniques and APIs. However, developing for the Open Accessory Library on Android 2.3.4 differs from the standard USB API in these ways:

To develop apps using the Open Accessory Library, you need:

For a full discussion of how to develop applications that interact with USB accessories, please see the related developer documentation.

Additionally, developers can request filtering on Google Play, such that their applications are not available to users whose devices do not provide the appropriate accessory support. To request filtering, add the element below to the application manifest:

<uses-feature
  android:name="android.hardware.usb.accessory"
  android:required="true">

API Level

The Android 2.3.4 platform does not increment the API level — it uses the same API level as Android 2.3.3, API level 10.

To use APIs introduced in API level 10 in your application, you need compile the application against the Android library that is provided in the latest version of the Google APIs Add-On, which also includes the Open Accessory Library.

Depending on your needs, you might also need to add an android:minSdkVersion="{@sdkPlatformApiLevel}" attribute to the <uses-sdk> element in the application's manifest. If your application is designed to run only on Android 2.3.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?