Android: API 级别 VS Android 版本

我是 Android 开发的新手,我想知道版本和 API 级别之间有什么联系或区别。每一个都指的是什么?当我决定为 API 14或者 Android 4.0开发一些应用程序时,这意味着什么?

或者一个是另一个的子集? 我只是没有得到差异,为什么有两个计数器?

谢谢

103199 次浏览

API Level is an integer value that uniquely identifies the framework API revision offered by a version of the Android platform.

You can have a new Android version with the same API release as the previous version.

Check out https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels

A device running Android with version X will usually support applications written for API X and below.

This means if you want your app to support API 8, devices ver 8 will be able to run it, but also devices of ver 9, 10, 11, etc.

Here is the table which explains the ties between the numbers: http://developer.android.com/guide/appendix/api-levels.html

Well, API is for development, so the changes in new API version are more "inside". But new version of Android usually adds more features for users, that are "visible".

Check this page http://developer.android.com/guide/appendix/api-levels.html, there is a table that shows relations between versions and API levels.

Multiple versions of Android can have the same API level but the API as an integer allows developers to more easily target devices. The chart below will give you an idea of their relationship but only the documentation contains exhaustive listings of the API levels and how they differ from each other.

Platform Versions

Source: developer.android.com.

Because this data is gathered from the new Google Play Store app, which supports Android 2.2 and above, devices running older versions are not included. However, in August, 2013, versions older than Android 2.2 accounted for about 1% of devices that checked in to Google servers (not those that actually visited Google Play Store).

In addition to the answers provided, there is a detailed explanation of the Android Platform usage on Wikipedia (permalink).

This table will give you a highlight of Android API vs Version.

enter image description here

API = a set of functions and procedures allowing the creation of applications that access the features or data of an operating system, application, or other service.

Android = Android is a mobile operating system developed by Google.

So if we develop new API with new features they can be not supported in old android operation system, so we take old operation system , ++ version add support for new API and there we go (:

on the other hand if we have new operation system with new features we want to upgrade old API to support it, so we ++ version of the API.

Sound weird yeah ?

In a short note:

Main difference between them is that API level for android application development framework API on the other hand android version is maintained to mention new features to user level.

In details:

API Level is 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 classes
  • 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 system

For more details you can visit this link: https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels

In simple words:

Android Version : Android is basically a mobile operating system developed by a consortium of developers known as the Open Handset Alliance and commercially sponsored by Google and they keep on updating Android by adding new features. So every new version of android have a version number known as Android version

API Level : API Level allow us to specify an app's/application's compatibility with one or more versions of Android, by means of an integer. Each versions of Android is associated with an API Level. So on a device the API Level expressed by an app/application is compared to the API Level associated with the version of the Android installed on the device.