diff --git a/docs/html/guide/appendix/api-levels.jd b/docs/html/guide/appendix/api-levels.jd new file mode 100644 index 0000000000000..9af09188cb9fd --- /dev/null +++ b/docs/html/guide/appendix/api-levels.jd @@ -0,0 +1,79 @@ +page.title=Android API Levels +@jd:body + + +
The Android API Level is an integer that indicates a set of APIs available in an Android SDK +and on a version of the Android platform. Each version of the Android platform supports a specific set +of APIs, which are always backward-compatible. For example, Android 1.5 supports all APIs available in +Android 1.0, but the reverse is not true. If an application uses APIs +available in Android 1.5 that are not available in 1.0, then the application should never be installed +on an Android 1.0 device, because it will fail due to missing APIs. The API Level ensures this does not happen +by comparing the minimum API Level required by the applicaiton to the API Level available on the device.
+ +When a new version of Android adds APIs, a new API Level is added to the platform. The new APIs
+are available only to applications that declare a minimum API Level that is equal-to or greater-than
+the API Level in which the APIs were introduced. The API Level required by an application is declared with the
+<uses-sdk> element inside the Android manifest, like this:
<uses-sdk android:minSdkVersion="3" />+ +
The value for minSdkVersion is the minimum API Level required by the application.
+If this is not declared, then it is assumed that the application is compatible with all versions and defaults to
+API Level 1. In which case, if the application actually uses APIs introduced with an API Level greater than 1, then
+the application will fail in unpredictable ways when installed on a device that only supports API Level 1
+(such as an Android 1.0 device).
+See the <uses-sdk>
+documentation for more about declaring the API Level in your manifest.
For example, the {@link android.appwidget} package was introduced with API Level 3. If your application
+has set minSdkVersion to 1 or 2, then your application cannot use this package,
+even if the device running your application uses a version of Android that supports it.
+In order to use the {@link android.appwidget} package, your application must set minSdkVersion
+to 3 or higher. When the minSdkVersion is set to 3, the application will no longer be able to install
+on a device running a platform version with an API Level less than 3.
Despite the name of the manifest attribute (minSdkVersion), the API Level is not directly
+associated with a specific SDK. For example, the SDK for Android 1.0 uses
+API Level 1 and the SDK for Android 1.1 uses API Level 2. So it may seem that the API Level increases consistently.
+However, it's possible that a subsequent platform
+releases will not introduce new APIs, and thus, the API Level will remain the same. In addition, there are often
+multiple SDK releases for a single platform version (there were three SDK releases for Android 1.5), and
+there's no guarantee that the API Level will remain the same between these. It's possible (but unlikely) that
+a second or third SDK for a given version of the platform will provide new APIs and add a new API Level.
+When you install a new SDK, be sure to read the SDK Contents on the install page, which specifies the API
+Level for each platform available in the SDK. Also see the comparison of
+Platform Versions vs. API Levels, below.
Note: During "preview" SDK releases, there may not yet be an official platform version
+or API Level number specified. In these cases, a string value equal to the
+current codename will be a valid value for minSdkVersion, instead of an integer. This codename value
+will only be valid while using the preview SDK. When the final SDK is released, you must update your manifest to use
+the official API Level integer.
The following table specifies the maximum API Level supported by each version of the Android platform.
+ +| Platform Version | API Level |
|---|---|
| Android 1.0 | 1 |
| Android 1.1 | 2 |
| Android 1.5 | 3 |
| Android Donut | Donut |
The Android API reference includes information that specififies the minimum API Level required for each +package, class, and member. You can see this information on the right side of each header or label.
+ +By default, the reference documentation shows all APIs available with the latest SDK release. +This means that the reference assumes you're using the latest API Level and will show you everything available +with it. If you're developing applications for a version of Android that does not support the latest API Level, +then you can filter the reference to reveal only the packages, classes, and members available for that API Level. +When viewing the reference, use the "Filter by API Level" selection box (below the search bar) to pick the API Level +you'd like to view.
+ + +