API Level: 4
Android 1.6 is a minor platform release deployable to Android-powered handsets since October 2009. The platform includes new features for users and developers, as well as changes in the Android framework API.
For developers, a new release of the Android 1.6 platform is available as a downloadable component for the Android SDK. The platform — Android 1.6 r2 — includes a fully compliant Android library and system image, as well as a set of emulator skins, sample applications, and minor development updates. The downloadable platform is fully compliant (API Level 4) and includes no external libraries.
To get started developing or testing against the Android 1.6 platform, use the Android SDK and AVD Manager tool to download the latest Android 1.6 platform into your Android 1.6 or later SDK. For more information, see Exploring the SDK.
For a list of new user features and platform highlights, see the Android 1.6 Platform Highlights document.
The sections below provide notes about successive releases of the Android 1.6 platform component for the Android SDK, as denoted by revision number. To determine what revision(s) of the Android 1.6 platforms are installed in your SDK environment, refer to the "Installed Packages" listing in the Android SDK and AVD Manager.
Requires SDK Tools r6 or higher.
- Adds support for library projects in the Ant build system.
Requires SDK Tools r4 or higher.
- API related:
- Properly exposes CDMA-related constants in
- Properly exposes CDMA-related constants in
- System image:
- Fixes bug so that Bitmap's density is now propagated through Parcelable.
- Fixes NinePatchDrawable to properly scale its reported padding for compatibility mode.
- Fixes TextView to properly compute styled font metrics based on the screen density.
- Updates kernel to 2.6.29, to match kernel on commercially available Android-powered devices.
- Adds new Ant build system with support for Emma instrumentation projects (code coverage).
- Fixes emulator skins to properly emulate d-pad in landscape mode.
- Fixes density rendering in the layout editor in ADT.
Requires SDK Tools r3 or higher.
The Android 1.6 platform delivers an updated version of the framework API. The Android 1.6 API is assigned an integer identifier — 4 — 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 1.6 in your
application, you need to set the proper value, "4", in the
android:minSdkVersion attributes of the
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 the application framework API provided by the Android 1.6 platform.
- New classes in
android.view.animationto control the behavior of animations:
- New XML attribute
android:onClickto specify a View's View.OnClickListener from a layout file.
- New support for dealing with varying screen densities. Density information is associated with Bitmap and Canvas for performing the correct scaling. The framework will automatically scale bitmaps and nine-patches based on the density the resource was found under and the density of the screen, etc.
To use APIs introduced in Android 1.6 in your application, you need to
set the proper value, "4", in the attributes of the
element in your application's manifest.
- Applications can now expose relevant content to users as search
suggestions in the Quick Search Box, a new device-wide search capability that is
accessible from the home screen. To support this, the search framework adds new
attributes to the searchable metadata file. For complete information, see the
android.accessibilitypackage that includes classes for capturing accessibility events and forwarding them to an
AccessibilityServicepackage that lets your application track user events and provide visual, audible, or haptic feedback to the user.
gestureAPI for creating, recognizing, loading, and saving gestures.
android.speech.ttspackage provides classes for synthesizing speech from text, for immediate playback or to create a sound file.
- Classes in
android.graphicsnow support scaling for different screen densities.
SmsManagerand other classes for sending and receiving SMS messages.
DisplayMetricsfields for determining the density of the current device screen.
Android Manifest elements
<supports-screens>element lets you specify the device screen sizes that your application is designed and tested to support, where "size" is a combination of resolution and density. If your application is run on a device whose screen size is not specified in the
<supports-screen>element, the system displays the application in compatibility mode, which performs best-effort scaling of the application UI to match the resolution and density of the screen.
The attributes available for defining an application's screen support are:
smallScreen: Boolean value that indicates whether the application is designed to run on devices with small screens. Examples: QVGA low density; VGA high density.
normalScreens: Boolean value that indicates whether the application is designed to run on devices with normal screens. Examples: WQVGA low density; HVGA medium density; WVGA high density.
largeScreens: Boolean value that indicates whether the application is designed to run on devices with significantly larger screens, such that special care may be required on the application's part to make proper use of the screen area. Examples: VGA medium density; WVGA medium density.
anyDensity: Boolean value that indicates whether the application can accommodate any screen density.
resizable: Boolean value that indicates whether the application can expand its layout to fit slightly larger screens.
<uses-feature>element lets an application specify hardware (or other) features that it requires to function normally. When an application specifies such features, the system allows the application to be installed only on devices that offer the required features. The element supports these attributes:
name: The name of the feature required by the application. Currently accepts "android.hardware.camera" and "android.hardware.camera.autofocus" values, which specify that a camera and camera autofocus are required, respectively.
glEsVersion: Indicates the minimum version of OpenGL ES required.
- New attributes for the
targetSdkVersion: Indicates the API Level that the application is targeting. It is able to run on older versions (down to minSdkVersion), but was explicitly tested to work with the version specified here. Specifying this version allows the platform to disable compatibility code that is not required or enable newer features that are not available to older applications.
maxSdkVersion: Indicates the maximum API Level on which an application is designed to run. Important: Please read the
<uses-sdk>documentation before using this attribute.
CHANGE_WIFI_MULTICAST_STATE: Allows applications to enter Wi-Fi Multicast mode.
GLOBAL_SEARCH: Allows the global search system to access the data of a specified content provider.
INSTALL_LOCATION_PROVIDER: Allows an application to install a location provider into the Location Manager.
READ_HISTORY_BOOKMARKS: Allows an application to read (but not write) the user's browsing history and bookmarks.
WRITE_HISTORY_BOOKMARKS: Allows an application to write (but not read) the user's browsing history and bookmarks.
WRITE_EXTERNAL_STORAGE: Allows an application to write to external storage. Applications using API Level 3 and lower will be implicitly granted this permission (and this will be visible to the user); Applications using API Level 4 or higher must explicitly request this permission.
API differences report
For a detailed view of API changes in Android 1.6 (API Level 4), as compared to the previous version, see the API Differences Report.
The system image included in the downloadable platform provides these built-in applications:
The system image included in the downloadable platform provides a variety of built-in locales. In some cases, region-specific strings are available for the locales. In other cases, a default version of the language is used. The languages that are available in the Android 1.6 system image are listed below (with language_country/region locale descriptor).
Localized UI strings match the locales that are accessible through Settings.
The downloadable platform includes a set of emulator skins that you can use for modeling your application in different screen sizes and resolutions. The emulator skins are:
- QVGA (240x320, low density, small screen)
- HVGA (320x480, medium density, normal screen)
- WVGA800 (480x800, high density, normal screen)
- WVGA854 (480x854 high density, normal screen)
For more information about how to develop an application that displays and functions properly on all Android-powered devices, see Supporting Multiple Screens.