From d41ff8e1a4ae67ff01c2bb427949ff317871f7db Mon Sep 17 00:00:00 2001
From: Scott Main In this document
+
API Level: Honeycomb
For developers, the Android 3.0 preview 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.
+Android SDK. + +Note: Read the Getting Started guide for important information +about setting up your development environment and limitiations of the Android 3.0 preview.
+ + + @@ -43,8 +50,6 @@ set of emulator skins and more. The downloadable platform includes no external l including new features and changes in the framework API since the previous version. - -A fragment is a new framework component that allows you to separate distinct elements of an @@ -185,98 +190,63 @@ href="{@docRoot}resources/samples/NotePad/index.html">NotePad sample applica
New APIs now facilitate the ability for your application to implement drag and drop functionality in the UI.
-To drag a {@link android.view.View} in your activity, call {@link android.view.View#startDrag -startDrag()} on the object, providing a {@link android.content.ClipData} object that represents the -information to drag, a {@link android.view.View.DragShadowBuilder} to facilitate the "shadow" that -the user sees while dragging, and an {@link java.lang.Object} that can share information about the -drag object with views that may receive the object. However,
+To begin dragging content in your activity, call {@link android.view.View#startDrag startDrag()} +on a {@link android.view.View}, providing a {@link android.content.ClipData} object that represents +the information to drag, a {@link android.view.View.DragShadowBuilder} to facilitate the "shadow" +that the user sees while dragging, and an {@link java.lang.Object} that can share information about +the drag object with views that may receive the object.
To accept a drag object (receive the "drop") in a {@link android.view.View}, register the view with an {@link android.view.View.OnDragListener} by calling {@link android.view.View#setOnDragListener setOnDragListener()}. When a drag event occurs on the view, the system calls {@link android.view.View.OnDragListener#onDrag onDrag()} for the {@link -android.view.View.OnDragListener}, which receives a {@link android.view.DragEvent} describing -the type of event has occurred (such as "drag started", "drag ended", and "drop"). The receiving -view can inquire the event type delivered to {@link -android.view.View#onDragEvent onDragEvent()} by calling {@link -android.view.DragEvent#getAction getAction()} on the {@link android.view.DragEvent}.
- -Although a drag event may carry a {@link android.content.ClipData} object, drag and drop does -not depend on the clipboard. The data being dragged is sent to the system as {@link -android.content.ClipData} and the system sends it to {@link android.view.View} objects in the -{@link android.view.DragEvent}. A drag and drop operation should never put the dragged data on the -clipboard.
- - - -New {@link android.widget.AbsListView#CHOICE_MODE_MULTIPLE_MODAL} mode for {@link -android.widget.AbsListView#setChoiceMode setChoiceMode()} allows for selecting multiple items -from a {@link android.widget.ListView} and {@link android.widget.GridView}.
- -To enable multiple-choice selection, call {@link -android.widget.AbsListView#setChoiceMode setChoiceMode(CHOICE_MODE_MULTIPLE_MODAL)} and register a -{@link android.widget.AbsListView.MultiChoiceModeListener} with {@link -android.widget.AbsListView#setMultiChoiceModeListener setMultiChoiceModeListener()}.
- -When the user performs a long-press on an item, the Action Bar switches to the Multi-choice -Action Mode. The system notifies the {@link android.widget.AbsListView.MultiChoiceModeListener} -when items are selected by calling {@link -android.widget.AbsListView.MultiChoiceModeListener#onItemCheckedStateChanged -onItemCheckedStateChanged()}.
- -For an example of multiple-choice selection, see the List15.java -class in the API Demos sample application.
- - - +android.view.View.OnDragListener}, which receives a {@link android.view.DragEvent} describing the +type of event has occurred (such as "drag started", "drag ended", and "drop"). During a drag +operation, there is a stream of drag events, so the system calls {@link +android.view.View.OnDragListener#onDrag onDrag()} repeatedly on the view. The receiving view can +inquire the event type delivered to {@link android.view.View#onDragEvent onDragEvent()} by calling +{@link android.view.DragEvent#getAction getAction()} on the {@link android.view.DragEvent}. -New framework APIs facilitate asynchronous loading of data using the {@link -android.content.Loader} class. You can use it in combination with UI components such as views and -fragments to dynamically load data from background threads. The {@link -android.content.CursorLoader} subclass is specially designed to help do so for data queried from -a {@link android.content.ContentResolver}.
+Although a drag event may carry a {@link android.content.ClipData} object, this is not related +to the system clipboard. The data being dragged is passed as a {@link +android.content.ClipData} object to {@link android.view.View#startDrag startDrag()} and the system +sends it to the receiving {@link android.view.View} in the {@link android.view.DragEvent} sent to +{@link android.view.View.OnDragListener#onDrag onDrag()}. A drag and drop operation should never +put the dragged data in the global system clipboard.
-App widgets can now be more interactive with scrolling list views, grid views, view flippers, and a new 3D stack widget.
-Android 3.0 supports several new widget classes for App Widgets, including:
-Android 3.0 supports several new widget classes for app widgets, including: {@link +android.widget.GridView}, {@link android.widget.ListView}, {@link android.widget.StackView}, {@link +android.widget.ViewFlipper}, and {@link android.widget.AdapterViewFlipper}.
You can use the new {@link android.widget.RemoteViewsService} to populate the new remote collection views ({@link android.widget.GridView}, {@link android.widget.ListView}, and {@link android.widget.StackView}).
-You can also use two new {@link android.appwidget.AppWidgetProviderInfo} fields. The {@link +
{@link android.appwidget.AppWidgetProviderInfo} also supports two new fields: {@link +android.appwidget.AppWidgetProviderInfo#autoAdvanceViewId} and {@link +android.appwidget.AppWidgetProviderInfo#previewImage}. The {@link android.appwidget.AppWidgetProviderInfo#autoAdvanceViewId} field lets you specify the view ID of the app widget subview, which is auto-advanced by the app widget’s host. The {@link android.appwidget.AppWidgetProviderInfo#previewImage} field specifies a preview of what the App Widget looks like and is shown to the user from the widget picker. If this field is not supplied, the app widget's icon is used for the preview.
-Android also provides a new widget preview tool (WidgetPreview), located in the SDK tools. The -tool lets you take a screenshot of your app widget, which you can use to populate the customization -tray.
+Android also provides a new widget preview tool (WidgetPreview), located in the SDK tools, to +take a screenshot of your app widget, which you can use when specifying the {@link +android.appwidget.AppWidgetProviderInfo#previewImage} field.
-The {@link android.app.Notification} APIs have been extended to support more content-rich status bar notifications, plus a new {@link android.app.Notification.Builder} class allows you to easily @@ -296,9 +266,34 @@ android.app.PendingIntent}s, for more interactive notification widgets -
New framework APIs facilitate asynchronous loading of data using the {@link +android.content.Loader} class. You can use it in combination with UI components such as views and +fragments to dynamically load data from background threads. The {@link +android.content.CursorLoader} subclass is specially designed to help do so for data queried from +a {@link android.content.ContentResolver}.
+ + + + + +Android now includes APIs for applications to verify the state of connected Bluetooth A2DP and +headset profile devices. You can initialize the respective {@link +android.bluetooth.BluetoothProfile} by calling {@link +android.bluetooth.BluetoothAdapter#getProfileProxy getProfileProxy()} with either the {@link +android.bluetooth.BluetoothProfile#A2DP} or {@link android.bluetooth.BluetoothProfile#HEADSET} +profile constant and a {@link android.bluetooth.BluetoothProfile.ServiceListener} to receive +callbacks when the client is connected or disconnected.
+ + + + +An all new flexible animation framework that allows you to animate the properties of any object +
An all new flexible animation framework allows you to animate the properties of any object (View, Drawable, Fragment, Object, anything). It allows you to define many aspects of an animation, such as:
Additionally, the {@link android.animation.LayoutTransition} class enables automatic transition +animations for changes you make to your activity layout. To enable transitions for a {@link +android.view.ViewGroup}, create a {@link android.animation.LayoutTransition} object and set it on +any {@link android.view.ViewGroup} by calling {@link +android.view.ViewGroup#setLayoutTransition setLayoutTransition()}. This causes default +animations to run whenever items are added to or removed from the group. To specify custom +animations, call {@link android.animation.LayoutTransition#setAnimator setAnimator()} on the {@link +android.animation.LayoutTransition} to provide a custom {@link android.animation.Animator}, +such as a {@link android.animation.ValueAnimator} or {@link android.animation.ObjectAnimator} +discussed above.
For more information, see the Animation developer guide.
@@ -328,73 +337,67 @@ href="{@docRoot}guide/topics/graphics/animation.html">Animation developer gu - -Base class for an {@link android.widget.AdapterView} that performs animations when switching -between its views.
Simple {@link android.widget.ViewAnimator} that animates between two or more views that have -been added to it. Only one child is shown at a time. If requested, it can automatically flip between -each child at a regular interval.
Allows users to select dates from a calendar and you can configure the range of dates -available. A user can select a date by tapping on it and can scroll and fling -the calendar to a desired date.
Anchors itself to a host view and displays a list of choices, such as for a list of -suggestions when typing into an {@link android.widget.EditText} view.
Enables the user to select a number from a predefined range. The widget presents an -input field and up and down buttons for selecting a number. Touching the input field shows a -scroll wheel that allows the user to scroll through values or touch again to directly edit the -current value. It also allows you to map from positions to strings, so that -the corresponding string is displayed instead of the position index.
Displays a {@link android.view.Menu} in a modal popup window that's anchored to a view. The popup -appears below the anchor view if there is room, or above it if there is not. If the IME (soft -keyboard) is visible, the popup does not overlap it until it is touched.
Provides a search box that works in conjunction with a search provider (in the same manner as -the traditional search dialog). It -also displays recent query suggestions or custom suggestions as configured by the search -provider. This widget is particularly useful for offering search in the Action Bar.
A view that displays its children in a 3D stack and allows users to discretely swipe through the -children.
New {@link android.widget.AbsListView#CHOICE_MODE_MULTIPLE_MODAL} mode for {@link +android.widget.AbsListView#setChoiceMode setChoiceMode()} allows for selecting multiple items +from a {@link android.widget.ListView} and {@link android.widget.GridView}.
-Android 3.0 offers an updated set of UI widgets that developers can use to quickly add new types -of content to their applications. The new UI widgets are redesigned for use on larger screens such -as tablets and incorporate the new holographic UI theme. Several new widget types are available, -including a 3D stack, search box, a date/time picker, number picker, stack, calendar View etc. -SearchView, PopupMenu, and others. Most of the redesigned widgets can now be used as remote views in -homescreen widgets. Applications written for earlier versions can inherit the new widget designs and -themes.
+To enable multiple-choice selection, call {@link +android.widget.AbsListView#setChoiceMode setChoiceMode(CHOICE_MODE_MULTIPLE_MODAL)} and register a +{@link android.widget.AbsListView.MultiChoiceModeListener MultiChoiceModeListener} with {@link +android.widget.AbsListView#setMultiChoiceModeListener setMultiChoiceModeListener()}.
+When the user performs a long-press on an item, the Action Bar switches to the Multi-choice +Action Mode. The system notifies the {@link android.widget.AbsListView.MultiChoiceModeListener +MultiChoiceModeListener} when items are selected by calling {@link +android.widget.AbsListView.MultiChoiceModeListener#onItemCheckedStateChanged +onItemCheckedStateChanged()}.
+For an example of multiple-choice selection, see the List15. +java +class in the API Demos sample application.
+ + +New APIs allow you to easily apply 2D and 3D transformations to {@link +android.view.View}s in your activity layout, using a set of object properties that define the view's +layout position, orientation, transparency and more.
+New methods to set properties include: {@link android.view.View#setAlpha setAlpha()}, {@link +android.view.View#setBottom setBottom()}, {@link android.view.View#setLeft setLeft()}, {@link +android.view.View#setRight setRight()}, {@link android.view.View#setBottom setBottom()}, {@link +android.view.View#setPivotX setPivotX()}, {@link android.view.View#setPivotY setPivotY()}, {@link +android.view.View#setRotationX setRotationX()}, {@link android.view.View#setRotationY +setRotationY()}, {@link android.view.View#setScaleX setScaleX()}, {@link android.view.View#setScaleY +setScaleY()}, {@link android.view.View#setAlpha setAlpha()}, and others.
+ +Some methods also have a corresponding XML attribute that you can specify in your layout +file. Available attributes include: {@code translationX}, {@code translationY}, {@code rotation}, +{@code rotationX}, {@code rotationY}, {@code scaleX}, {@code scaleY}, {@code transformPivotX}, +{@code transformPivotY}, and {@code alpha}.
+ +Using some of these new properties in combination with the new animation framework (discussed +previously), you can easily create some fancy animations to your views. For example, to rotate a +view on its y-axis, supply {@link android.animation.ObjectAnimator} with the {@link +android.view.View}, the "rotationY" property, and the values to use:
++ObjectAnimator animator = ObjectAnimator.ofFloat(myView, "rotationY", 0, 360); +animator.setDuration(2000); +animator.start(); ++
The standard system widgets and overall look have been redesigned for use on larger screens +
The standard system widgets and overall look have been redesigned for use on larger screens such as tablets and incorporate the new holographic UI theme. These style changes are applied using the standard style and theme system. Any application that targets the Android 3.0 platform inherit the holographic theme by default. @@ -404,19 +407,63 @@ theme, unless you update your styles to inherit them.
To apply the holographic theme to individual activities or to inherit them in your own theme definitions, you can use one of several new {@link android.R.style#Theme_Holo Theme.Holo} themes.
+Base class for an {@link android.widget.AdapterView} that performs animations when switching + between its views.
Simple {@link android.widget.ViewAnimator} that animates between two or more views that have + been added to it. Only one child is shown at a time. If requested, it can automatically flip + between + each child at a regular interval.
Allows users to select dates from a calendar and you can configure the range of dates + available. A user can select a date by tapping on it and can scroll and fling + the calendar to a desired date.
Anchors itself to a host view and displays a list of choices, such as for a list of + suggestions when typing into an {@link android.widget.EditText} view.
Enables the user to select a number from a predefined range. The widget presents an + input field and up and down buttons for selecting a number. Touching the input field shows a + scroll wheel that allows the user to scroll through values or touch again to directly edit the + current value. It also allows you to map from positions to strings, so that + the corresponding string is displayed instead of the position index.
Displays a {@link android.view.Menu} in a modal popup window that's anchored to a view. The + popup + appears below the anchor view if there is room, or above it if there is not. If the IME (soft + keyboard) is visible, the popup does not overlap it until it is touched.
Provides a search box that works in conjunction with a search provider (in the same manner as + the traditional search dialog). +It + also displays recent query suggestions or custom suggestions as configured by the search + provider. This widget is particularly useful for offering search in the Action Bar.
A view that displays its children in a 3D stack and allows users to discretely swipe through + the + children.
Android now includes APIs for applications to verify the state of connected Bluetooth A2DP and -headset profile devices. You can initialize the respective {@link -android.bluetooth.BluetoothProfile} by calling {@link -android.bluetooth.BluetoothAdapter#getProfileProxy getProfileProxy()} with either the {@link -android.bluetooth.BluetoothProfile#A2DP} or {@link android.bluetooth.BluetoothProfile#HEADSET} -profile constant and a {@link android.bluetooth.BluetoothProfile.ServiceListener} to receive -callbacks when the client is connected or disconnected.
-