diff --git a/docs/html/preview/api-overview.jd b/docs/html/preview/api-overview.jd index 2fa029fb90292..8ec24708511d0 100644 --- a/docs/html/preview/api-overview.jd +++ b/docs/html/preview/api-overview.jd @@ -18,7 +18,6 @@ sdk.platform.apiLevel=20
The L Developer Preview gives you an advance look at the upcoming release for -the Android platform, -which offers new features for users and app developers. This document provides -an introduction to the most notable APIs.
+The L Developer Preview gives you an advance look at the upcoming release +for the Android platform, which offers new features for users and app +developers. This document provides an introduction to the most notable APIs.
-The L Developer Preview is intended for developer early adopters and -testers. If you are interested in influencing the direction of the -Android framework, give the L -Developer Preview a try and send us your feedback!
+The L Developer Preview is intended for developer early +adopters and testers. If you are interested in +influencing the direction of the Android framework, +give the L Developer Preview a +try and send us your feedback!
Caution: Do not not publish apps that use the L Developer Preview to the Google Play store.
@@ -128,8 +128,8 @@ reference.The 4.4 release introduced a new, experimental Android runtime, ART. Under -4.4, ART was optional, and the default runtime remained Dalvik. With the L Developer Preview, ART is -now the default runtime.
+4.4, ART was optional, and the default runtime remained Dalvik. With the L +Developer Preview, ART is now the default runtime.For an overview of ART's new features, see Introducing @@ -163,6 +163,15 @@ Behavior on the Android Runtime (ART). Pay particular attention if:
backgrounds to match the new material design widgets. Make sure that all your notifications look right with the new color scheme: +
+ + Figure 1. Fullscreen activity showing a heads-up notification +
+If you are currently adding sounds and vibrations to your notifications by using the {@link android.media.Ringtone}, {@link android.media.MediaPlayer}, or {@link android.os.Vibrator} classes, remove this code so that -the system can present notifications correctly in Do Not Disturb mode. -Instead, use the {@link android.app.Notification.Builder} methods instead to add -sounds and vibration.
+the system can present notifications correctly in Do Not Disturb mode. Instead, use the {@link android.app.Notification.Builder} methods instead to add sounds and vibration. + +Notifications now appear in a small floating window +(also called a heads-up notification) when the device is active +(that is, the device is unlocked and its screen is on). These notifications +appear similar to the compact form of your notification, except that the +heads-up notification also shows action buttons. Users can act on, or dismiss, +a heads-up notification without leaving the current app.
+ +Examples of conditions that may trigger heads-up notifications include:
+ +If your app implements notifications under those scenarios, make sure that +heads-up notifications are presented correctly.
Lockscreens in the L Developer Preview do not show transport controls for your -{@link android.media.RemoteControlClient}. Instead, your app can provide -media playback control from the lockscreen through a media notification. This +
Lockscreens in the L Developer Preview do not show transport controls for +your {@link android.media.RemoteControlClient}. Instead, your app can provide +media playback control from the lockscreen through a notification. This gives your app more control over the presentation of media buttons, while providing a consistent experience for users across the lockscreen and unlocked device.
+The L Developer Preview introduces a new {@code android.app.Notification.MediaStyle} template which is recommended for this purpose. {@code MediaStyle} converts notification actions that you added with {@link android.app.Notification.Builder#addAction(int, java.lang.CharSequence, android.app.PendingIntent) Notification.Builder.addAction()} into compact buttons embedded in your app's media playback notifications.
+ +If you are using the new +{@code android.media.session.MediaSession} class (see Media Playback Control below), attach your session +token with {@code Notification.MediaStyle.setMediaToken()} to inform the +system that this notification controls an ongoing media session.
+Call {@code Notification.Builder.setVisibility(Notification.VISIBILITY_PUBLIC)} to mark a -notification as safe to display on the lockscreen (even when the lockscreen is -secured with a PIN, pattern, or password). For more information, see +notification as safe to show atop any lockscreen (secure or otherwise). For more information, see Lockscreen Notifications.
-Notifications now appear in a small floating window if all these conditions -are met:
- -If your app implements fullscreen activities, make sure that -these heads-up notifications are presented correctly.
-With the introduction of the new concurrent documents and activities tasks feature in the upcoming @@ -230,7 +248,6 @@ information.
The upcoming release adds support for Android's new material design style. You can create apps with material design that are visually dynamic and have UI element transitions @@ -262,16 +279,17 @@ values:
When {@code VISIBILITY_PRIVATE} is set, you can also provide a redacted +version of the notification content that hides personal details. For example, +an SMS app might display a notification that shows "You have 3 new text messages." but hides the message content and senders. To provide this alternative notification, first create the replacement notification using {@link android.app.Notification.Builder}. When you create the private notification object, attach +the replacement notification to it through the {@code Notification.Builder.setPublicVersion()} method.
+The L Developer Preview introduces a new Do Not Disturb mode. When @@ -295,7 +313,7 @@ make sure Do Not Disturb mode handles them properly. For example, if your app is an alarm clock, you can tag the notification as an alarm so it will wake the user up even if the device is in Do Not Disturb mode. For more information, see Notifications metadata.
+href="#NotificationsMetadata">Notifications metadata.The L Developer Preview uses metadata associated with your app notifications @@ -483,10 +501,9 @@ knows about your playback and can extract and show album art.
The L Developer Preview extends the Storage Access Framework to let users -select an entire directory, rather than individual files, to give your app -read/write access to media files. When a directory is selected, your app also -has access to all its child directories and content.
+The L Developer Preview extends the Storage Access Framework to let users select an entire directory, rather than individual files, to +give your app read/write access to media files. When a directory is selected, +your app also has access to all its child directories and content.
To get the absolute paths to directories on external storage devices where applications can store media files, call the new @@ -498,6 +515,13 @@ considers to be a permanent part of the device, and includes emulated external storage and physical media slots such as SD cards in battery compartments.
+You can bring up a system UI to allow the user to pick a directory subtree. +To do so, send {@code android.intent.action.OPEN_DOCUMENT_TREE} in an +{@link android.content.Intent}. If the call is successful, the system displays +the {@link android.provider.DocumentsProvider} instances installed on the +device for the user to select. When the user selects a directory from this UI, +the system returns a URI representing the selected directory tree.
+If you want to access a document in an existing directory, call the {@code android.provider.DocumentsContract.buildDocumentViaUri()} method. Pass the method a URI representing the path to the parent directory, and the @@ -591,9 +615,9 @@ API that lets you optimize battery life by defining jobs for the system to run asynchronously at a later time or under specified conditions (such as when the device is charging). This is useful in such situations as:
For example, you can add code like this to run your task on an @@ -627,7 +652,7 @@ JobScheduler jobScheduler = jobScheduler.schedule(uploadTask); -
The L Developer Preview provides several new developer tools and APIs to help you better measure and understand your app's power usage.
@@ -668,9 +693,9 @@ in {@code <sdk>/tools}.
+ id="figure2" />
- Figure 1.HTML visualization generated by the Battery + Figure 2.HTML visualization generated by the Battery Historian tool.
@@ -701,9 +726,9 @@ $ historian.par [-p powerfile] bugreport.txt > out.html
+ alt="" width="360" height="572" id="figure3" />
- Figure 2. Launcher screen showing managed apps (marked with + Figure 3. Launcher screen showing managed apps (marked with a lock badge)
The L Developer Preview introduces a new Lock-to-App mode that +lets you temporarily restrict users from leaving your app or being interrupted +by notifications. Once your app activates this mode, users will not be able to +see notifications, access other apps, or return to the Home screen, until your +app exits the mode.
+ +To prevent unauthorized usage, the device on which you want to activate +this mode must have managed profiles or must be fully controlled by a device administrator (see Managed Provisioning for more information). Furthermore, the device or managed profile owner must +authorize apps to use this mode by calling {@code android.app.admin.DevicePolicyManager.setLockTaskComponents()}.
+ +Before activating this mode in your app, verify that your activity is authorized by calling {@code DevicePolicyManager.isLockTaskPermitted()}.
+ +To activate Lock-to-App mode, call +{@code android.app.Activity.startLockTask()} from your authorized activity.
+ +When Lock-to-App mode is active, the following behavior takes +effect:
+ +The device will remain in this mode until an authorized activity calls +{@code Activity.stopLockTask()}. +
<uses-feature android:name="android.software.leanback"
android:required="true" />
diff --git a/docs/html/preview/images/hun-example.png b/docs/html/preview/images/hun-example.png
new file mode 100644
index 0000000000000..9613a928ec715
Binary files /dev/null and b/docs/html/preview/images/hun-example.png differ
diff --git a/docs/html/preview/images/hun-example@2x.png b/docs/html/preview/images/hun-example@2x.png
new file mode 100644
index 0000000000000..3cb8f5b3dea03
Binary files /dev/null and b/docs/html/preview/images/hun-example@2x.png differ
diff --git a/docs/html/preview/images/managed_apps_launcher@2.png b/docs/html/preview/images/managed_apps_launcher@2x.png
similarity index 100%
rename from docs/html/preview/images/managed_apps_launcher@2.png
rename to docs/html/preview/images/managed_apps_launcher@2x.png