In this document
Android 2.2 is a minor platform release including user features, developer features, API changes, and bug fixes. For information on developer features and API changes, see the Framework API section.
For developers, the Android 2.2 platform is available as a downloadable component for the Android SDK. The downloadable platform includes an Android library and system image, as well as a set of emulator skins and more. To get started developing or testing against Android 2.2, use the Android SDK Manager to download the platform into your SDK.
For a list of new user features and platform highlights, see the Android 2.2 Platform Highlights document.
The Android 2.2 platform delivers an updated version of the framework API. The Android 2.2 API is assigned an integer identifier — 8 — that is stored in the system itself. This identifier, called the “API Level”, allows the system to correctly determine whether an application is compatible with the system, prior to installing the application.
To use APIs introduced in Android 2.2 in your application, you need to set the proper value, “8”, in the android:minSdkVersion attributes of the <uses-sdk> element in your application’s manifest.
For more information about how to use API Level, see the API Levels document.
Framework API Changes
The sections below provide information about changes made to the application framework API provided by the Android 2.2 platform.
App installation on external storage media
The Android platform now allows applications to request installation onto the device’s external storage media (such as the SD card), as an alternative to installation onto the device’s internal memory.
Application developers can express the preferred installation location for their applications by means of a new attribute of <manifest> in the manifest file, android:installLocation. The attribute supports three values: “internalOnly”. “preferExternal”. and “auto”. At install time, the system checks the value of android:installLocation and installs the application .apk according to the preferred location, if possible. If the application has requested external installation, the system installs it into a private, encrypted partition in the external media. Once an application .apk is installed externally, the system lets the user change the storage location of the .apk and move it onto the device’s internal memory if needed (and vice versa), through Manage Applications in the user settings.
By default, the system installs all applications onto the device’s internal memory, except for those that explicitly request external installation. This means that the system will always install legacy applications onto internal memory, since they do not have access to the android:installLocation attribute. However, it is possible to configure and compile a legacy application such that it is installed internally on older versions of the platform and externally on Android 2.2 and later platforms, if necessary.
Note that requesting installation onto the device’s external media is not suitable for all applications, particularly because the external media may be removable and unmounting/remounting may disrupt the user experience and system settings.
For more information about setting a preferred install location for your application, including a discussion of what types of applications should and should not request external installation, please read the App Install Location document.
The platform now provides a generalized backup service that applications can use to backup and restore user data, to ensure that users can maintain their data when switching devices or reinstalling the application. The Backup Manager handles the work of transporting the application data to and from the backup storage area in the cloud. The Backup Manager can store any type of data, from arbitrary data to files, and manages backup and restore operations in an atomic manner. For more information, see Data Backup .
- New OpenGL ES 2.0 APIs in android.opengl.GLES20 .
- New ETC1. ETC1Util. and ETC1Util.ETC1Texture classes and utility methods for using ETC1 for texture compression.
- New ImageFormat class.
- New YUV image format API to enable compression from YUV to JPEG and manipulation of YUV data.