安卓 英文 外文 文献翻译 Android API级别.doc
《安卓 英文 外文 文献翻译 Android API级别.doc》由会员分享,可在线阅读,更多相关《安卓 英文 外文 文献翻译 Android API级别.doc(17页珍藏版)》请在沃文网上搜索。
1、Android API LevelsAs you develop your application on Android, its useful to understand the platforms general approach to API change management. Its also important to understand the API Level identifier and the role it plays in ensuring your applications compatibility with devices on which it may be
2、installed.The sections below provide information about API Level and how it affects your applications.For information about how to use the Filter by API Level control available in the API reference documentation, seeFiltering the documentationat the end of this document.What is API Level?API Level i
3、s an integer value that uniquely identifies the framework API revision offered by a version of the Android platform.The Android platform provides a framework API that applications can use to interact with the underlying Android system. The framework API consists of: A core set of packages and classe
4、s A set of XML elements and attributes for declaring a manifest file A set of XML elements and attributes for declaring and accessing resources A set of Intents A set of permissions that applications can request, as well as permission enforcements included in the systemEach successive version of the
5、 Android platform can include updates to the Android application framework API that it delivers.Updates to the framework API are designed so that the new API remains compatible with earlier versions of the API. That is, most changes in the API are additive and introduce new or replacement functional
6、ity. As parts of the API are upgraded, the older replaced parts are deprecated but are not removed, so that existing applications can still use them. In a very small number of cases, parts of the API may be modified or removed, although typically such changes are only needed to ensure API robustness
7、 and application or system security. All other API parts from earlier revisions are carried forward without modification.The framework API that an Android platform delivers is specified using an integer identifier called API Level. Each Android platform version supports exactly one API Level, althou
8、gh support is implicit for all earlier API Levels (down to API Level 1). The initial release of the Android platform provided API Level 1 and subsequent releases have incremented the API Level.The following table specifies the API Level supported by each version of the Android platform.Platform Vers
9、ionAPI LevelAndroid 3.011Android 2.3.310Android 2.39Android 2.28Android 2.17Android 2.0.16Android 2.05Android 1.64Android 1.53Android 1.12Android 1.01Uses of API Level in AndroidThe API Level identifier serves a key role in ensuring the best possible experience for users and application developers:
10、It lets the Android platform describe the maximum framework API revision that it supports It lets applications describe the framework API revision that they require It lets the system negotiate the installation of applications on the users device, such that version-incompatible applications are not
11、installed.Each Android platform version stores its API Level identifier internally, in the Android system itself.Applications can use a manifest element provided by the framework API to describe the minimum and maximum API Levels under which they are able to run, as well as the preferred API Level t
12、hat they are designed to support. The element offers three key attributes: android:minSdkVersion Specifies the minimum API Level on which the application is able to run. The default value is 1. android:targetSdkVersion Specifies the API Level on which the application is designed to run. In some case
13、s, this allows the application to use manifest elements or behaviors defined in the target API Level, rather than being restricted to using only those defined for the minimum API Level. android:maxSdkVersion Specifies the maximum API Level on which the application is able to run.Important:Please rea
14、d thedocumentation before using this attribute.For example, to specify the minimum system API Level that an application requires in order to run, the application would include in its manifest aelement with aandroid:minSdkVersionattribute. The value ofandroid:minSdkVersionwould be the integer corresp
15、onding to the API Level of the earliest version of the Android platform under which the application can run.When the user attempts to install an application, or when revalidating an appplication after a system update, the Android system first checks theattributes in the applications manifest and com
16、pares the values against its own internal API Level. The system allows the installation to begin only if these conditions are met: If aandroid:minSdkVersionattribute is declared, its value must be less than or equal to the systems API Level integer. If not declared, the system assumes that the appli
17、cation requires API Level 1. If aandroid:maxSdkVersionattribute is declared, its value must be equal to or greater than the systems API Level integer. If not declared, the system assumes that the application has no maximum API Level. Please read thedocumentation for more information about how the sy
18、stem handles this attribute.When declared in an applications manifest, aelement might look like this: .The principal reason that an application would declare an API Level inandroid:minSdkVersionis to tell the Android system that it is using APIs that wereintroducedin the API Level specified. If the
19、application were to be somehow installed on a platform with a lower API Level, then it would crash at run-time when it tried to access APIs that dont exist. The system prevents such an outcome by not allowing the application to be installed if the lowest API Level it requires is higher than that of
20、the platform version on the target device.For example, theandroid.appwidgetpackage was introduced with API Level 3. If an application uses that API, it must declare aandroid:minSdkVersionattribute with a value of 3. The application will then be installable on platforms such as Android 1.5 (API Level
21、 3) and Android 1.6 (API Level 4), but not on the Android 1.1 (API Level 2) and Android 1.0 platforms (API Level 1).For more information about how to specify an applications API Level requirements, see thesection of the manifest file documentation.Development ConsiderationsThe sections below provide
22、 information related to API level that you should consider when developing your application.Application forward compatibilityAndroid applications are generally forward-compatible with new versions of the Android platform.Because almost all changes to the framework API are additive, an Android applic
23、ation developed using any given version of the API (as specified by its API Level) is forward-compatible with later versions of the Android platform and higher API levels. The application should be able to run on all later versions of the Android platform, except in isolated cases where the applicat
24、ion uses a part of the API that is later removed for some reason.Forward compatibility is important because many Android-powered devices receive over-the-air (OTA) system updates. The user may install your application and use it successfully, then later receive an OTA update to a new version of the
- 1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
- 2.下载的文档,不会出现我们的网址水印。
- 3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
下载文档到电脑,查找使用更方便
10 积分
下载 | 加入VIP,下载更划算! |
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 安卓 英文 外文 文献翻译 Android API级别 文献 翻译 API 级别