Merge "docs: Updates to Preview Notifications doc" into mnc-mr-docs
diff --git a/docs/html/preview/features/afw.jd b/docs/html/preview/features/afw.jd
new file mode 100644
index 0000000..a67a1c8
--- /dev/null
+++ b/docs/html/preview/features/afw.jd
@@ -0,0 +1,543 @@
+page.title=Android for Work Updates
+page.metaDescription=New Android for Work APIs and features in the N Developer Preview.
+page.keywords="android for work", "android N", "enterprise", "QR code"
+
+@jd:body
+
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#qr">QR Code Provisioning
+ </a></li>
+
+ <li><a href="#sec-challenge">Work Profile Security Challenge
+ </a></li>
+
+ <li><a href="#suspend">Disable Access to Apps
+ </a></li>
+
+ <li><a href="#toggle-work">Toggle Work Mode
+ </a></li>
+
+ <li><a href="#always-on-vpn">Always-On VPN
+ </a></li>
+
+ <li><a href="#contacts">Contacts Integration with Work Profile
+ </a></li>
+
+ <li><a href="#remote-reboot">Remote Reboot
+ </a></li>
+
+ <li><a href="#disable-roaming">Disable Data Roaming
+ </a></li>
+
+ <li><a href="#process-logging">Enterprise Process Logging
+ </a></li>
+
+ <li><a href="#bug-reports">Remote Bug Reports
+ </a></li>
+
+ <li><a href="#remove-cert">Remove a Client Certificate
+ </a></li>
+
+ <li><a href="#grant-cert-on-install">Grant Access to Client Certificate
+ on Installation</a></li>
+
+ <li><a href="#ui-policy">System UI Policy Transparency
+ </a></li>
+
+ <li><a href="#restrictions-mgmt">App Restrictions Management Enhancements
+ </a></li>
+
+ <li><a href="#location-off">Location Off Switch
+ </a></li>
+
+ <li><a href="#custom-provisioning">Customized Provisioning
+ </a></li>
+
+ <li><a href="#multi-wifi-ca">Multiple Wi-Fi CA Certificates
+ </a></li>
+
+ <li><a href="#custom-lock">Customized Lockscreen Message
+ </a></li>
+
+ <li><a href="#work-connectionservice">Work Profile ConnectionService
+ </a></li>
+
+ <li><a href="#lock-wp">Lock Down Wallpaper
+ </a></li>
+
+ <li><a href="#lock-user-icon">Lock Down User Icon
+ </a></li>
+
+ <li><a href="#health-monitoring">Device Health Monitoring
+ </a></li>
+
+ </ol>
+
+ <h2>See Also</h2>
+ <ul>
+ <li><a href="{@docRoot}preview/download.html#docs">N Preview SDK
+ Reference</a></li>
+ </ul>
+ </div>
+</div>
+
+<p>This document describes the new Android for Work features provided in the
+N Developer Preview.</p>
+
+<h2 id="qr">QR Code Provisioning</h2>
+
+<p>
+ Android for Work now supports using QR codes to provision corporate-liable
+ devices. The setup wizard now allows you to scan a QR code to provision
+ the device.
+</p>
+
+<h2 id="sec-challenge">Work Profile Security Challenge</h2>
+
+<p>
+ Profile owners can require users to specify a security challenge for apps
+ running in the work profile. The system shows the security challenge when the
+ user attempts to open any work apps. If the user successfully completes the
+ security challenge, the system unlocks the work profile and decrypts it if
+ necessary.
+</p>
+
+<p>
+ If a profile owner sends an {@link
+ android.app.admin.DevicePolicyManager#ACTION_SET_NEW_PASSWORD} intent, the
+ system prompts a user to set up a security challenge. The profile owner can
+ also send an <code>ACTION_SET_NEW_PARENT_PROFILE_PASSWORD</code> intent to
+ prompt the user to set a device lock.
+</p>
+
+<p>
+ Profile owners can choose to set the password policies for the work challenge
+ differently from the policies for other device passwords. For example, the
+ minimum length for the device challenge response can be different from the
+ length required for other passwords. Profile owners set the challenge
+ policies using the usual {@link android.app.admin.DevicePolicyManager}
+ methods, such as {@link
+ android.app.admin.DevicePolicyManager#setPasswordQuality
+ setPasswordQuality()} and {@link
+ android.app.admin.DevicePolicyManager#setPasswordMinimumLength
+ setPasswordMinimumLength()}. The profile owner can also set the device lock,
+ by using the {@link android.app.admin.DevicePolicyManager} instance returned
+ by the new <code>DevicePolicyManager.getParentProfileInstance()</code>
+ method. Additionally, profile owners can customize the credentials screen for
+ the work challenge by using the {@link android.app.admin.DevicePolicyManager}
+ class's new <code>setOrganizationColor()</code> and
+ <code>setOrganizationName()</code> methods.
+</p>
+
+<p>
+ For details on the new methods and constants, see the
+ <code>DevicePolicyManager</code> reference page in the <a href=
+ "{@docRoot}preview/download.html#docs">N Preview SDK Reference</a>.
+</p>
+
+<h2 id="suspend">Disable Access to Apps</h2>
+
+<p>
+ Device owners and profile owners can temporarily suspend access to packages
+ by calling the new <code>DevicePolicyManager.getPackagesSuspended()</code>
+ method.Owners can use the same method to re-enable those packages.
+</p>
+
+<p>
+ While a package is suspended, it cannot start activities, and notifications
+ to the package are suppressed. Suspended packages do not show in the <a href=
+ "{@docRoot}guide/components/recents.html">overview screen</a>, and they
+ cannot show dialogs (including toasts and snackbars). They also cannot play
+ audio or vibrate the device.
+</p>
+
+<p>
+ Launchers should apply a distinctive UI to suspended apps to show that the
+ apps aren't currently available; for example, they might render the app icon
+ in gray. Launchers can find out which apps are suspended by calling the new
+ <code>DevicePolicyManager.getPackagesSuspended()</code> method.
+</p>
+
+<h2 id="toggle-work">Toggle Work Mode</h2>
+
+<p>On dual-profile devices, users can toggle work mode on and off. While work
+ mode is turned off, the managed profile is temporarily shut down. Work profile apps, background sync, and notifications are all disabled, including the profile
+ owner app. While the work profile is disabled, the system displays a persistent status icon to remind users that they can't launch work apps. The system launcher
+ indicates that work apps and widgets are not accessible.
+</p>
+
+
+<h2 id="always-on-vpn">Always-On VPN</h2>
+
+<p>
+ Device owners and profile owners can require that work apps always connect to
+ the network through a specified VPN. If owners set this requirement, the
+ device automatically starts that VPN at boot time.
+</p>
+
+<p>
+ Owners can require use of a VPN by calling the new
+ <code>DevicePolicyManager.setAlwaysOnVpnPackage()</code> method. To find out
+ if the owner has set a VPN requirement, call the new
+ <code>DevicePolicyManager.GetAlwaysOnVpnPackage()</code> method.
+</p>
+
+<p>
+ Because the system can directly bind VPN services without app interaction,
+ VPN clients need to handle new entry points for always-on VPN. As before, you
+ can find active services by using an intent filter that matches the action
+ {@link android.net.VpnService android.net.VpnService}.
+</p>
+
+<p>
+ Users can manually set an always-on VPN client that implement {@link
+ android.net.VpnService} by using the <strong>Settings > More >
+ VPN</strong> screen.
+</p>
+
+<h2 id="contacts">Contacts Integration with Work Profile</h2>
+
+<p>
+ Profile owners can allow local search and directory lookup of work contacts
+ from the primary user. For example, a user can access both personal and work
+ directory contacts from their personal dialer or contacts application (if
+ permitted by their profile administrator).
+</p>
+
+<p>
+ Developers that leverage the Contact Provider can use the Enterprise Contacts
+ API to access work profile directory entries from the primary user if allowed
+ by policy:
+</p>
+
+<ul>
+ <li><code>ContactsContract.Contacts.ENTERPRISE_CONTENT_FILTER_URI</code>
+ </li>
+
+ <li><code>ContactsContract.Phone.ENTERPRISE_CONTENT_FILTER_URI</code>
+ </li>
+
+ <li><code>ContactsContract.Email.ENTERPRISE_CONTENT_FILTER_URI</code>
+ </li>
+
+ <li><code>ContactsContract.Callable.ENTERPRISE_CONTENT_FILTER_URI</code>
+ </li>
+
+ <li><code>ContactsContract.Directory.ENTERPRISE_CONTENT_URI</code>
+ </li>
+
+ <li><code>ContactsContract.Directory.isEntepriseDirectoryId()</code>
+ </li>
+</ul>
+
+<p>
+ Profile owners can control the visibility of work contacts in the primary
+ user using the following new methods:
+</p>
+
+<ul>
+ <li>
+ <code>DevicePolicyManager.setCrossProfileContactsSearchDisabled()</code>
+ </li>
+
+ <li>
+ <code>DevicePolicyManager.getCrossProfileContactsSearchDisabled()</code>
+ </li>
+</ul>
+
+<h2 id="remote-reboot">Remote Reboot</h2>
+
+<p>
+ Device owners can remotely reboot devices. In some cases, devices deployed in
+ public places inside enclosures can prevent access to the power button. If a
+ device needs to be rebooted, administrators can do so using the new
+ <code>DevicePolicyManager.reboot()</code> method.
+</p>
+
+<h2 id="disable-roaming">Disable Data Roaming</h2>
+
+<p>
+ Device owners can disable data roaming using the new {@link
+ android.os.UserManager} user restriction <code>DISALLOW_DATA_ROAMING</code>.
+</p>
+
+<h2 id="process-logging">Enterprise Process Logging</h2>
+
+<p>
+ Device owners can identify suspicious activity by remotely tracking device
+ activity, including app launches, adb activity, and screen unlocks. Process
+ logs don’t require user consent. To retrieve logs, device owners enable
+ device logging using <code>setDeviceLoggingEnabled()</code>.
+</p>
+
+<p>
+ The new <code>android.auditing.SecurityLog</code> class includes these
+ methods:
+</p>
+
+<ul>
+ <li>
+ <code>void DevicePolicyManager.setDeviceLoggingEnabled()</code>
+ </li>
+
+ <li>
+ <code>boolean DevicePolicyManager.getDeviceLoggingEnabled()</code>
+ </li>
+
+ <li>
+ <code>List DevicePolicyManager.retrieveDeviceLogs()</code>
+ </li>
+
+ <li>
+ <code>List DevicePolicyManager.retrievePreviousDeviceLogs()</code>
+ </li>
+
+ <li>
+ <code>void DeviceAdminReceiver.onSecurityLogsAvailable()</code>
+ </li>
+</ul>
+
+<h2 id="bug-reports">Remote Bug Reports</h2>
+
+<p>
+ Device owners can remotely trigger and retrieve a bug report that contains a
+ device state dump file, which allows forensic investigation of a known
+ incident or compromised device. Due to the detailed nature of the bug report,
+ user consent is required.
+</p>
+
+<p>
+ The Preview includes the following API additions to support this feature. For
+ details, see the <a href="{@docRoot}preview/download.html#docs">N Preview SDK
+ Reference</a>.
+</p>
+
+<ul>
+ <li>
+ <code>DevicePolicyManager.requestBugreport()</code>
+ </li>
+
+ <li>
+ <code>DeviceAdminReceiver.onBugreportFailed()</code>
+ </li>
+
+ <li>
+ <code>DeviceAdminReceiver.onBugreportShared()</code>
+ </li>
+
+ <li>
+ <code>DeviceAdminReceiver.onBugreportSharingDeclined()</code>
+ </li>
+
+ <li>
+ <code>DeviceAdminReceiver.BUGREPORT_FAILURE_FAILED_COMPLETING</code>
+ </li>
+
+ <li>
+ <code>DeviceAdminReceiver.BUGREPORT_FAILURE_FILE_NO_LONGER_AVAILABLE</code>
+ </li>
+</ul>
+
+<h2 id="remove-cert">Remove a Client Certificate</h2>
+
+<p>
+ Profile owners and device owners can now remove client certificates that were
+ installed through {@link android.app.admin.DevicePolicyManager#installKeyPair
+ installKeyPair()} by calling the new method
+ <code>DevicePolicyManager.removeKeyPair()</code>.
+</p>
+
+<h2 id="grant-cert-on-install">Grant Access to Client Certificate on
+ Installation</h2>
+
+<p>
+ If a profile owner or device owner grants a third-party app the ability to
+ manage certificates, the app can grant itself access to certificates it
+ installs without any intervention by the owner.
+</p>
+
+<p>
+ The existing API for managing certificates is extended to include:
+</p>
+
+<ul>
+ <li><code>DevicePolicyManager.installKeyPair()</code>
+ </li>
+</ul>
+
+<h2 id="ui-policy">System UI Policy Transparency</h2>
+
+<p>
+ Policies that affect the user experience or restrict user Settings are fully
+ disclosed to the user, and profile owners and device owners can attribute the
+ policy to their company’s IT department. In addition to a consistent “Action
+ not allowed” message in Settings, IT administrators can set an
+ organization-specific support message in device settings with the following
+ new {@link android.app.admin.DevicePolicyManager} methods:
+</p>
+
+<ul>
+ <li>
+ <code>DevicePolicyManager.setShortSupportMessage()</code>
+ </li>
+
+ <li>
+ <code>DevicePolicyManager.setLongSupportMessage()</code>
+ </li>
+</ul>
+
+<h2 id="restrictions-mgmt">App Restrictions Management Enhancements</h2>
+
+<p>
+ The device or profile owner can enable another application to manage app
+ restrictions via the new
+ <code>DevicePolicyManager.setApplicationRestrictionsManagingPackage()</code>
+ method. The nominated application can check whether this permission has been
+ granted by calling
+ <code>DevicePolicyManager.isCallerApplicationRestrictionsManagingPackage()</code>.
+</p>
+
+<p>
+ An application nominated to manage app restrictions can call {@link
+ android.app.admin.DevicePolicyManager#setApplicationRestrictions
+ setApplicationRestrictions()} and {@link
+ android.app.admin.DevicePolicyManager#getApplicationRestrictions
+ getApplicationRestrictions()} for any packages within that user or profile.
+</p>
+
+<h2 id="location-off">Location Off Switch</h2>
+
+<p>
+ Users can disable location permissions for work apps while continuing to
+ access location information in their personal apps. A separate location
+ access switch in Location Settings allows users to deny location updates or
+ last-location queries for apps running in the work profile.
+</p>
+
+<p>
+ The top level location off switch disables location access for both the
+ primary profile and the managed profile.
+</p>
+
+<h2 id="custom-provisioning">Customized Provisioning</h2>
+
+<p>
+ An application can customize the profile owner and device owner provisioning
+ flows with corporate colors and logos.
+</p>
+
+<dl>
+ <dt>
+ <code>DevicePolicyManager.EXTRA_PROVISIONING_MAIN_COLOR</code>
+ </dt>
+
+ <dd>
+ Customizes flow color.
+ </dd>
+
+ <dt>
+ <code>DevicePolicyManager.EXTRA_PROVISIONING_LOGO_URI</code>
+ </dt>
+
+ <dd>
+ Customizes the flow with a corporate logo.
+ </dd>
+</dl>
+
+<h2 id="multi-wifi-ca">Multiple Wi-Fi CA Certificates</h2>
+
+<p>
+ Profile owners and device owners can set multiple CA certificates for a given
+ Wi-Fi configuration. When corporate Wi-Fi networks have separate CAs for
+ separate access points with the same SSID, IT administrators can include all
+ relevant CAs in the Wi-Fi configuration using the new method
+ <code>setCaCertificates()</code>.
+</p>
+
+<p>
+ APIs added are:
+</p>
+
+<ul>
+ <li>
+ <code>WifiEnterpriseConfig.setCaCertificates()</code>
+ </li>
+
+ <li>
+ <code>WifiEnterpriseConfig.getCaCertificates()</code>
+ </li>
+</ul>
+
+<h2 id="custom-lock">Customized Lockscreen Message</h2>
+
+<p>
+ Device owners can provide owner information to be shownon the lockscreen.
+ This information takes precedence the user lock screen message (if one is
+ set). New {@link android.app.admin.DevicePolicyManager} methods are:
+</p>
+
+<ul>
+ <li>
+ <code>setDeviceOwnerLockScreenInfo()</code>
+ </li>
+
+ <li>
+ <code>getDeviceOwnerLockScreenInfo()</code>
+ </li>
+</ul>
+
+<h2 id="work-connectionservice">Work Profile ConnectionService</h2>
+
+<p>
+ Profile owners can specify a work dialer application that uses a
+ work-specific {@link android.telecom.ConnectionService} for the calling
+ backend (calling accounts). The work dialer maintains a work-only call log
+ and relies on work contacts only. Users have a consistent in-call UI
+ experience regardless of dialing application. Incoming work calls to the work
+ calling accounts are distinguished from personal incoming calls to the
+ personal calling accounts.
+</p>
+
+<p>
+ The dialer should check for the new flag
+ <code>android.telecom.Call.PROPERTY_WORK_CALL</code> to determine if a call
+ is a work call. If a call is a work call, the dialer should indicate this,
+ such as by adding a work badge.
+</p>
+
+<h2 id="lock-wp">Lock Down Wallpaper</h2>
+
+<p>
+ A new user restriction (<code>DISALLOW_SET_WALLPAPER</code>) prevents the
+ user from changing their wallpaper. The device owner or profile owner can
+ still change the wallpaper, but they can only change the wallpaper for the
+ user or profile they control. For example, a profile owner can’t change the
+ wallpaper of the parent user, but a profile owner in the primary profile or
+ device owner can. A profile owner or device owner that wants to change the
+ wallpaper should check whether the the user or profile they manage has a
+ wallpaper ({@link android.app.WallpaperManager#isWallpaperSupported
+ isWallpaperSupported()}) and whether they are allowed to change it (with the
+ new method <code>WallpaperManager.isWallpaperSettingAllowed()</code>)
+</p>
+
+<h2 id="lock-user-icon">Lock Down User Icon</h2>
+
+<p>
+ A new user restriction (<code>DISALLOW_SET_USER_ICON</code>) prevents the
+ user from changing their user icon. The user’s device owner or profile owner
+ can still change the icon. However, a profile owner can only change the user
+ icon for the profile it controls.
+</p>
+
+<h2 id="health-monitoring">Device Health Monitoring</h2>
+
+<p>
+ A device owner or profile owner can use the new
+ <code>HardwarePropertiesManager</code> interface to retrieve information
+ about device health, such as CPU or GPU temperatures and CPU usage. The new
+ monitoring interface is especially useful for monitoring unattended devices
+ running in a remote location.
+</p>
diff --git a/docs/html/preview/features/icu4j-framework.jd b/docs/html/preview/features/icu4j-framework.jd
index 6f2eb39..cef1950 100644
--- a/docs/html/preview/features/icu4j-framework.jd
+++ b/docs/html/preview/features/icu4j-framework.jd
@@ -1,4 +1,4 @@
-page.title=ICU4J Support in the Android Framework
+page.title=ICU4J Android Framework APIs
@jd:body
@@ -6,7 +6,6 @@
<div id="tb">
<h2>In this document:</h2>
<ol>
-<li><a href="#compatibility">Compatibility Across Android Releases</a></li>
<li><a href="#relation">Relationship to ICU4J</a></li>
<li><a href="#migration">Migrating to android.icu APIs from ICU4J </a></li>
<li><a href="#licence">Licensing</a></li>
@@ -51,8 +50,9 @@
<h2 id="relation">Relationship to ICU4J</h2>
<p>
- The N Developer Preview exposes a subset of the ICU4J APIs via the
- <code>android.icu</code> package. The Android framework may choose not to
+ The Preview exposes a subset of the ICU4J APIs via the
+ <code>android.icu</code> package, rather than <code>com.ibm.icu</code>. The
+ Android framework may choose not to
expose ICU4J APIs for various reasons; for example, the N Preview does not expose
some deprecated APIs or those that the ICU team have not yet declared as
stable. As the ICU team deprecates APIs in the future, Android will also mark
@@ -60,7 +60,7 @@
</p>
<p class="table-caption"><strong>Table 1.</strong> ICU and CLDR versions used
- in the N Preview.</p>
+ in the Preview.</p>
<table>
<tr>
<th>Android API level</th>
@@ -74,19 +74,10 @@
</tr>
</table>
-<p class="note">
- <b>Note</b>: When using the the the ICU4J APIs in the Android framework, you may notice
- differences between Android releases. For example, the exact text returned
- from formatters may vary between API levels as they do for existing
- <code>java.util</code> and <code>java.text</code> classes on Android. These
- differences are the result of improvements to translations between Android
- versions.
-</p>
-
<p>Here are a few important things to note:</p>
<ul>
-<li>The ICU4J Android Framework APIs do not include all the ICU4J APIs.</li>
+<li>The ICU4J Android framework APIs do not include all the ICU4J APIs.</li>
<li>NDK developers should know that Android ICU4C is not supported.</li>
<li>The APIs in the Android framework do not replace Android’s support for
<a href="{@docRoot}guide/topics/resources/localization.html">localizing with
@@ -104,7 +95,7 @@
</p>
<p class="note">
- <b>Note</b>: ICU4J in the Android framework uses the {@code android.icu}
+ <b>Note</b>: The ICU4J framework APIs use the {@code android.icu}
namespace instead of {@code com.ibm.icu}. This is to avoid namespace
conflicts in APKs that contain their own {@code com.ibm.icu} libraries.
</p>
diff --git a/docs/html/preview/features/picture-in-picture.jd b/docs/html/preview/features/picture-in-picture.jd
index 9a96de2..b5a0762 100644
--- a/docs/html/preview/features/picture-in-picture.jd
+++ b/docs/html/preview/features/picture-in-picture.jd
@@ -6,48 +6,61 @@
<div id="tb-wrapper">
<div id="tb">
- <h2>In this document</h2>
- <ol>
- <li><a href="#declaring">Declaring Your Activity Supports
- Picture-in-picture</a></li>
- <li><a href="#pip_button">Switching Your Activity to Picture-in-picture</a>
- </li>
- <li><a href="#handling_ui">Handling UI During Picture-in-picture</a>
- </li>
- <li><a href="#continuing_playback">Continuing Video Playback While in
+
+<h2>In this document</h2>
+<ol>
+ <li><a href="#declaring">Declaring Your Activity Supports
Picture-in-picture</a></li>
- <li><a href="#best">Best Practices</a></li>
- </ol>
+ <li><a href="#pip_button">Switching Your Activity to Picture-in-picture</a>
+</li>
+ <li><a href="#handling_ui">Handling UI During Picture-in-picture</a>
+</li>
+ <li><a href="#continuing_playback">Continuing Video Playback While in
+Picture-in-picture</a></li>
+ <li><a href="#best">Best Practices</a></li>
+</ol>
+
+<h2>See Also</h2>
+<ol>
+ <li><a href="{@docRoot}preview/features/multi-window.html">Multi-Window
+Support</a></li>
+</ol>
+
</div>
</div>
<p>In the Android N Developer Preview, Android TV users can now watch a video
in a pinned window in a corner of the screen when navigating within
-applications. This new Picture-in-picture (PIP) mode lets apps run a video
+apps. Picture-in-picture (PIP) mode lets apps run a video
activity in the pinned window while another activity continues in the
-background. The PIP window lets users multi-task while using your app, making
-browsing and exploring your app easier and more engaging.</p>
+background. The PIP window lets users multitask while using your app, which
+helps users be more productive.</p>
-<p>Your app can decide when to trigger PIP mode. Here are some examples on
+<p>Your app can decide when to trigger PIP mode. Here are some examples of
when to enter PIP mode:</p>
<ul>
-<li>When the user is navigating back from a video, the video activity can be
-placed in PIP mode instead of being closed.</li>
-<li>When the user is watching the end of an episode of content, the video can
-be placed in PIP mode while the main screen displays promotional or summary
+<li>Your app can move a video into PIP mode when the user navigates
+back from the video to browse other content.</li>
+<li>Your app can switch a video into PIP mode while a user watches the end
+of an episode of content. The main screen displays promotional or summary
information about the next episode in the series.</li>
-<li>When the user wants to queue up additional content to watch while watching
-the currently playing content, the video can be placed in PIP mode and a
-content selection activity can be shown in the main screen.</li>
+<li>Your app can provide a way for users to queue up additional content while
+they watch a video. The video continues playing in PIP mode while the main
+screen displays a content selection activity.</li>
</ul>
-<p>The PIP window is 240 x 135 dp and is shown at the top-most layer in one of
+<p>The PIP window is 240x135 dp and is shown at the top-most layer in one of
the four corners of the screen, chosen by the system. The user can bring up a
-PIP menu that lets them toggle the PIP window to full screen, or close the PIP
+PIP menu that lets them toggle the PIP window to full-screen, or close the PIP
window, by holding down the <b>Home</b> button on the remote. If another
-video starts playing on the main screen, or the user leaves the app, the PIP
-window is automatically closed.</p>
+video starts playing on the main screen, the PIP window is automatically
+closed. Users can also close the PIP window through Recents.</p>
+
+<img src="{@docRoot}preview/images/pip-active.png" />
+<p class="img-caption"><strong>Figure 1.</strong> A Picture-in-picture
+video visible in a corner of the screen while the user browses content
+on the main screen.</p>
<p>PIP leverages the multi-window APIs available in the N Developer Preview to
provide the pinned video overlay window. To add PIP to your app, you need to
@@ -57,13 +70,13 @@
<h2 id="declaring">Declaring Your Activity Supports Picture-in-picture</h2>
-<p>By default, the system will not automatically support PIP for applications.
-If you want support PIP in your application, you need to register your video
+<p>By default, the system does not automatically support PIP for apps.
+If you want support PIP in your app, register your video
activity in your manifest by setting
<code>android:supportsPictureInPicture</code> and
<code>android:resizeableActivity</code> to <code>true</code>. Also, specify
that your activity handles layout configuration changes so that your activity
-won't relaunch when layout changes occur during PIP mode transitions.</p>
+doesn't relaunch when layout changes occur during PIP mode transitions.</p>
<pre>
<activity android:name="VideoActivity"
@@ -76,9 +89,10 @@
<p>When registering your activity, keep in mind that in PIP mode, your
activity is shown in a small overlay window on a TV screen. Video playback
-activities with minimal UI provide the best user experience. Non-video
-activities with detailed UI may not provide a good user experience in PIP
-mode.</p>
+activities with minimal UI provide the best user experience. Activities that
+contain small UI elements might not provide a good user experience
+when switched to PIP mode, because users can't see details of the UI elements
+in the PIP window.</p>
<h2 id="pip_button">Switching Your Activity to Picture-in-picture</h2>
@@ -104,13 +118,14 @@
<p class="img-caption"><strong>Figure 1.</strong> A Picture-in-picture
button on a media control bar.</p>
-<p>A new <code>PlaybackControlsRow.PictureInPictureAction</code> class is
-provided to use the PIP icon and handle control bar PIP actions.</p>
+<p>The N Developer Preview includes a new
+<code>PlaybackControlsRow.PictureInPictureAction</code> class which defines
+control bar PIP actions and uses the PIP icon.</p>
<h2 id="handling_ui">Handling UI During Picture-in-picture</h2>
<p>When your activity enters PIP mode, your activity should only show video
-playback. You should remove UI elements before your activity enters PIP,
+playback. Remove UI elements before your activity enters PIP,
and restore these elements when your activity becomes full-screen again.
Override <code>Activity.onPictureInPictureChanged()</code> or
<code>Fragment.onPictureInPictureChanged()</code> and enable or
@@ -152,7 +167,7 @@
}
</pre>
-<p>When your activity switches out of PIP mode back to full screen mode, the
+<p>When your activity switches out of PIP mode back to full-screen mode, the
system resumes your activity and calls your <code>onResume()</code> method.</p>
<h2 id="best">Best Practices</h2>
@@ -160,7 +175,7 @@
<p>PIP is intended for activities that play full-screen video. When switching
your activity into PIP mode, avoid showing anything except video content.
Track when your activity enters PIP mode and hide UI elements, as described
-in <a href="#handling_ui">Handling UI During Picture-in-picture Mode</a>.</p>
+in <a href="#handling_ui">Handling UI During Picture-in-picture</a>.</p>
<p>Since the PIP window is shown as a floating window in the corner of the
screen, you should avoid showing critical information in the main screen
@@ -169,7 +184,3 @@
<p>When an activity is in PIP mode, by default it doesn't get input focus. To
receive input events while in PIP mode, use
<code>MediaSession.setMediaButtonReceiver()</code>.</p>
-
-<p>For more information on multi-window APIs, see
-<a href="{@docRoot}preview/features/multi-window.html">Android N
-Developer Preview Multi-Window Support</a>.</p>
diff --git a/docs/html/preview/images/pip-active.png b/docs/html/preview/images/pip-active.png
index 1e4bb63..dead766 100644
--- a/docs/html/preview/images/pip-active.png
+++ b/docs/html/preview/images/pip-active.png
Binary files differ
diff --git a/docs/html/preview/preview_toc.cs b/docs/html/preview/preview_toc.cs
index 406774f..a093686 100644
--- a/docs/html/preview/preview_toc.cs
+++ b/docs/html/preview/preview_toc.cs
@@ -20,17 +20,12 @@
ru-lang="Настройка пакета SDK Preview"
zh-cn-lang="设置预览版 SDK"
zh-tw-lang="設定預覽版 SDK">
- SDK Setup</a></div>
+ Set Up to Develop</a></div>
</li>
-
-
-
-
-
-
-
-
-
+ <li class="nav-section">
+ <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/run-app.html">
+ Run Your App</a></div>
+ </li>
<li class="nav-section">
@@ -50,7 +45,8 @@
>Notifications</a></li>
<li><a href="<?cs var:toroot ?>preview/features/multilingual-support.html"
>Language and Locale</a></li>
- </ul>
+ <li><a href="<?cs var:toroot ?>preview/features/afw.html"
+ >Android for Work</a></li> </ul>
</li>
<li class="nav-section">
diff --git a/docs/html/preview/run-app.jd b/docs/html/preview/run-app.jd
new file mode 100644
index 0000000..226183c
--- /dev/null
+++ b/docs/html/preview/run-app.jd
@@ -0,0 +1,100 @@
+page.title=Run Your App on the N Preview
+meta.keywords="preview", "android"
+page.tags="preview", "developer preview"
+page.image=images/cards/card-n-sdk_2x.png
+
+@jd:body
+
+<div id="qv-wrapper">
+ <div id="qv">
+ <ol>
+ <li><a href="#setupAVD">Set up a Virtual Device</a></li>
+ <li><a href="#setup-device">Set Up a Hardware Device</a></li>
+</ol>
+ </div>
+</div>
+
+<p>If you have an existing Android app and you simply want to run it on the N
+Preview system image, then you need either a virtual device or a supported
+hardware device configured with N Preview system image.</p>
+
+<p>Simply installing your app onto the N Preview this way does not require
+any changes to your app source code. If, however, you want to update your
+app to use new APIs in the N Preview and new language features of Java 8,
+then you need to download Android Studio 2.1 (preview) as described in
+<a href="{@docRoot}preview/setup-sdk.html">Set Up to Develop for the
+N Preview</a>.
+
+<p>So, although Android Studio 2.1 is required for development with N Preview
+APIs, you can use Android Studio 1.5 or higher if you simply want to run your
+app in the emulator or a connected device.</p>
+
+
+<h2 id="setupAVD">Set up a Virtual Device</h2>
+
+<p>To use the Android Emulator to run the N Preview you need to download
+the Android N Preview SDK and create a virtual device for the emulator.
+</p>
+
+<p>First, downloaded the Android N Preview SDK as follows (if you
+already got it while <a href="{@docRoot}preview/setup-sdk.html">setting up
+Android Studio 2.1</a>, you can skip this part):
+
+<ol>
+ <li>In Android Studio, open the Settings dialog
+ (<strong>File > Settings</strong> on Windows/Linux, or
+ <strong>Android Studio > Preferences</strong> on Mac). In the left
+ panel, select <strong>Appearance & Behavior >
+ System Settings > Android SDK</strong>.
+
+ <li>Click the <strong>SDK Platforms</strong> tab, then select the
+ <strong>Android N Preview</strong> check box.</li>
+
+ <li>Click the <strong>SDK Tools</strong> tab, then select the
+ <strong>Android SDK Build Tools</strong>, <strong>Android SDK
+ Platform-Tools</strong>, and <strong>Android SDK Tools</strong> check
+ boxes.
+ </li>
+
+ <li>Click <strong>OK</strong> and accept the license
+ agreements for any packages to be installed.
+ </li>
+</ol>
+
+
+<p>Now create a virtual device with the N Preview system image:</p>
+
+<ol>
+ <li>Open the AVD Manager by selecting <strong>Tools > Android >
+ AVD Manager</strong>.</li>
+ <li>Click <strong>Create Virtual Device</strong>.</li>
+ <li>Select a device such as Nexus 5X, Nexus 6P, Nexus 9, or Android TV,
+ then click <strong>Next</strong>.</li>
+ <li>Select the <strong>N</strong> system image (with the
+ <strong>x86</strong> ABI), then click <strong>Next</strong>.
+ <li>Complete the rest of the AVD configuration and click
+ <strong>Finish</strong>.</li>
+</ol>
+
+<p>You can now launch the Android Emulator with the Android N Preview AVD.</p>
+
+<p>For more information about creating virtual devices, see <a href=
+ "{@docRoot}tools/devices/index.html">Managing Virtual Devices</a>.
+</p>
+
+
+
+<h2 id="setup-device">Set Up a Hardware Device</h2>
+
+<p>If you have a Nexus 5X, Nexus 6P, Nexus 9, Pixel C, or Nexus Player, you can
+install the N Preview for testing your app.</p>
+
+<p class="caution">
+ <strong>Important:</strong> Installing a preview image on a device
+ <em>removes all data from it</em>, so you should backup any data before
+ installing a preview image.
+</p>
+
+<p><strong>TODO(smain/joefernandez): Merge as appropriate with <a href=
+"{@docRoot}preview/download.html">Image Downloads and OTA
+Updates</a>.</strong></p>
diff --git a/docs/html/preview/setup-sdk.jd b/docs/html/preview/setup-sdk.jd
index ea5eaf6..7c6d251 100644
--- a/docs/html/preview/setup-sdk.jd
+++ b/docs/html/preview/setup-sdk.jd
@@ -1,4 +1,4 @@
-page.title=Set Up the SDK
+page.title=Set Up to Develop for the N Preview
meta.keywords="preview", "android"
page.tags="preview", "developer preview"
page.image=images/cards/card-n-sdk_2x.png
@@ -8,196 +8,166 @@
<div id="qv-wrapper">
<div id="qv">
- <h2>In this document</h2>
- <ol>
- <li><a href="#get-as13">Get Android Studio 2.1</a></li>
- <li><a href="#get-sdk">Get the Preview SDK</a></li>
- <li><a href="#java8">Get the Java 8 JDK</a></li>
- <li><a href="#create-update">Create or Update a Project</a></li>
- <li><a href="#setup-test">Set Up for Testing</a></li>
- </ol>
+<ol>
+ <li><a href="#get-as13">Get Android Studio 2.1</a></li>
+ <li><a href="#get-sdk">Get the N Preview SDK</a></li>
+ <li><a href="#java8">Get the Java 8 JDK and JRE</a></li>
+ <li><a href="#create-update">Update or Create a Project</a></li>
+ <li><a href="#next">Next Steps</a></li>
+</ol>
</div>
</div>
<p>
- You must have a development enviroment to make use of the Android N Developer
- Preview. This document describes how to setup and configure a development
- environment so you can use and test the Preview SDK.
+To develop apps for Android using new APIs in the N Preview and new language
+features of Java 8, you need to set up Android Studio 2.1 (preview) as described
+on this page.</p>
+
+<p>If you instead want to simply test your app's forward-compatibility on the
+Android N Preview system image, you can instead follow the guide to <a
+href="{@docRoot}preview/run-app.html">Run Your App on the N Preview</a>.</p>
+
+
+<h2 id="get-as13">Get Android Studio 2.1 (preview)</h2>
+
+<p>Developing for the Android N Preview platform requires Java 8 and a new
+compiler toolchain called JACK, which is currently supported only in
+Android Studio 2.1.
</p>
-<p>
- This document assumes that you are familiar with Android app development,
- such as using the Android SDK Manager and creating projects. If you are new
- to Android, see
- <a href="{@docRoot}training/basics/firstapp/index.html">Building Your First
- App</a> training lesson first.
-</p>
+<p>Android Studio 2.1 is currently available as a preview in the canary
+release channel—it is still in development. If you already
+have Android Studio and don't want to update to the canary channel, you can
+download Android Studio 2.1 as a separate installation and use it
+for use with the N Preview, leaving your primary Android Studio environment
+unaffected.</p>
-
-<h2 id="get-as13">Get Android Studio 2.1</h2>
-
-<p>
- The Developer Preview is best used with Android Studio 2.1, which is also in
- preview status. If you have an existing version of Android Studio you are
- using for development, you should install a separate instance of Android
- Studio for use with the Preview. This section describes how to install
- an instance of Android Studio and update to version 2.1.
-</p>
-
-<p class="caution">
- <strong>Caution:</strong> The canary preview of Android Studio 2.1 is still
- in active development. If you are using your primary development machine to
- test the developer preview, you should create a second installation of
- Android Studio to use for testing the Developer Preview.
-</p>
-
-<p>To install Android Studio and update to version 2.1:</p>
+<p>To download Android Studio 2.1 as a separate installation, follow these
+steps (or if you want to receive Android Studio 2.1 as an update to your
+existing installation, skip to step 4):</p>
<ol>
- <li>Download, install, and launch the current version of
- <a href="{@docRoot}tools/studio/index.html">Android Studio</a>.
+ <li>Edit the name of your
+ existing Android Studio installation and append the version number. This way,
+ when you install the new version, it will not override the existing one.</li>
+ <li>Download the appropriate ZIP file for your operating system from the
+ <a href="http://tools.android.com/download/studio/canary/latest"
+ >canary channel download page</a>.
</li>
-
- <li>In Android Studio, open the <em>Settings</em> dialog and in the left
- panel, choose <strong>Appearance & Behavior > System Settings >
+ <li>Unzip the package and move the Android Studio 2.1 contents to the
+ appropriate location for applications on your system, then launch it.</li>
+ <li>Open the Settings dialog
+ (<strong>File > Settings</strong> on Windows/Linux, or
+ <strong>Android Studio > Preferences</strong> on Mac). In the left
+ panel, select <strong>Appearance & Behavior > System Settings >
Updates</strong>.
- <ul>
- <li>On Windows and Linux, open <em>Settings</em> by choosing
- <strong>File > Settings</strong>.
- </li>
- <li>On Mac OS, open <em>Settings</em> by choosing
- <strong>Android Studio > Preferences</strong>.
- </li>
- </ul>
</li>
-
- <li>On the <em>Updates</em> panel, make sure the <strong>Automatically
- check updates for</strong> option is selected and choose the
- <strong>Canary Channel</strong> option.
- </li>
-
- <li>On the <em>Updates</em> panel, click <strong>Check Now</strong>
- to check for the latest canary build. Allow the software to download
- and install the canary version when prompted.
+ <li>On the Updates panel, select the <strong>Automatically
+ check updates for</strong> check box and select
+ <strong>Canary Channel</strong> from the drop-down list.
</li>
</ol>
+<p>Keep this settings window open for the next step.</p>
-<h2 id="java8">Get the Java 8 JDK</h2>
+
+<h2 id="get-sdk">Get the N Preview SDK</h2>
+
+<p>Now add the N Preview SDK to your Android Studio 2.1 development
+ environment as follows:</p>
+
+<ol>
+ <li>While still viewing the Updates panel from the previous
+ procedure, select the <strong>Automatically
+ check updates for Android SDK</strong> check box and select
+ <strong>Preview Channel</strong> from the drop-down list.
+ </li>
+ <li>Click <strong>Check Now</strong>.</li>
+
+ <li>In the left panel, select <strong>Appearance & Behavior >
+ System Settings > Android SDK</strong>.
+
+ <li>Click the <strong>SDK Platforms</strong> tab, then select the
+ <strong>Android N Preview</strong> check box.</li>
+
+ <li>Click the <strong>SDK Tools</strong> tab, then select the
+ <strong>Android SDK Build Tools</strong>, <strong>Android SDK
+ Platform-Tools</strong>, and <strong>Android SDK Tools</strong> check
+ boxes.
+ </li>
+
+ <li>Click <strong>OK</strong>, then accept the licensing
+ agreements for any packages that need to be installed.
+ </li>
+</ol>
+
+<p>In addition to these preview components, you should download the
+N Preview developer docs from the following table. This is an offline version
+of the developer.android.com web site, except it includes the updated
+API reference for the N Preview APIs and an API difference report.</p>
+
+<table id="docs-dl">
+ <tr>
+ <th scope="col">Documentation</th>
+ <th scope="col">Checksums</th>
+ </tr>
+ <tr>
+ <td style="white-space: nowrap">
+ <a href="https://storage.googleapis.com/androiddevelopers/n-preview/n-preview-1-docs.zip"
+ >n-preview-1-docs.zip</a></td>
+ <td width="100%">
+ MD5: xxxx<br>
+ SHA-1: xxxx
+ </td>
+ </tr>
+<table>
+
+
+
+<h2 id="java8">Get the Java 8 JDK and JRE</h2>
<p>
- You must use the Java 8 Development Kit with the N Developer Preview. If you
- do not have this version of the JDK installed, download and install it before
- working with the Preview SDK.
+ The Java 8 Development Kit (JDK) is required to develop apps with the Android
+ N Preview, and the Java 8 Runtime Environment (JRE) is required to run some
+ tools included in Android Studio 2.1.
</p>
+<p>So, if you don't have the latest version of each already,
+<a href="http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html">download JDK 8</a> and
+<a href="http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html">download JRE 8</a> now.</p>
-<p>To set the JDK version in Android Studio:</p>
+<p>With Java 8 installed, set the JDK version in Android Studio as follows:</p>
-<ul>
- <li>Make sure you have installed the Java 8 JDK, and make a note of its
- directory location on your development computer.</li>
- <li>With a development project open in Android Studio, open the
- <em>Project Structure</em> dialog by choosing <strong>File >
+<ol>
+ <li>Open an Android project in Android Studio, then open the
+ Project Structure dialog by selecting <strong>File >
Project Structure</strong>.
</li>
<li>In the left panel of the dialog, click <strong>SDK Location</strong>.
</li>
<li>In the <strong>JDK Location</strong> field, enter the location of the
- Java 8 JDK, and click <strong>OK</strong>.
+ Java 8 JDK, then click <strong>OK</strong>.
</li>
-</ul>
-
-
-<h2 id="get-sdk">Get the Preview SDK</h2>
-
-<p>To add the Preview SDK to your Android Studio 2.1 development
- environment:</p>
-
-<ol>
- <li>Launch Android Studio 2.1.
- </li>
-
- <li>In Android Studio, open the <em>Settings</em> dialog and in the left
- panel, choose <strong>Appearance & Behavior > System Settings >
- Updates</strong>.
- <ul>
- <li>On Windows and Linux, open <em>Settings</em> by choosing
- <strong>File > Settings</strong>.
- </li>
- <li>On Mac OS, open <em>Settings</em> by choosing
- <strong>Android Studio > Preferences</strong>.
- </li>
- </ul>
- </li>
-
- <li>On the <em>Updates</em> panel, make sure the <strong>Automatically
- check updates for Android SDK</strong> option is selected and choose the
- <strong>Preview Channel</strong> option.
- </li>
-
- <li>In the <em>Settings</em> dialog left panel, choose
- <strong>Appearance & Behavior > System Settings >
- Android SDK</strong>.
- </li>
-
- <li>Click the <strong>SDK Platforms</strong> button, and then select
- <strong>Android N Preview</strong>.
- </li>
-
- <li>Click the <strong>SDK Tools</strong> button, and select the latest
- Android <strong>SDK Tools</strong>, <strong>Platform-tools</strong>, and
- <strong>Build-tools</strong> versions.
- </li>
-
- <li>Click <strong>OK</strong> and then accept the licensing
- agreements for the packages to be installed.
- </li>
</ol>
-<p>After completing these steps, the preview components are available in your
- development environment. </p>
-
-<h2 id="create-update">Create or Update a Project</h2>
+<h2 id="create-update">Update or Create a Project</h2>
<p>
- In order to use the preview APIs, you must create or update a development
- project to use the preview components.
+ To use the N Preview APIs, your project must be configured appropriately.
</p>
-<h3 id="create">Create a new project</h3>
-
-<p>
- Use the Android Studio new project wizard to create a project. For detailed
- information on how to create a project with this too, see
- <a href="{@docRoot}sdk/installing/create-project.html">Creating a Project</a>.
-</p>
-
-<p>To create a new project using the Preview SDK:</p>
-
-<ol>
- <li>Start the New Project wizard and follow the steps until you reach the
- <em>Target Android Devices</em> page.
- </li>
- <li>On this page, select <strong>Phone and Tablet</strong> option.</li>
- <li>Under <strong>Phone and Tablet</strong> option, in the <strong>Minimum
- SDK</strong> option list, select <strong>Android N Preview</strong>.</li>
-</ol>
-
-
<h3 id="update">Update an existing project</h3>
-<p>
- For existing projects, you must modify the project configuration to use the
- Preview APIs. In your development environment, open the
- <code>build.gradle</code> file for your module and set these values as
+<p>Open the
+ <code>build.gradle</code> file for your module and update the values as
follows:
</p>
<pre>
android {
compileSdkVersion <strong>'android-N'</strong>
+ buildToolsVersion <strong>24.0.0</strong>
...
defaultConfig {
@@ -210,59 +180,29 @@
}</pre>
+<h3 id="create">Create a new project</h3>
-<h2 id="setup-test">Set Up for Testing</h2>
-<p>
- Testing an app with the preview requires that you have a device or virtual
- device configured with the preview version of the platform. If you have a
- compatible device, you can install the preview platform for testing.
- Otherwise, you can configure a virtual device for testing.
-</p>
-
-<h3 id="setup-device">Set up a physical device</h3>
-
-<p>
- If you have a Nexus 5X, Nexus 6P, Nexus 9, or Nexus Player, you can install a
- preview system image on these devices for testing your app. You can set up a
- virtual device with the preview version of the platform from within Android
- Studio using the Android Virtual Device Manager tool.
-</p>
-
-<p class="caution">
- <strong>Important:</strong> Installing a preview image on a device
- <em>removes all data from it</em>, so you should backup any data before
- installing a preview image.
-</p>
-
-<h3 id="setupAVD">Set up a virtual device</h3>
-
-<p>
- You can set up virtual device with the preview version of the platform from
- within Android Studio using the Android Virtual Device Manager tool.
-</p>
-
-<p>To create an AVD with the AVD Manager:</p>
+<p>To create a new project for development with the N Preview SDK:</p>
<ol>
- <li>Install the Preview SDK in your development environment, as described
- in <a href="{@docRoot}preview/setup-sdk.html">Setting Up the Preview
- SDK.</a></li>
- <li>Follow the steps in
- <a href="{@docRoot}tools/devices/managing-avds.html">Managing AVDs with AVD
- Manager</a>. Use the following settings:
- <ul>
- <li><strong>Device:</strong>
- Nexus 5X, Nexus 6P, Nexus 9, or Android TV</li>
- <li><strong>Target:</strong>
- Android N (Preview) - API Level N</li>
- <li><strong>ABI:</strong>
- x86</li>
- </ul>
+ <li>Click <strong>File > New Project</strong>. and follow the steps until
+ you reach the Target Android Devices page.
</li>
+ <li>On this page, select <strong>Phone and Tablet</strong> option.</li>
+ <li>Under <strong>Phone and Tablet</strong> option, in the <strong>Minimum
+ SDK</strong> option list, select
+ <strong>N: Android API 23, N Preview (Preview)</strong>.</li>
</ol>
-<p>
- For more information about creating virtual devices for testing, see <a href=
- "{@docRoot}tools/devices/index.html">Managing Virtual Devices</a>.
-</p>
+
+<h2 id="next">Next Steps</h2>
+
+<p>Now that you've set up Android Studio 2.1 (preview), follow the guide
+to <a
+href="{@docRoot}preview/run-app.html">Run Your App on the N Preview</a>.
+And learn more about the Android N Preview platform with
+<a href="{@docRoot}preview/behavior-changes.html">Behavior Changes</a>
+and <a href="{@docRoot}preview/api-overview.html">Android N APIs
+and Features</a>.</p>
+