diff --git a/docs/html/sdk/compatibility-library.jd b/docs/html/sdk/compatibility-library.jd index d4669e50d993d..080eede2edf53 100644 --- a/docs/html/sdk/compatibility-library.jd +++ b/docs/html/sdk/compatibility-library.jd @@ -1,4 +1,4 @@ -page.title=Compatibility Library +page.title=Compatibility Package @jd:body @@ -8,9 +8,10 @@ page.title=Compatibility Library
Minimum API level supported: 4
-The Compatibility Library is a static library you can add to your Android application in order to -use APIs not available in older versions of the Android platform. The primary goal of the library is -to provide APIs introduced in Andriod 3.0 for older versions of Android so that all applications can -use them.
+The Compatibility Package includes static libraries you can add to your Android +application in order to use APIs that are either not available for older platform versions or that +offer "utility" APIs that aren't a part of the framework APIs. The goal is to simplify your +development by offering even more APIs that you can bundle with your application so you can +worry less about platform versions.
-If you're not able to use APIs introduced in Android 3.0 directly, because you want to remain -backward-compatible, the Compatibility Library provides your application access to self-contained -versions of some of the latest APIs that you can use with older versions of Android. Most -importantly, the library provides implementations of the {@link android.app.Fragment} and {@link -android.content.Loader} APIs, so you can use them in a way that's compatible with devices running -Android 1.6 (API level 4) and higher. Thus, you can more easily create a single APK that supports a -majority of devices and provide larger devices (such as tablets) a fully optimized experience by -using Fragments in your activity -design.
+Note: The Compatibility Package includes more than one library. +Each one has a different minimum API level. For example, one library requires API +level 4 or higher, while another requires API level 13 or higher. The minimum version is +indicated by the directory name, such as {@code v4/} and {@code v13/}. You can use more than one +library in your application as long as your {@code android:minSdkVersion} +meets the requirements of each library.
The sections below provide notes about successive releases of -the Compatibility Library, as denoted by revision number.
+the Compatibility Package, as denoted by revision number.
- Compatibility Library, revision 2 (May 2011)
+ Compatibility Package, revision 3 (July 2011)
These are exactly the same as the APIs added to the v4 support library, but rely on +other platform components in Android 3.2. Use this library instead of v4 if you're developing for +Android 3.2 and higher (all other APIs in the v4 library are already available with API level +13).
+
+
+ Compatibility Package, revision 2 (May 2011)
+
- Compatibility Library, revision 1 (March 2011)
+ Compatibility Package, revision 1 (March 2011)
Initial release of the library.
+Initial release with the v4 library.
The Compatibility Library is provided as a downloadable package from the Android SDK and AVD -Manager. To install the library:
+The Compatibility Package is provided as a downloadable package from the Android SDK and AVD +Manager. To install:
When done, all files (including source code, samples, and the {@code .jar} file) are saved
-into the <sdk>/extras/android/compatibility/ directory. The next directory
-name is {@code v4}, which indicates the lowest compatible version for the library within. That
-is, the code in {@code v4/} supports API level 4 and above. (There may be future libraries that
-have a different minimum version, so they will be saved alongside this one.)
When done, all files (including source code, samples, and the {@code .jar} files) are saved
+into the <sdk>/extras/android/compatibility/ directory. This directory contains
+each of the different support libraries, such as the library for API level 4 and up and the library
+for API level 13 and up, each named with the respective version (such as {@code v4/}).
To add the Compatibility Library to your Android project:
+To add one of the libraries to your Android project:
For example, the library that supports API level 4 and up is located at {@code +<sdk>/extras/android/compatibility/v4/android-support-v4.jar}.
+In Eclipse, right-click the JAR file in the Package Explorer, select Build +Path > Add to Build Path. You should then see the JAR file appear in a +new directory called Referenced Libraries.
+Your application is now ready to use fragments, loaders and other APIs from the library. All the -provided APIs are in the {@code android.support.v4} package.
+Your application is now ready to use the library APIs. All the +provided APIs are available in the {@code android.support} package (for +example, {@code android.support.v4}).
+ +Tip: To see the library APIs in action, take a look at the sample +apps in {@code extras/android/compatibility/<version>/samples/}.
Warning: Be certain that you not confuse the standard -{@code android} packages with those in {@code android.support.v4}. Some code completion tools might +{@code android} packages with those in {@code android.support} library. Some code completion tools +might get this wrong, especially if you're building against recent versions of the platform. To be safe, keep your build target set to the same version as you have defined for your {@code android:minSdkVersion} -and double check the import statements for classes that are duplicated in the Compatibility -Library, such as {@code SimpleCursorAdapter}.
+and double check the import statements for classes that also exist in the support library, such as +{@code SimpleCursorAdapter}. -The Compatibility Library provides access to several classes introduced with Android 3.0, plus -some updated version of existing classes. Some of the most useful and notable classes in the -library are:
+The support library for v4 provides access to several classes introduced with Android 3.0 and +beyond, plus some updated version of existing classes, and even some APIs that currently don't +exist in the Android platform. Some of the most useful and notable classes that have +counterparts in the v4 support library are:
For each of the classes above (and others not listed), the APIs work almost exactly the same -as the counterparts in the latest version of the Android platform. Thus, you can usually refer to -the latest reference documentation for information about the supported APIs. There are some +as the counterparts in the latest Android platform. Thus, you can usually refer to +the online documentation for information about the supported APIs. There are some differences, however. Most notably:
The Compatibility Library currently does not provide reference documentation for the included -APIs. To generate your own set, using the {@code javadoc} tool, perform the -following from a command line:
- --cd <sdk>/extras/android/compatibility/v4/ -mkdir docs -javadoc -sourcepath src/java/ -subpackages android.support.v4 -d docs --
Open the {@code docs/index.html} file to begin browsing the generated documentation.
- -Tip: To enable the Holographic theme on devices running Android 3.0 or higher, declare in your manifest file that your application targets API level 11. For example:
@@ -208,16 +258,30 @@ Android-powered devices, read Reference Docs + +The libraries currently do not provide reference documentation for the included APIs. To generate +your own set using the {@code javadoc} tool, perform the following from a command (as appropriate +for the library version you're using). In this example, documentation is generated for the v4 +library:
+ ++cd <sdk>/extras/android/compatibility/v4/ +mkdir docs +javadoc -sourcepath src/java/ -subpackages android.support.v4 -d docs ++
Open the {@code docs/index.html} file to begin browsing the generated documentation.
+ +If you want to see some sample code that uses the Compatibility Library, take a look at the -API -Demos sample code that's included with the Samples package you can download from the AVD and SDK -Manager.
+If you want to see some code that uses the support libraries, samples are included with the +Compatibility Package, inside each support library directory. For example, at {@code +extras/android/compatibility/v4/samples/}.
Additionally, the Google I/O App is a complete -application that uses the library to provide a single APK for both handsets and tablets and also -demonstrates some of Android's best practices in Android UI design.
+application that uses the v4 support library to provide a single APK for both handsets and tablets +and also demonstrates some of Android's best practices in Android UI design. diff --git a/docs/html/sdk/sdk_toc.cs b/docs/html/sdk/sdk_toc.cs index 829ed52a73d90..1b1fc8d3dbf00 100644 --- a/docs/html/sdk/sdk_toc.cs +++ b/docs/html/sdk/sdk_toc.cs @@ -145,8 +145,8 @@ class="new">new!