Android 3.2 Platform

Bookmark and Share

API Level: 13
Welcome to Android 3.2!
Android 3.2 is an incremental platform release that adds new capabilities for users and developers. The sections below provide an overview of the new features and developer APIs.
For developers, the Android 3.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. The downloadable platform includes no external libraries.
To get started developing or testing against Android 3.2, use the Android SDK Manager to download the platform into your SDK. For more information, see Adding SDK Components. If you are new to Android, download the SDK Starter Package (http://developer.android.com/sdk/index.html)first.
Reminder: If you've already published an Android application, please test and optimize your application on Android 3.2 as soon as possible. You should do so to be sure your application provides the best experience possible on the latest Android-powered devices. For information about what you can do, read Optimizing Apps for Android 3.x. ( http://developer.android.com/guide/practices/optimizing-for-3.0.html )

Revisions

To determine what revision of the Android 3.2 platform you have installed, refer to the "Installed Packages" listing in the Android SDK and AVD Manager.
 Android 3.2, Revision 1 (July 2011)

Initial release. SDK Tools r12 or higher is recommended.

Platform Highlights

New user features

  • Optimizations for a wider range of tablets
    Android 3.2 includes a variety of optimizations across the system to ensure a great user experience on a wider range of tablet devices.
  • Compatibility zoom for fixed-sized apps
    Android 3.2 introduces a new compatibility zoom mode that gives users a new way to view fixed-sized apps on larger devices. The new mode provides a pixel-scaled alternative to the standard UI stretching for apps that are not designed to run on larger screen sizes, such as on tablets. The new mode is accessible to users from a menu icon in the system bar, for apps that need compatibility support.
  • Media sync from SD card
    On devices that support an SD card, users can now load media files directly from the SD card to apps that use them. A system facility makes the files accessible to apps from the system media store.

New developer features

  • Extended API for managing screens support
    Android 3.2 introduces extensions to the platform's screen support API to give developers additional ways to manage application UI across the range of Android-powered devices. The API includes new resource qualifiers and new manifest attributes that give you more precise control over how your apps are displayed on different sizes, rather than relying on generalized size categories.
    To ensure the best possible display for fixed-sized apps and apps with limited support for various screen sizes, the platform also provides a new zoom compatibility mode that renders the UI on a smaller screen area, then scales it up to fill the space available on the display. For more information about the screen support API and the controls it provides, see the sections below.

API Overview

Screens Support APIs

Android 3.2 introduces new screens support APIs that give you more control over how their applications are displayed across different screen sizes. The API builds on the existing screens-support API, including the platform's generalized screen density model, but extends it with the ability to precisely target specific screen ranges by their dimensions, measured in density-independent pixel units (such as 600dp or 720dp wide), rather than by their generalized screen sizes (such as large or xlarge)
When designing an application's UI, you can still rely on the platform to provide density abstraction, which means that applications do not need to compensate for the differences in actual pixel density across devices. You can design the application UI according to the amount of horizontal or vertical space available. The platform expresses the amount of space available using three new characteristics: smallestWidthwidth, and height.
  • A screen's smallestWidth is its fundamental minimum size, measured in density-independent pixel ("dp") units. Of the screen's height or width, it is the shorter of the two. For a screen in portrait orientation, the smallestWidth is normally based on its width, while in landscape orientation it is based on its height. In all cases, the smallestWidth is derived from a fixed characteristic of the screen and the value does not change, regardless of orientation. The smallestWidth is important for applications because it represents the shortest possible width in which the application UI will need to be drawn, not including screen areas reserved by the system.
  • In constrast, a screen's width and height represent the current horizontal or vertical space available for application layout, measured in "dp" units, not including screen areas reserved by the system. The width and height of a screen change when the user switches orientation between landscape and portrait.
The new screens support API is designed to let you manage application UI according to the smallestWidth of the current screen. You can also manage the UI according to current width or height, as needed. For those purposes, the API provides these tools:
  • New resource qualifiers for targeting layouts and other resources to a minimum smallestWidth, width, or height, and
  • New manifest attributes, for specifying the app's maximum screen compatibility range
Additionally, applications can still query the system and manage UI and resource loading at runtime, as in the previous versions of the platform.
Since the new API lets you target screens more directly through smallestWidth, width, and height, it's helpful to understand the typical characteristics of the different screen types. The table below provides some examples, measured in "dp" units.
Table 1. Typical devices, with density and size in dp.
TypeDensity (generalized)Dimensions (dp)smallestWidth (dp)
Baseline phonemdpi320x480320
Small tablet/large phonemdpi480x800480
7-inch tabletmdpi600x1024600
10-inch tabletmdpi800x1280800
The sections below provide more information about the new screen qualifiers and manifest attributes. For complete information about how to use the screen support API, see Supporting Multiple Screens.

New resource qualifiers for screens support

The new resource qualifiers in Android 3.2 let you better target your layouts for ranges of screen sizes. Using the qualifiers, you can create resource configurations designed for a specific minimum smallestWidth, current width, or current height, measured in density-independent pixels.
The new qualifiers are:
  • swNNNdp — Specifies the minimum smallestWidth on which the resource should be used, measured in "dp" units. As mentioned above, a screen's smallestWidth is constant, regardless of orientation. Examples: sw320dpsw720dpsw720dp.
  • wNNNdp and hNNNdp — Specifies the minimum width or height on which the resource should be used, measured in "dp" units. As mentioned above, a screen's width and height are relative to the orientation of the screen and change whenever the orientation changes. Examples: w320dpw720dph1024dp.
You can also create multiple overlapping resource configurations if needed. For example, you could tag some resources for use on any screen wider than 480 dp, others for wider than 600 dp, and others for wider than 720 dp. When multiple resource configurations are qualified for a given screen, the system selects the configuration that is the closest match. For precise control over which resources are loaded on a given screen, you can tag resources with one qualifier or combine several new or existing qualifiers.
Based on the typical dimensions listed earlier, here are some examples of how you could use the new qualifiers:
res/layout/main_activity.xml   # For phones
res/layout-sw600dp/main_activity.xml   # For 7” tablets
res/layout-sw720dp/main_activity.xml   # For 10” tablets
res/layout-w600dp/main_activity.xml   # Multi-pane when enough width
res/layout-sw600dp-w720dp/main_activity.xml   # For large width
Older versions of the platform will ignore the new qualifiers, so you can mix them as needed to ensure that your app looks great on any device. Here are some examples:
res/layout/main_activity.xml   # For phones
res/layout-xlarge/main_activity.xml   # For pre-3.2 tablets
res/layout-sw600dp/main_activity.xml   # For 3.2 and up tablets
For complete information about how to use the new qualifiers, see Using new size qualifiers.

New manifest attributes for screen-size compatibility

The framework offers a new set of <supports-screens> manifest attributes that let you manage your app's support for different screen sizess. Specifically, you can specify the largest and smallest screens on which your app is designed to run, as well as the largest screen on which it is designed run without needing the system's new screen compatibility mode. Like the resource qualifiers described above, the new manifest attributes specify the range of screens that the application supports, as specified by the smallestWidth.
The new manifest attributes for screen support are:
  • android:compatibleWidthLimitDp="numDp" — This attribute lets you specify the maximum smallestWidth on which the application can run without needing compatibility mode. If the current screen is larger than the value specified, the system displays the application in normal mode but allows the user to optionally switch to compatibility mode through a setting in the system bar.
  • android:largestWidthLimitDp="numDp" — This attribute lets you specify the maximum smallestWidth on which the application is designed to run. If the current screen is larger than the value specified, the system forces the application into screen compatibility mode, to ensure best display on the current screen.
  • android:smallestWidthLimitDp="numDp" — This attribute lets you specify the minimum smallestWidth on which the application can run. If the current screen is smaller than the value specified, the system considers the application incompatible with the device, but does not prevent it from being installed and run.
Note: Android Market does not currently filter apps based on any of the attributes above. Support for filtering will be added in a later platform release. Applications that require filtering based on screen size can use the existing <supports-screens> attributes.
For complete information about how to use the new attributes, see Declaring screen size support.

Screen compatibility mode

Android 3.2 provides a new screen compatibility mode for applications explicitly declaring that they do not support screens as large as the one on which they are running. This new "zoom" mode is a pixel-scaled — it renders the application in a smaller screen area and then scales the pixels to fill the current screen.
By default, the system offers screen compatibility mode as an user option, for apps that require it. Users can turn the zoom mode on and off using a control available in the system bar.
Because the new screen compatibility mode may not be appropriate for all applications, the platform allows the application to disable it using manifest attributes. When disabled by the app, the system does not offer "zoom" compatibility mode as an option for users when the app is running.
Note: For important information about how to control compatibility mode in your applications, please review the New Mode for Apps on Large Screens article on the Android Developers Blog.

New screen density for 720p televisions and similar devices

To meet the needs of applications running on 720p televisions or similar with moderate density screens, Android 3.2 introduces a new generalized density, tvdpi, with an approximate dpi of 213. Applications can query for the new density in densityDpi and can use the new tvdpi qualifier to tag resources for televisions and similar devices. For example:
res/drawable-tvdpi/my_icon.png   # Bitmap for tv density
In general, applications should not need to work with this density. For situations where output is needed for a 720p screen, the UI elements can be scaled automatically by the platform.

UI framework

  • Fragments
    • New Fragment.SavedState class holds the state information retrieved from a fragment instance through saveFragmentInstanceState().
    • New method saveFragmentInstanceState() saves the current instance state of the given Fragment. The state can be used later when creating a new instance of the Fragment that matches the current state.
    • New method setInitialSavedState() sets the initial saved state for a Fragment when first constructed.
    • New onViewCreated() callback method notifies the Fragment that onCreateView() has returned, but before any saved state has been restored in to the View.
    • isDetached() method determines whether the Fragment has been explicitly detached from the UI.
    • New attach() and detach() methods let an application re-attach or detach fragments in the UI.
    • A new setCustomAnimations() overload method lets you set specific animation resources to run for enter/exit operations and specifically when popping the back stack. The existing implementation does not account for the different behavior of fragments when popping the back stack.
  • Screen size information in ActivityInfo and ApplicationInfo
    • ActivityInfo adds CONFIG_SCREEN_SIZE and CONFIG_SMALLEST_SCREEN_SIZE as bit masks in configChanges. The bits indicate whether an Activity can itself handle the screen size and smallest screen size.
    • ApplicationInfo adds largestWidthLimitDpcompatibleWidthLimitDp, and requiresSmallestWidthDp fields, derived from the corresponding <supports-screens> attributes in the application manifest file.
  • Helpers for getting display size from WindowManager
    • New methods getSize() and getRectSize() let applications get the raw size of the display.
  • New public "holographic" styles
    • The platform now exposes a variety of public "holographic" styles for text, actionbar widgets and tabs, and more. See R.style for a full list.
  • LocalActivityManagerActivityGroup, and LocalActivityManager are now deprecated
    • New applications should use Fragments instead of these classes. To continue to run on older versions of the platform, you can use the v4 Support Library (compatibility library), available in the Android SDK. The v4 Support Library provides a version of the Fragment API that is compatible down to Android 1.6 (API level 4).
    • For apps developing against Android 3.0 (API level 11) or higher, tabs are typically presented in the UI using the new ActionBar.newTab() and related APIs for placing tabs within their action bar area.

Media framework

  • Applications that use the platform's media provider (MediaStore) can now read media data directly from the removeable SD card, where supported by the device. Applications can also interact with the SD card files directly, using the MTP API.

Graphics

  • Parcelable utilities in Point and PointF
    • Point and PointF classes now include the Parcelable interface and utility methods describeContents()readFromParcel(), and writeToParcel().

IME framework

  • New getModifiers() method for retrieving the current state of the modifier keys.

USB framework

  • New getRawDescriptors() method for retrieving the raw USB descriptors for the device. You can use the method to access descriptors not supported directly via the higher level APIs.

Network

  • Network type constants
    • ConnectivityManager adds the constants TYPE_ETHERNET and TYPE_BLUETOOTH.

Telephony

  • New NETWORK_TYPE_HSPAP network type constant.

Core utilities

  • Parcelable utilities
    • New interface Parcelable.ClassLoaderCreator allows the application to receive the ClassLoader in which the object is being created.
    • New adoptFddup(), and fromFd() for managing ParcelFileDescriptor objects.
  • Binder and IBinder
    • New method dumpAsync() in Binder and IBinder let applications dump to a specified file, ensuring that the target executes asynchronously.
    • New IBinder protocol transaction code TWEET_TRANSACTION lets applications send a tweet to the target object.

New feature constants

The platform adds new hardware feature constants that you can declare in their application manifests, to inform external entities such as Android Market of required hardware and software capabilities. You declare these and other feature constants in <uses-feature> manifest elements.
Android Market filters applications based on their <uses-feature> attributes, to ensure that they are available only to devices on which their requirements are met.
  • Feature constants for landscape or portrait requirements
    Android 3.2 introduces new feature constants that let applications specify whether they require display in landscape orientation, portrait orientation, or both. Declaring these constants indicates that the application must not be installed on a device that doesn't offer the associated orientation. Conversely, if one or both of the constants are not declared, it indicates that the application does not have a preference for the undeclared orientations and may be installed on a device that doesn't offer them.
    • android.hardware.screen.landscape — The application requires display in landscape orientation.
    • android.hardware.screen.portrait — The application requires display in portrait orientation.
    A typical application that functions properly in both landscape and portrait orientations would not normally need to declare an orientation requirement. Rather, an application designed primarily for one orientation, such as an app designed for a television, could declare one of the constants to ensure that it isn't available to devices that don't provide that orientation.
    If any of activities declared in the manifest request that they run in a specific orientation, using the android:screenOrientation attribute, then this also declares that the application requires that orientation.
  • Other feature constants
    • android.hardware.faketouch.multitouch.distinct — The application requires support for emulated mulitouch input with distinct tracking of two or more points.
    • android.hardware.faketouch.multitouch.jazzhand — The application requires support for emulated mulitouch input with distinct tracking of five or more points.

API Differences Report

For a detailed view of all API changes in Android 3.2 (API Level 13), see the API Differences Report.

API Level

The Android 3.2 platform delivers an updated version of the framework API. The Android 3.2 API is assigned an integer identifier — 13 — 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 3.2 in your application, you need compile the application against the Android library that is provided in the Android 3.2 SDK platform. Depending on your needs, you might also need to add an android:minSdkVersion="13" attribute to the <uses-sdk> element in the application's manifest.
For more information about how to use API Level, see the API Levels document.

Built-in Applications

The system image included in the downloadable platform provides these built-in applications:
  • API Demos
  • Browser
  • Calculator
  • Camera
  • Clock
  • Contacts
  • Custom Locale
  • Dev Tools
  • Downloads
  • Email
  • Gallery
  • Gestures Builder
  • Messaging
  • Music
  • Search
  • Settings
  • Spare Parts
  • Speech Recorder
  • Widget Preview

Locales

The system image included in the downloadable SDK 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 3.0 system image are listed below (with language_country/region locale descriptor).
  • Arabic, Egypt (ar_EG)
  • Arabic, Israel (ar_IL)
  • Bulgarian, Bulgaria (bg_BG)
  • Catalan, Spain (ca_ES)
  • Czech, Czech Republic (cs_CZ)
  • Danish, Denmark(da_DK)
  • German, Austria (de_AT)
  • German, Switzerland (de_CH)
  • German, Germany (de_DE)
  • German, Liechtenstein (de_LI)
  • Greek, Greece (el_GR)
  • English, Australia (en_AU)
  • English, Canada (en_CA)
  • English, Britain (en_GB)
  • English, Ireland (en_IE)
  • English, India (en_IN)
  • English, New Zealand (en_NZ)
  • English, Singapore(en_SG)
  • English, US (en_US)
  • English, Zimbabwe (en_ZA)
  • Spanish (es_ES)
  • Spanish, US (es_US)
  • Finnish, Finland (fi_FI)
  • French, Belgium (fr_BE)
  • French, Canada (fr_CA)
  • French, Switzerland (fr_CH)
  • French, France (fr_FR)
  • Hebrew, Israel (he_IL)
  • Hindi, India (hi_IN)

  • Croatian, Croatia (hr_HR)

  • Hungarian, Hungary (hu_HU)

  • Indonesian, Indonesia (id_ID)

  • Italian, Switzerland (it_CH)

  • Italian, Italy (it_IT)

  • Japanese (ja_JP)

  • Korean (ko_KR)

  • Lithuanian, Lithuania (lt_LT)

  • Latvian, Latvia (lv_LV)

  • Norwegian bokmål, Norway (nb_NO)

  • Dutch, Belgium (nl_BE)

  • Dutch, Netherlands (nl_NL)

  • Polish (pl_PL)

  • Portuguese, Brazil (pt_BR)

  • Portuguese, Portugal (pt_PT)

  • Romanian, Romania (ro_RO)

  • Russian (ru_RU)

  • Slovak, Slovakia (sk_SK)

  • Slovenian, Slovenia (sl_SI)

  • Serbian (sr_RS)

  • Swedish, Sweden (sv_SE)

  • Thai, Thailand (th_TH)

  • Tagalog, Philippines (tl_PH)

  • Turkish, Turkey (tr_TR)

  • Ukrainian, Ukraine (uk_UA)

  • Vietnamese, Vietnam (vi_VN)

  • Chinese, PRC (zh_CN)

  • Chinese, Taiwan (zh_TW)

  • Note: The Android platform may support more locales than are included in the SDK system image. All of the supported locales are available in the Android Open Source Project.

    Emulator Skins

    The downloadable platform includes the following emulator skin:
    • WXGA (1280x800, medium density, xlarge screen)
    For more information about how to develop an application that displays and functions properly on all Android-powered devices, see Supporting Multiple Screens.

    { 0 comments... Views All / Send Comment! }

    Post a Comment