Android 2.3.3 API
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
API 级别:10
Android 2.3.3 (GINGERBREAD_MR1
) 是一个小型功能版本,为 Android 2.3 平台添加了多项改进和 API。
对于开发者,Android 2.3.3 平台可作为 Android SDK 的可下载组件提供。可下载的平台包含 Android 库和系统映像,以及一组模拟器皮肤等。如需开始针对 Android 2.3.3 进行开发或测试,请使用 Android SDK 管理器将该平台下载到您的 SDK 中。
API 概览
以下部分从技术层面概述了 2.3.3 中面向开发者的新功能,包括框架 API 自上一个版本以来的新功能和变更。
近距离无线通信 (NFC)
Android 2.3.3 改进并扩展了对 NFC 的支持,以便应用能够以新的方式与更多类型的标签进行交互。
一组全新的全面 API 可让应用对更多标准代码技术(包括以下技术)拥有读取和写入权限:
- NFC-A (ISO 14443-3A)
- NFC-B (ISO 14443-3B)
- NFC-F (JIS 6319-4)
- NFC-V (ISO 15693)
- ISO-DEP (ISO 14443-4)
- MIFARE Classic
- MIFARE Ultralight
- NFC Forum NDEF 标签
该平台还提供有限的点对点通信协议和 API。前台 activity 可以使用此 API 注册 NDEF 消息,该消息会在其他 NFC 设备连接时推送到这些设备。
借助高级标签分派功能,应用现在可以更好地控制在检测到 NFC 标签时如何以及何时启动。以前,平台使用单步 intent 调度来通知感兴趣的应用发现了代码。该平台现在采用四步流程,让前台应用能够在代码事件传递给任何其他应用 (android.nfc.NfcAdapter.enableForegroundDispatch()
) 之前控制该事件。
此外,新调度流程还允许应用根据两个新的 intent 操作(android.nfc.action.NDEF_DISCOVERED
和 android.nfc.action.TECH_DISCOVERED
)监听特定代码内容和代码技术。
NFC API 可在 android.nfc
和 android.nfc.tech
软件包中使用。关键类如下:
NFC 通信依赖于设备硬件中的无线技术,并非所有 Android 设备都支持 NFC。不支持 NFC 的 Android 设备在调用 getDefaultAdapter(Context)
时会返回 null 对象,context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_NFC)
会返回 false
。不过,无论底层硬件是否受支持,NFC API 始终存在。
如需使用 NFC API,应用必须在其清单文件中声明 <uses-permission
android:name="android.permission.NFC">
,以便向用户请求权限。
此外,开发者还可以在 Google Play 上请求过滤,以便其应用不会向设备不支持 NFC 的用户显示。如需请求过滤,请将 <uses-feature android:name="android.hardware.nfc"
android:required="true">
添加到应用的清单中。
如需了解详情,请参阅 NFC 开发者指南。
蓝牙
Android 2.3.3 为蓝牙非安全套接字连接添加了平台和 API 支持。这样,应用就可以与可能不提供身份验证界面的简单设备进行通信。如需了解详情,请参阅 createInsecureRfcommSocketToServiceRecord(java.util.UUID)
和 listenUsingInsecureRfcommWithServiceRecord(java.lang.String, java.util.UUID)
。
图形
语音识别
语音识别 API 包含新的常量,可让您以新的方式管理语音搜索结果。虽然在正常使用语音识别功能时不需要这些新常量,但您可以使用它们在应用中以不同的视图显示语音搜索结果。如需了解详情,请参阅 RecognizerResultsIntent
。
API 级别
Android 2.3.3 平台提供了更新后的框架 API 版本。Android 2.3.3 API 会被分配一个整数标识符(10),该标识符存储在系统本身中。此标识符称为“API 级别”,可让系统在安装应用之前正确确定应用是否与系统兼容。
如需在应用中使用 Android 2.3.3 中引入的 API,您需要针对 Android 2.3.3 SDK 平台中提供的 Android 库编译应用。根据您的需求,您可能还需要向应用清单中的 <uses-sdk>
元素添加 android:minSdkVersion="10"
属性。如果您的应用仅设计为在 Android 2.3 及更高版本上运行,则声明此属性可防止应用安装在较低版本的平台上。
如需了解详情,请参阅什么是 API 级别?
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[],[],null,["# Android 2.3.3 APIs\n\n*API Level:* **10**\n\nAndroid 2.3.3 ([GINGERBREAD_MR1](/reference/android/os/Build.VERSION_CODES#GINGERBREAD_MR1))\nis a small feature release that adds several improvements\nand APIs to the Android 2.3 platform.\n\nFor developers, the Android 2.3.3 platform is available as a\ndownloadable component for the Android SDK. The downloadable platform includes\nan Android library and system image, as well as a set of emulator skins and\nmore. To get started developing or testing against Android 2.3.3,\nuse the Android SDK Manager to download the platform into your SDK.\n\nAPI Overview\n------------\n\nThe sections below provide a technical overview of what's new for developers\nin 2.3.3, including new features and changes in the framework\nAPI since the previous version.\n\n### Near Field Communications (NFC)\n\nAndroid 2.3.3 provides improved and extended support for NFC, to allow\napplications to interact with more types of tags in new ways.\n\nA new, comprehensive set of APIs give applications read and write access\nto a wider range of standard tag technologies, including:\n\n- NFC-A (ISO 14443-3A)\n- NFC-B (ISO 14443-3B)\n- NFC-F (JIS 6319-4)\n- NFC-V (ISO 15693)\n- ISO-DEP (ISO 14443-4)\n- MIFARE Classic\n- MIFARE Ultralight\n- NFC Forum NDEF tags\n\nThe platform also provides a limited peer-to-peer communication protocol\nand API. Foreground Activities can use the API to register an NDEF\nmessage that will get pushed to other NFC devices when they connect.\n\nAdvanced tag dispatching now gives applications more control over how and\nwhen they are launched, when an NFC tag is discovered. Previously, the platform\nused a single-step intent dispatch to notify interested applications that a tag\nwas discovered. The platform now uses a four-step process that enables the\nforeground application to take control of a tag event before it is passed to any\nother applications (`android.nfc.NfcAdapter.enableForegroundDispatch()`).\n\nThe new dispatch process also lets apps listen for specific tag content and\ntag technologies, based on two new intent actions ---\n`android.nfc.action.NDEF_DISCOVERED` and\n`android.nfc.action.TECH_DISCOVERED`.\n\nThe NFC API is available in the [android.nfc](/reference/android/nfc/package-summary) and\n[android.nfc.tech](/reference/android/nfc/tech/package-summary) packages. The key classes are:\n\n- [NfcAdapter](/reference/android/nfc/NfcAdapter), which represents the NFC hardware on the device.\n- [NdefMessage](/reference/android/nfc/NdefMessage), which represents an NDEF data message, the standard format in which \"records\" carrying data are transmitted between devices and tags. An NDEF message certain many NDEF records of different types. Applications can receive these messages from [NDEF_DISCOVERED](/reference/android/nfc/NfcAdapter#ACTION_NDEF_DISCOVERED), [TECH_DISCOVERED](/reference/android/nfc/NfcAdapter#ACTION_TECH_DISCOVERED), or [TAG_DISCOVERED](/reference/android/nfc/NfcAdapter#ACTION_TAG_DISCOVERED) Intents.\n- [NdefRecord](/reference/android/nfc/NdefRecord), delivered in an [NdefMessage](/reference/android/nfc/NdefMessage), which describes the type of data being shared and carries the data itself.\n- [Tag](/reference/android/nfc/Tag), which represents a tag scanned by the device. Multiple types of tags are supported, based on the underlying tag technology.\n- [TagTechnology](/reference/android/nfc/tech/TagTechnology), an interface that gives applications access to tag properties and I/O operations based on the technologies present in the tag. For a full list of tag technologies supported in Android 2.3.3, see [android.nfc.tech](/reference/android/nfc/tech/package-summary).\n\nNFC communication relies on wireless technology in the device hardware, and\nis not present in all Android devices. Android devices that do not support\nNFC will return a null object when\n[getDefaultAdapter(Context)](/reference/android/nfc/NfcAdapter#getDefaultAdapter(android.content.Context)) is called, and\n`context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_NFC)`\nwill return `false`. The NFC API is always present, however, regardless of\nunderlying hardware support.\n\nTo use the NFC API, applications must request permission from the user by\ndeclaring `\u003cuses-permission\nandroid:name=\"android.permission.NFC\"\u003e` in their manifest files.\n\nAdditionally, developers can request filtering on Google Play, such that\ntheir applications are not discoverable to users whose devices do not support\nNFC. To request filtering, add\n`\u003cuses-feature android:name=\"android.hardware.nfc\"\nandroid:required=\"true\"\u003e` to the application's manifest.\n\nFor more information, read the\n[NFC](/guide/topics/connectivity/nfc) developer guide.\n\n### Bluetooth\n\nAndroid 2.3.3 adds platform and API support for Bluetooth nonsecure socket\nconnections. This lets applications communicate with simple devices that may not\noffer a UI for authentication. See\n[createInsecureRfcommSocketToServiceRecord(java.util.UUID)](/reference/android/bluetooth/BluetoothDevice#createInsecureRfcommSocketToServiceRecord(java.util.UUID)) and\n[listenUsingInsecureRfcommWithServiceRecord(java.lang.String, java.util.UUID)](/reference/android/bluetooth/BluetoothAdapter#listenUsingInsecureRfcommWithServiceRecord(java.lang.String, java.util.UUID))\nfor more information.\n\n### Graphics\n\n- A new [BitmapRegionDecoder](/reference/android/graphics/BitmapRegionDecoder) class lets applications decode a rectangle region from an image. The API is particularly useful when an original image is large and the application only need parts of the image.\n- A new [inPreferQualityOverSpeed](/reference/android/graphics/BitmapFactory.Options#inPreferQualityOverSpeed) field in [BitmapFactory.Options](/reference/android/graphics/BitmapFactory.Options) allows applications to use a more accurate but slightly slower IDCT method in JPEG decode. This in turn improves the quality of the reconstructed image.\n\n### Media framework\n\n- A new [MediaMetadataRetriever](/reference/android/media/MediaMetadataRetriever) class provides a unified interface for retrieving frame and metadata from an input media file.\n- [MediaRecorder.AudioEncoder](/reference/android/media/MediaRecorder.AudioEncoder) and [MediaRecorder.OutputFormat](/reference/android/media/MediaRecorder.OutputFormat) include new fields for specifying AMR Wideband and AAC formats.\n\n### Speech recognition\n\nThe speech-recognition API includes new constants to let you manage voice\nsearch results in new ways. Although the new constants are not needed for normal\nuse of speech recognition, you could use them to offer a different view of voice\nsearch results in your application. For information, see [RecognizerResultsIntent](/reference/android/speech/RecognizerResultsIntent).\n\nAPI Level\n---------\n\nThe Android 2.3.3 platform delivers an updated version of\nthe framework API. The Android 2.3.3 API\nis assigned an integer identifier ---\n**10** --- that is\nstored in the system itself. This identifier, called the \"API Level\", allows the\nsystem to correctly determine whether an application is compatible with\nthe system, prior to installing the application.\n\nTo use APIs introduced in Android 2.3.3 in your application,\nyou need compile the application against the Android library that is provided in\nthe Android 2.3.3 SDK platform. Depending on your needs, you might\nalso need to add an `android:minSdkVersion=\"10\"`\nattribute to the `\u003cuses-sdk\u003e` element in the application's\nmanifest. If your application is designed to run only on Android 2.3 and higher,\ndeclaring the attribute prevents the application from being installed on earlier\nversions of the platform.\n\nFor more information, read [What is API\nLevel?](/guide/topics/manifest/uses-sdk-element#ApiLevels)"]]