Android 2.1 平台
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
API 级别:7
Android 2.1 是一个次要平台版本
可于 2010 年 1 月开始部署到采用 Android 的手机。
此版本包含新的 API 变更和 bug 修复。如需了解相关变更,请参阅 Framework API
部分。
对于开发者,Android 2.1 平台以
可下载组件可下载平台包含
完全兼容的 Android 库和系统映像,以及一组模拟器
皮肤、示例应用等等。可下载平台
不包含任何外部库。
要开始针对 Android
2.1 平台,请使用 Android SDK 和 AVD 管理器工具
将该平台下载到您的 SDK 中。
平台亮点
Android 2.1 没有添加重要的用户功能,请参阅 Android
2.0 平台亮点文档。
修订版本
以下各部分提供了关于 Android SDK 的 Android 2.1 平台组件各个版本(以修订版本号指明)的说明。为了确定 Android 的哪个(哪些)修订版本
2.1 平台安装在 SDK 环境中,请参阅
“已安装的软件包”部分在 Android SDK 和 AVD 管理器中列出
Android 2.1,修订版 3(2011 年 7 月)
- 依赖项:
-
需要 SDK 工具 r12 或更高版本。
- 注意:
-
改进了平台的渲染库,以支持 ADT Eclipse 插件中的视觉布局编辑器。此修订版本允许在 ADT 中提供更多绘制功能,并修复了之前的渲染库中的多个 bug。它还解锁了 ADT 12 中添加的一些编辑器功能。
Android 2.1,修订版 2(2010 年 5 月)
- 依赖项:
-
需要 SDK 工具 r6 或更高版本。
- 工具:
-
- 添加了对 Ant 构建系统中库项目的支持。
- 在 ADT 的可视化布局编辑器中添加了改进后的布局渲染功能。
Android 2.1,修订版 1(2010 年 1 月)
- 依赖项:
-
需要 SDK 工具 r4 或更高版本。
API 级别
Android 2.1 平台提供了
框架 API。Android 2.1 API 会被分配一个整数标识符(7),该标识符存储在系统本身中。此标识符称为“API 级别”,可让系统在安装应用之前正确确定应用是否与系统兼容。
要在您的
则需要在
<uses-sdk>
的 android:minSdkVersion
属性
元素。
如需详细了解如何使用 API 级别,请参阅 API 级别文档。
框架 API 变更
以下部分提供了有关应用更改的信息
Android 2.1 平台提供的框架 API。
动态壁纸
以下新增内容为您提供了用于开发动画壁纸的 API:
此外,如果您的应用使用或提供动态壁纸,您必须
请务必添加 <uses-feature>
元素添加到应用的清单中,声明属性
android:name="android.software.live_wallpaper"
。例如:
<uses-feature android:name="android.software.live_wallpaper" />
在您发布应用后,Google Play 会检查是否存在此元素,并将其用作过滤条件,以确保您的应用不会向设备不支持动态壁纸的用户提供。
电话
View
WebKit
API 差异报告
如需详细了解 Android 2.1 (API
级别 7)相比,请参阅 API
差异报告。
内置应用
可下载平台中包含的系统映像提供了这些
内置应用:
- 闹钟
- 浏览器
- 计算器
- 相机
- 通讯录
- 自定义语言区域(开发者应用)
- 开发者工具(开发者应用)
- 电子邮件
|
- 图库
- 用于日语、中文和拉丁语文本输入的 IME
- 消息功能
- 音乐
- 手机
- 设置
- 备件(开发者应用)
|
语言区域
可下载平台中包含的系统映像提供多种内置语言区域。在某些情况下,特定区域的语言区域提供特定区域的字符串。而在其他情况下,系统会使用该语言的默认版本。下列为 Android 2.1 系统映像中提供的语言(采用 language_country/region 语言区域描述符)。
- 中国中文 (zh_CN)
- 中文、台湾 (zh_TW)
- 捷克语 (cs_CZ)
- 荷兰语(荷兰)(nl_NL)
- 荷兰语、比利时 (nl_BE)
- 英语、美国 (en_US)
- 英语(英国)(en_GB)
- 英语(加拿大)(en_CA)
- 英语(澳大利亚)(en_AU)
- 英语(新西兰)(en_NZ)
- 英语(新加坡)(en_SG)
- 法语、法国 (fr_FR)
- 法语(比利时)(fr_BE)
|
法语(加拿大)(fr_CA)
法语(瑞士)(fr_CH)
德语(德国)(de_DE)
德语、奥地利 (de_AT)
德语(瑞士)(de_CH)
德语(列支敦士登)(de_LI)
意大利语(意大利)(it_IT)
意大利语(瑞士)(it_CH)
日语 (ja_JP)
韩语 (ko_KR)
波兰语 (pl_PL)
俄语 (ru_RU)
西班牙语 (es_ES)
|
本地化的界面字符串与可通过“设置”访问的语言区域匹配。
模拟器皮肤
可下载的平台包含一组模拟器皮肤,可用于在不同屏幕尺寸和分辨率下对应用进行建模。模拟器皮肤如下:
-
QVGA(240x320,低密度,小屏幕)
-
WQVGA(240x400,低密度,标准屏幕)
-
FWQVGA(240x432,低密度,标准屏幕)
-
HVGA(320x480,中密度,标准屏幕)
-
WVGA800(480x800,高密度,标准屏幕)
-
WVGA854(480x854 高密度,标准屏幕)
有关如何开发显示
能够在所有 Android 设备上正常运行,请参阅支持多种
屏幕。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-26。"],[],[],null,["# Android 2.1 Platform\n\n*API Level:* **7**\n\nAndroid 2.1 is a minor platform release\ndeployable to Android-powered handsets starting in January 2010.\nThis release includes new API\nchanges and bug fixes. For information on changes, see the [Framework API](#api)\nsection.\n\nFor developers, the Android 2.1 platform is available as a\ndownloadable component for the Android SDK. The downloadable platform includes a\nfully compliant Android library and system image, as well as a set of emulator\nskins, sample applications, and more. The downloadable platform\nincludes no external libraries.\n\nTo get started developing or testing against the Android\n2.1 platform, use the Android SDK and AVD Manager tool to\ndownload the platform into your SDK.\n\nPlatform Highlights\n-------------------\n\nAndroid 2.1 does not add significant user features, see the [Android\n2.0 Platform Highlights](https://developer.android.com/about/versions/android-2.0-highlights.html) document for the latest user features.\n\nRevisions\n---------\n\nThe sections below provide notes about successive releases of\nthe Android 2.1 platform component for the Android SDK, as denoted by\nrevision number. To determine what revision(s) of the Android\n2.1 platforms are installed in your SDK environment, refer to\nthe \"Installed Packages\" listing in the Android SDK and AVD Manager.\nAndroid 2.1, Revision 3 *(July 2011)*\n\nDependencies:\n\n: Requires [SDK Tools r12](/tools/sdk/tools-notes) or\n higher.\n\nNotes:\n\n: Improvements to the platform's rendering library to support the visual layout editor in the ADT\n Eclipse plugin. This revision allows for more drawing features in ADT and fixes several\n bugs in the previous rendering library. It also unlocks several editor features that were added in\n ADT 12.\n\nAndroid 2.1, Revision 2 *(May 2010)*\n\nDependencies:\n\n: Requires SDK Tools r6 or higher.\n\nTools:\n:\n - Adds support for library projects in the Ant build system.\n - Adds improved layout rendering in ADT's visual layout editor.\n\nAndroid 2.1, Revision 1 *(January 2010)*\n\nDependencies:\n\n: Requires SDK Tools r4 or higher.\n\nAPI Level\n---------\n\nThe Android 2.1 platform delivers an updated version of\nthe framework API. The Android 2.1 API\nis assigned an integer identifier ---\n**7** --- 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.1 in your\napplication, you need to set the proper value, \"7\", in the\n`android:minSdkVersion` attributes of the `\u003cuses-sdk\u003e`\nelement in your application's manifest.\n\nFor more information about how to use API Level, see the [API Levels](/guide/topics/manifest/uses-sdk-element#ApiLevels) document.\n\nFramework API Changes\n---------------------\n\nThe sections below provide information about changes made to the application\nframework API provided by the Android 2.1 platform.\n\n### Live Wallpapers\n\nThe following additions provide APIs for you to develop animated wallpapers:\n\n- New [android.service.wallpaper](/reference/android/service/wallpaper/package-summary) package.\n- New [WallpaperInfo](/reference/android/app/WallpaperInfo) class.\n- Updated [WallpaperManager](/reference/android/app/WallpaperManager).\n\nAdditionally, if your application uses or provides Live Wallpapers, you must\nremember to add a [`\u003cuses-feature\u003e`](/guide/topics/manifest/uses-feature-element)\nelement to the application's manifest, declaring the attribute\n`android:name=\"android.software.live_wallpaper\"`. For example: \n\n```\n\u003cuses-feature android:name=\"android.software.live_wallpaper\" /\u003e\n```\n\nWhen you've published your application, Google Play checks for the\npresence of this element and uses it as a filter, ensuring that your application\nis not made available to users whose devices do not support Live Wallpapers.\n\n### Telephony\n\n- New [SignalStrength](/reference/android/telephony/SignalStrength) class provides information about the device's current network signal. This can be acquired from the new [onSignalStrengthsChanged(SignalStrength)](/reference/android/telephony/PhoneStateListener#onSignalStrengthsChanged(android.telephony.SignalStrength)) callback.\n- New [onDataConnectionStateChanged(int, int)](/reference/android/telephony/PhoneStateListener#onDataConnectionStateChanged(int, int)) callback.\n\n### Views\n\n- New [View](/reference/android/view/View) methods [isOpaque()](/reference/android/view/View#isOpaque()) and [onDrawScrollBars(Canvas)](/reference/android/view/View#onDrawScrollBars(android.graphics.Canvas)).\n- New [RemoteViews](/reference/android/widget/RemoteViews) methods [addView(int, RemoteViews)](/reference/android/widget/RemoteViews#addView(int, android.widget.RemoteViews)) and [removeAllViews(int)](/reference/android/widget/RemoteViews#removeAllViews(int)).\n- New [ViewGroup](/reference/android/view/ViewGroup) methods [isChildrenDrawingOrderEnabled()](/reference/android/view/ViewGroup#isChildrenDrawingOrderEnabled()) and [setChildrenDrawingOrderEnabled(boolean)](/reference/android/view/ViewGroup#setChildrenDrawingOrderEnabled(boolean)).\n\n### WebKit\n\n- New [WebStorage](/reference/android/webkit/WebStorage) methods to manipulate web storage databases.\n- New [GeolocationPermissions](/reference/android/webkit/GeolocationPermissions) methods to get Geolocation permissions from, and set them on the WebView.\n- New [WebSettings](/reference/android/webkit/WebSettings) methods to manage settings for app cache, web storage, and zooming based on screen density.\n- New [WebChromeClient](/reference/android/webkit/WebChromeClient) methods for handling video, browsing history, custom Views, app cache limits, and more.\n\n### API differences report\n\nFor a detailed view of all API changes in Android 2.1 (API\nLevel 7), as compared to API Level 6, see the [API\nDifferences Report](/sdk/api_diff/7/changes).\n\nBuilt-in Applications\n---------------------\n\nThe system image included in the downloadable platform provides these\nbuilt-in applications:\n\n|------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|\n| - Alarm Clock - Browser - Calculator - Camera - Contacts - Custom Locale (developer app) - Dev Tools (developer app) - Email | - Gallery - IMEs for Japanese, Chinese, and Latin text input - Messaging - Music - Phone - Settings - Spare Parts (developer app) |\n\nLocales\n-------\n\nThe system image included in the downloadable platform provides a variety of\nbuilt-in locales. In some cases, region-specific strings are available for the\nlocales. In other cases, a default version of the language is used. The\nlanguages that are available in the Android 2.1 system\nimage are listed below (with *language* _*country/region* locale\ndescriptor).\n\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| - Chinese, PRC (zh_CN) - Chinese, Taiwan (zh_TW) - Czech (cs_CZ) - Dutch, Netherlands (nl_NL) - Dutch, Belgium (nl_BE) - English, US (en_US) - English, Britain (en_GB) - English, Canada (en_CA) - English, Australia (en_AU) - English, New Zealand (en_NZ) - English, Singapore(en_SG) - French, France (fr_FR) - French, Belgium (fr_BE) | - French, Canada (fr_CA) - French, Switzerland (fr_CH) - German, Germany (de_DE) - German, Austria (de_AT) - German, Switzerland (de_CH) - German, Liechtenstein (de_LI) - Italian, Italy (it_IT) - Italian, Switzerland (it_CH) - Japanese (ja_JP) - Korean (ko_KR) - Polish (pl_PL) - Russian (ru_RU) - Spanish (es_ES) |\n\nLocalized UI strings match the locales that are accessible\nthrough Settings.\n\nEmulator Skins\n--------------\n\nThe downloadable platform includes a set of emulator skins that you can use\nfor modeling your application in different screen sizes and resolutions. The\nemulator skins are:\n\n- QVGA (240x320, low density, small screen)\n- WQVGA (240x400, low density, normal screen)\n- FWQVGA (240x432, low density, normal screen)\n- HVGA (320x480, medium density, normal screen)\n- WVGA800 (480x800, high density, normal screen)\n- WVGA854 (480x854 high density, normal screen)\n\nFor more information about how to develop an application that displays\nand functions properly on all Android-powered devices, see [Supporting Multiple\nScreens](/guide/practices/screens_support)."]]