diff --git a/docs/html/preview/api-overview.jd b/docs/html/preview/api-overview.jd index 40618a34fb35f..2fa029fb90292 100644 --- a/docs/html/preview/api-overview.jd +++ b/docs/html/preview/api-overview.jd @@ -15,7 +15,9 @@ sdk.platform.apiLevel=20
  1. Important Behavior Changes
      +
    1. New Android Runtime (ART)
    2. If your app implements notifications...
    3. +
    4. If your app uses RemoteControlClient...
    5. If your app uses fullScreenIntent...
    6. If your app uses ActivityManager.getRecentTasks()...
    @@ -23,9 +25,10 @@ sdk.platform.apiLevel=20
  2. User Interface
    1. Material design support
    2. +
    3. Do Not Disturb mode
    4. Lockscreen notifications
    5. Notifications metadata
    6. -
    7. Concurrent documents and activities in Recents screen
    8. +
    9. Concurrent documents and activities in the Recents screen
    10. WebView updates
  3. @@ -41,7 +44,7 @@ sdk.platform.apiLevel=20
  4. Multimedia
      -
    1. Camera V2
    2. +
    3. Camera v2 API
    4. Audio playback
    5. Media playback control
    @@ -55,7 +58,7 @@ sdk.platform.apiLevel=20
    1. Dynamic network selection and seamless handoff
    2. Bluetooth broadcasting
    3. -
    4. NFC enhancements for payments
    5. +
    6. NFC enhancements
  5. Power Efficiency @@ -71,7 +74,7 @@ sdk.platform.apiLevel=20
  6. Printing Framework
      -
    1. PDF rendering
    2. +
    3. Render PDF as bitmap
  7. Testing & Accessibility @@ -96,73 +99,130 @@ Differences Report »
  8. -

    L is an upcoming release for the Android platform -that offers new features for users and app developers. This document provides -an introduction to the most notable new 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.

    -

    L is currently available as a developer preview intended -for 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:You should not publish apps -using L Developer Preview to the Google Play store.

    +

    Caution: Do not not publish apps +that use the L Developer Preview to the Google Play store.

    + +

    Note: This document often refers to classes and +methods that do not yet have reference material available on developer.android.com. These API elements are +formatted in {@code code style} in this document (without hyperlinks). For the +preliminary API documentation for these elements, download the preview +reference.

    Important Behavior Changes

    If you have previously published an app for Android, be aware that your app - might be affected by changes in L.

    + might be affected by changes in the upcoming release.

    + +

    New Android Runtime (ART)

    + +

    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.

    + +

    For an overview of ART's new features, see +Introducing +ART. Some of the major new features are:

    + + + +

    Most Android apps should just work without change under ART. However, some +techniques that work on Dalvik do not work on ART. For information about the +most important issues, see +Verifying App +Behavior on the Android Runtime (ART). Pay particular attention if:

    + +

    If your app implements notifications...

    -

    Notifications will be drawn with dark text atop white (or very light) +

    Notifications are drawn with dark text atop white (or very light) backgrounds to match the new material design widgets. Make sure that all your -notifications look right with the new color scheme. You should remove or update -assets and text styles that involve color. The system will automatically invert -action icons in notifications. Use -{@code android.app.Notification.Builder.setColor()} to set an accent color -in a circle behind your {@code Notification.icon} image.

    +notifications look right with the new color scheme:

    -

    The system will ignore all non-alpha channels in action icons and the main -notification icon, so you should assume that these icons will be alpha-only. -

    +

    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, make sure to remove this code so that -the system can present notifications correctly in Do not disturb mode. You -should use the {@link android.app.Notification.Builder} methods instead to add -sounds and vibration. -

    +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.

    If your app uses RemoteControlClient...

    -

    Lockscreens in L will not show transport controls for your +

    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 gives your app more control over the presentation of media buttons, while providing a consistent experience for users across the lockscreen and unlocked device.

    -

    You must call {@code Notification.Builder.setVisibility(Notification.VISIBILITY_PUBLIC)} to mark your media notification as safe to reveal, even when the lockscreen is secured -with a PIN, pattern, or password.

    +

    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 +Lockscreen Notifications.

    If your app uses fullScreenIntent...

    Notifications now appear in a small floating window if all these conditions -are met: the user’s activity is in fullscreen mode, the screen is on, and the -device is unlocked. If your app implements fullscreen activities, make sure that +are met:

    + + + +

    If your app implements fullscreen activities, make sure that these heads-up notifications are presented correctly.

    If your app uses ActivityManager.getRecentTasks()...

    -

    With the introduction of the new document tasks feature in L (see below), -the {@code android.app.ActivityManager.getRecentTasks()} method is now -deprecated to improve user privacy. For backwards -compatibility, it will still return a small subset of its data including the +

    With the introduction of the new concurrent documents and activities tasks feature in the upcoming +release (see Concurrent documents and activities in Recents +screen below), +the {@link android.app.ActivityManager#getRecentTasks +ActivityManager.getRecentTasks()} method is now +deprecated to improve user privacy. For backward +compatibility, this method still returns a small subset of its data, including the calling application’s own tasks and possibly some other non-sensitive tasks -such as home. If your app is using this method to retrieve its own tasks, +(such as Home). If your app is using this method to retrieve its own tasks, use {@code android.app.ActivityManager.getAppTasks()} instead to retrieve that information.

    @@ -170,11 +230,15 @@ information.

    Material design support

    -

    The L Developer Preview adds support for the material design style. You can create -material design apps that are visually dynamic and have UI element transitions -which feel natural and delightful to users. This support includes:

    + +

    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 +that feel natural to users. This support includes:

    + +

    To learn more about adding material design functionality to your app, see -Material design on Android.

    +Material Design.

    Lockscreen notifications

    Lockscreens in the L Developer Preview have the ability to present notifications. @@ -194,29 +259,57 @@ content to be shown over a secure lockscreen.

    displayed over the secure lockscreen. To control the visibility level, call {@code android.app.Notification.Builder.setVisibility()} and specify one of these values:

    + -

    Notifications metadata

    -

    The L Developer Preview uses metadata associated with your app notifications -to more intelligently sort your notifications. The metadata you set also -controls how the system presents your app notifications when the user is in Do -not disturb mode. When constructing your notification, you can call the -following methods in {@code android.app.Notification.Builder}:

    +

    Do Not Disturb mode

    + +

    The L Developer Preview introduces a new Do Not Disturb mode. When +the user puts the device in Do Not Disturb mode, the device limits +the frequency of the notifications it shows the user (when the user +wants to avoid distractions). The user can +customize the feature in a number of ways, such as:

    + +

    You should add the appropriate metadata to your app notifications to help +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.

    + +

    Notifications metadata

    +

    The L Developer Preview uses metadata associated with your app notifications +to sort the notifications more intelligently. The metadata you set also +controls how the system presents your app notifications when the user is in Do +Not Disturb mode. To set the metadata, call the following methods in +{@code android.app.Notification.Builder} when you construct the +notification:

    + + -

    Manifest Declarations

    +

    Manifest Declarations

    Declarable required features

    -

    The following values are now supported in the {@code <uses-feature>} element so you +

    The following values are now supported in the {@code <uses-feature>} element, so you can ensure that your app is installed only on devices that provide the features your app needs.