docs: Android March 2016 Dashboard update
am: 59c43470bd
* commit '59c43470bd3b6911e5222d3757aeccef1b760410':
docs: Android March 2016 Dashboard update
diff --git a/docs/html/develop/index.jd b/docs/html/develop/index.jd
index 3b29318..460d056 100644
--- a/docs/html/develop/index.jd
+++ b/docs/html/develop/index.jd
@@ -63,7 +63,6 @@
<h2 class="norule">Latest</h2>
<div class="resource-widget resource-flow-layout col-16"
data-query="type:youtube+tag:develop+tag:featured, type:blog+tag:develop+tag:featured"
- data-query="collection:develop/landing/latest"
data-sortOrder="-timestamp"
data-cardSizes="6x6"
data-items-per-page="6"
diff --git a/docs/html/images/cards/card-n-apis_2x.png b/docs/html/images/cards/card-n-apis_2x.png
new file mode 100644
index 0000000..296ea6c
--- /dev/null
+++ b/docs/html/images/cards/card-n-apis_2x.png
Binary files differ
diff --git a/docs/html/images/cards/card-n-changes_2x.png b/docs/html/images/cards/card-n-changes_2x.png
new file mode 100644
index 0000000..7d08e37
--- /dev/null
+++ b/docs/html/images/cards/card-n-changes_2x.png
Binary files differ
diff --git a/docs/html/images/cards/card-n-downloads_2x.png b/docs/html/images/cards/card-n-downloads_2x.png
new file mode 100644
index 0000000..febc661
--- /dev/null
+++ b/docs/html/images/cards/card-n-downloads_2x.png
Binary files differ
diff --git a/docs/html/images/cards/card-n-overview_2x.png b/docs/html/images/cards/card-n-overview_2x.png
new file mode 100644
index 0000000..2c7392a
--- /dev/null
+++ b/docs/html/images/cards/card-n-overview_2x.png
Binary files differ
diff --git a/docs/html/images/cards/card-n-samples_2x.png b/docs/html/images/cards/card-n-samples_2x.png
new file mode 100644
index 0000000..d6621eb
--- /dev/null
+++ b/docs/html/images/cards/card-n-samples_2x.png
Binary files differ
diff --git a/docs/html/images/cards/card-n-sdk_2x.png b/docs/html/images/cards/card-n-sdk_2x.png
new file mode 100644
index 0000000..05d2eb9
--- /dev/null
+++ b/docs/html/images/cards/card-n-sdk_2x.png
Binary files differ
diff --git a/docs/html/images/cards/card-n-support_2x.png b/docs/html/images/cards/card-n-support_2x.png
new file mode 100644
index 0000000..0aec6cf
--- /dev/null
+++ b/docs/html/images/cards/card-n-support_2x.png
Binary files differ
diff --git a/docs/html/images/home/n-preview-hero.png b/docs/html/images/home/n-preview-hero.png
new file mode 100644
index 0000000..b9636dd
--- /dev/null
+++ b/docs/html/images/home/n-preview-hero.png
Binary files differ
diff --git a/docs/html/images/home/n-preview-hero_2x.png b/docs/html/images/home/n-preview-hero_2x.png
new file mode 100644
index 0000000..c59d195
--- /dev/null
+++ b/docs/html/images/home/n-preview-hero_2x.png
Binary files differ
diff --git a/docs/html/images/n-preview-updates-narrow_2x.png b/docs/html/images/n-preview-updates-narrow_2x.png
new file mode 100644
index 0000000..cf2ad90
--- /dev/null
+++ b/docs/html/images/n-preview-updates-narrow_2x.png
Binary files differ
diff --git a/docs/html/images/n-preview-updates_2x.png b/docs/html/images/n-preview-updates_2x.png
new file mode 100644
index 0000000..ec64d68
--- /dev/null
+++ b/docs/html/images/n-preview-updates_2x.png
Binary files differ
diff --git a/docs/html/index.jd b/docs/html/index.jd
index 1777e72..6066531 100644
--- a/docs/html/index.jd
+++ b/docs/html/index.jd
@@ -16,39 +16,37 @@
})
</script>
-<!-- <div class="dac-hero-carousel" data-carousel-query="collection:index/carousel">
-</div> -->
-<section class="dac-hero-carousel">
-
-<!-- <article class="dac-expand dac-hero dac-invert active" style="background-color: rgb(38, 50, 56);"> -->
-<article class="dac-expand dac-hero dac-invert dac-darken mprev active" style="background-color: #75d1ff;">
-<a href="about/versions/marshmallow/index.html">
+<section class="dac-expand dac-hero dac-invert" style="background-color:#455A64">
<div class="wrap" style="max-width:1100px;margin-top:0">
- <div class="cols dac-hero-content">
- <div class="col-8of16 col-push-6of16 dac-hero-figure mprev">
- </div>
- <div class="col-8of16 col-pull-7of16">
- <div class="dac-hero-tag"></div>
-
- <h1 class="dac-hero-title" style="white-space:nowrap;">Android 6.0 Marshmallow</h1>
- </div>
- <div class="col-6of16 col-push-1of16">
- <p class="dac-hero-description" style="color:white"><strong>The
- official Android 6.0 SDK is now available!</strong>
- Explore what's new — runtime permissions,
- Doze and App Standby power-saving features, new
- assist technology, and more.</p>
-
- <a class="dac-hero-cta" href="{@docRoot}about/versions/marshmallow/index.html">
+ <div class="col-7of16 col-push-9of16" style="padding-left:2em;">
+ <a href="{@docRoot}preview/index.html">
+ <h1 class="dac-hero-title">Android N Developer Preview</h1>
+ <p class="dac-hero-description">
+ Get ready for the next version of Android!
+ <strong>Test your apps</strong> on Nexus and other devices. Support new system
+ behaviors to <strong>save power and memory</strong>.
+ Extend your apps with <strong>multiwindow UI</strong>,
+ <strong>direct reply notifications</strong> and more.
+ </p>
+ <a class="dac-hero-cta" href="/preview/index.html">
<span class="dac-sprite dac-auto-chevron"></span>
Learn more
- </a><br>
- </div>
- </div>
+ </a><!--<br>
+ <a class="dac-hero-cta" href="/preview/support.html">
+ <span class="dac-sprite dac-auto-chevron"></span>
+ Update to Developer Preview (final SDK)
+ </a><br>-->
+ </a>
+ </div>
+ <div class="col-9of16 col-pull-7of16 dac-hero-figure" style="margin-top:0em;padding-right:1.5em;">
+ <a href="{@docRoot}preview/index.html">
+ <img style="" class="dac-hero-image" src="/images/home/n-preview-hero.png"
+ srcset="/images/home/n-preview-hero.png 1x,
+ /images/home/n-preview-hero_2x.png 2x">
+ </a>
</div>
</div>
-</a>
-</article></section>
+</section>
<div id="useUpdatedTemplates" style="display:none" class="dac-section dac-slim dac-gray dac-expand">
<div class="wrap dac-offset-parent">
@@ -59,7 +57,7 @@
<li class="dac-action">
<a class="dac-action-link" href="{@docRoot}sdk/index.html">
<i class="dac-action-sprite dac-sprite dac-auto-chevron-large"></i>
- Get the SDK
+ Get Android Studio
</a>
</li>
<li class="dac-action">
@@ -86,7 +84,7 @@
<div class="actions">
<div><a href="{@docRoot}sdk/index.html">
<span class="dac-sprite dac-auto-chevron-large"></span>
- Get the SDK
+ Get Android Studio
</a></div>
<div><a href="{@docRoot}samples/index.html">
<span class="dac-sprite dac-auto-chevron-large"></span>
diff --git a/docs/html/jd_collections.js b/docs/html/jd_collections.js
index fd76d19..31539da 100644
--- a/docs/html/jd_collections.js
+++ b/docs/html/jd_collections.js
@@ -16,8 +16,8 @@
"index/secondary/carousel": {
"title": "",
"resources": [
- "http://www.youtube.com/watch?v=Pms0pcyPbAM",
"http://www.youtube.com/watch?v=9m6MoBM-sFI",
+ "http://www.youtube.com/watch?v=Pms0pcyPbAM",
"http://www.youtube.com/watch?v=e7t3svG9PTk",
"http://www.youtube.com/watch?v=J3IvOfvH1ys"
]
@@ -135,6 +135,32 @@
"https://www.youtube.com/watch?v=5Be2mJzP-Uw&list=PLWz5rJ2EKKc9e0d55YHgJFHXNZbGHEXJX"
]
},
+ "preview/landing/resources": {
+ "title": "",
+ "resources": [
+ "preview/overview.html",
+ "preview/api-overview.html",
+ "preview/behavior-changes.html",
+ "preview/setup-sdk.html",
+ "preview/samples.html",
+ "preview/support.html"
+ ]
+ },
+ "preview/landing/more": {
+ "title": "",
+ "resources": [
+ "preview/features/multi-window.html",
+ "preview/features/notification-updates.html",
+ "preview/features/background-optimization.html",
+ "preview/features/data-saver.html",
+ "preview/features/direct-boot.html",
+ "preview/features/icu4j-framework.html",
+ "preview/features/multilingual-support.html",
+ "preview/features/scoped-folder-access.html",
+ "preview/features/picture-in-picture.html",
+ "preview/features/tv-recording-api.html"
+ ]
+ },
"google/landing/services": {
"title": "",
"resources": [
diff --git a/docs/html/jd_extras_en.js b/docs/html/jd_extras_en.js
index d35dbb54..f43ddd6 100644
--- a/docs/html/jd_extras_en.js
+++ b/docs/html/jd_extras_en.js
@@ -4718,6 +4718,32 @@
"sdk/installing/studio-tips.html",
]
},
+ "preview/landing/resources": {
+ "title": "",
+ "resources": [
+ "preview/overview.html",
+ "preview/api-overview.html",
+ "preview/behavior-changes.html",
+ "preview/setup-sdk.html",
+ "preview/samples.html",
+ "preview/support.html"
+ ]
+ },
+ "preview/landing/more": {
+ "title": "",
+ "resources": [
+ "preview/features/multi-window.html",
+ "preview/features/notification-updates.html",
+ "preview/features/background-optimization.html",
+ "preview/features/data-saver.html",
+ "preview/features/direct-boot.html",
+ "preview/features/icu4j-framework.html",
+ "preview/features/multilingual-support.html",
+ "preview/features/scoped-folder-access.html",
+ "preview/features/picture-in-picture.html",
+ "preview/features/tv-recording-api.html"
+ ]
+ }
};
/**
diff --git a/docs/html/jd_tag_helpers.js b/docs/html/jd_tag_helpers.js
index 7538e4d..1c26c59 100644
--- a/docs/html/jd_tag_helpers.js
+++ b/docs/html/jd_tag_helpers.js
@@ -15,6 +15,7 @@
SAMPLES_RESOURCES,
TOOLS_RESOURCES,
TRAINING_RESOURCES,
+ PREVIEW_RESOURCES,
YOUTUBE_RESOURCES,
BLOGGER_RESOURCES
);
@@ -72,6 +73,7 @@
'samples': SAMPLES_RESOURCES,
'tools': TOOLS_RESOURCES,
'training': TRAINING_RESOURCES,
+ 'preview': PREVIEW_RESOURCES,
'youtube': YOUTUBE_RESOURCES,
'blog': BLOGGER_RESOURCES
};
diff --git a/docs/html/preview/api-overview.jd b/docs/html/preview/api-overview.jd
new file mode 100644
index 0000000..16594eb
--- /dev/null
+++ b/docs/html/preview/api-overview.jd
@@ -0,0 +1,11 @@
+page.title=API Overview
+meta.tags="preview", "androidn"
+page.tags="preview", "developer preview"
+page.image=images/cards/card-n-apis_2x.png
+@jd:body
+
+<p>
+This page is under construction. For now, please see
+<a href="https://docs.google.com/document/d/1TA8Vzoa7KQ99bj1GVD81ps3Ux4wY0Ctkz7dC7bNnslU/edit">
+this page</a> for information.
+</p>
diff --git a/docs/html/preview/behavior-changes.jd b/docs/html/preview/behavior-changes.jd
new file mode 100644
index 0000000..6be7f5d
--- /dev/null
+++ b/docs/html/preview/behavior-changes.jd
@@ -0,0 +1,490 @@
+page.title=Behavior Changes
+page.keywords=preview,sdk,compatibility
+meta.tags="preview", "compatibility"
+page.tags="preview", "developer preview"
+page.image=images/cards/card-n-changes_2x.png
+@jd:body
+
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>In this document</h2>
+
+<ol>
+ <li><a href="#perf">Performance Improvements</a>
+ <ol>
+ <li><a href="#doze">Doze</a></li>
+ <li><a href="#bg-opt">Background Optimizations</a></li>
+ </ol>
+ </li>
+ <li><a href="#perm">Permissions Changes</a></li>
+ <li><a href="#accessibility">Accessibility Improvements</a>
+ <ol>
+ <li><a href="#screen-zoom">Screen Zoom</a></li>
+ <li><a href="#vision-settings">Vision Settings in Setup Wizard</a></li>
+ </ol>
+ </li>
+ <li><a href="#open-jdk">Platform Migration toward OpenJDK 8</a></li>
+ <li><a href="#ndk">NDK Apps Linking to Platform Libraries</a></li>
+ <li><a href="#afw">Android for Work</a></li>
+</ol>
+
+<h2>See Also</h2>
+<ol>
+ <li><a href="{@docRoot}preview/api-overview.html">
+ N Developer Preview API Overview</a></li>
+</ol>
+
+</div>
+</div>
+
+
+<p>
+ Along with new features and capabilities, the Android N Developer Preview
+ includes a variety of system and API behavior changes. This document
+ highlights some of the key changes that you should understand and account for
+ in your apps.
+</p>
+
+<p>
+ If you have previously published an app for Android, be aware that your app
+ might be affected by these changes in the platform.
+</p>
+
+
+<h2 id="perf">Performance Improvements</h2>
+
+<p>
+ The Preview contains system behavior changes aimed at improving the battery
+ life of devices, RAM usage, and app performance. These changes can impact the
+ availability of system resources and system notifications to your app. You
+ should review these changes and evaluate how your app may need to adjust to
+ them.
+</p>
+
+<h3 id="doze">Doze</h3>
+
+<p>
+ Introduced in Android 6.0 (API level 23), Doze improves battery life by
+ deferring CPU and network activities when a user leaves a device unplugged,
+ stationary, and with the screen turned off. This Preview brings further
+ enhancements to Doze by applying a subset of CPU and network restrictions
+ while the device is unplugged with the screen turned off, but not necessarily
+ stationary, for example, when a handset is traveling in a user’s pocket.
+</p>
+
+
+<img src="{@docRoot}preview/images/doze-diagram-1.png"
+ alt="" height="251px" id="figure1" />
+<p class="img-caption">
+ <strong>Figure 1.</strong> Illustration of how Doze applies a first level of
+ system activity restrictions to improve battery life.
+</p>
+
+<p>
+ When a device is on battery power, and the screen has been off for a certain
+ time, the device enters Doze and applies the first subset of restrictions: It
+ shuts off app network access, and defers jobs and syncs. If the device is
+ stationary for a certain time after entering Doze, the system applies the
+ rest of the Doze restrictions to {@link android.os.PowerManager.WakeLock},
+ {@link android.app.AlarmManager} alarms, GPS, and Wi-Fi scans.. Regardless of
+ whether some or all Doze restrictions are being applied, the system wakes the
+ device for brief maintenance windows, during which applications are allowed
+ network access and can execute any deferred jobs/syncs.
+</p>
+
+
+<img src="{@docRoot}preview/images/doze-diagram-2.png"
+ alt="" id="figure2" />
+<p class="img-caption">
+ <strong>Figure 2.</strong> Illustration of how Doze applies a second level of
+ system activity restrictions after the device is stationary for a certain time.
+</p>
+
+<p>
+ Note that activating the screen on or plugging in the device exits Doze and
+ removes these processing restrictions. The additional behavior does not
+ affect recommendations and best practices in adapting your app to the prior
+ version of Doze introduced in Android 6.0 (API level 23), as discussed in
+ <a href=”{@docRoot}/training/monitoring-device-state/doze-standby.html”>
+ Optimizing for Doze and App Standby</a>. You should still
+ follow those recommendations, such as using Google Cloud Messaging (GCM) to
+ send and receive messages, and start planning updates to accomodate the
+ additional Doze behavior.
+</p>
+
+
+<h3 id="bg-opt">Project Svelte: Background Optimizations</h3>
+
+<p>
+ The Preview removes three implicit broadcasts in order to help optimize both
+ memory use and power consumption. This change is necessary because implicit
+ broadcasts frequently start apps that have registered to listen for them in
+ the background. Removing these broadcasts can substantially benefit device
+ performance and user experience.
+</p>
+
+<p>
+ Mobile devices experience frequent connectivity changes, such as when moving
+ between Wi-Fi and mobile data. Currently, apps can monitor for changes in
+ connectivity by registering a receiver for the implicit {@link
+ android.net.ConnectivityManager#CONNECTIVITY_ACTION} broadcast in their
+ manifest. Since many apps register to receive this broadcast, a single
+ network switch can cause them all to wake up and process the broadcast at
+ once.
+</p>
+
+<p>
+ Similarly, apps can register to receive implicit {@code NEW_PICTURE} and
+ {@code NEW_VIDEO} broadcasts from other apps, such as Camera. When a user
+ takes a picture with the Camera app, these apps wake up to process the
+ broadcast.
+</p>
+
+<p>
+ To alleviate these issues, the Preview applies the following
+ optimizations:
+</p>
+
+<ul>
+ <li>Apps targeting the Preview do not receive {@link
+ android.net.ConnectivityManager#CONNECTIVITY_ACTION} broadcasts, even if they
+ have manifest entries to request notification of these events. Apps running
+ in the foreground can still listen for {@code CONNECTIVITY_CHANGE} on their
+ main thread if they request notification with a
+ {@link android.content.BroadcastReceiver}.
+ </li>
+
+ <li>Apps cannot send or receive {@code NEW_PICTURE} or {@code NEW_VIDEO}
+ broadcasts. This optimization affects all apps, not only those
+ targeting the Preview.
+ </li>
+</ul>
+
+<p>
+ Future releases of Android may deprecate additional implicit broadcasts, as
+ well as unbound background services. For this reason, you should avoid or
+ remove dependencies on manifest-declared receivers for implicit broadcasts,
+ as well as on background services.
+</p>
+
+<p>
+ The Android framework provides several solutions to mitigate the need for
+ these implicit broadcasts or background services. For example, the {@link
+ android.app.job.JobScheduler} API provides a robust mechanism to schedule
+ network operations when specified conditions, such as connection to an
+ unmetered network, are met. You can even use {@link
+ android.app.job.JobScheduler} to react to changes to content providers.
+</p>
+
+<p>
+ For more information about this behavior change and how to adapt your app,
+ see <a href=
+ "{@docRoot}preview/features/background-optimization.html">Background
+ Optimizations</a>.
+</p>
+
+
+<h2 id="perm">Permissions Changes</h2>
+
+<p>
+ The Preview includes changes to permissions that may affect your app,
+ including user accounts permissions and a new permission for writing to
+ external storage. Here is a summary of the permissions that have changed in
+ the preview:
+</p>
+
+<ul>
+ <li>{@code GET_ACCOUNTS} (Deprecated)
+ <p>
+ The GET_ACCOUNTS permission is now deprecated. The system ignores this
+ permission for apps that target the N Developer Preview.
+ </p>
+ </li>
+
+ <li>{@code ACTION_OPEN_EXTERNAL_DIRECTORY} (New)
+ <p>
+ This permission is for a new storage option. Apps can now use the intent
+ {@code ACTION_OPEN_EXTERNAL_DIRECTORY} to request that the system create a
+ directory for the app's use. The system prompts the user to grant
+ approval. If the user approves, the app can read and write files and
+ directories in that one directory (and its descendants). The app does not
+ need {@link android.Manifest.permission_group#STORAGE STORAGE}
+ permissions to access this external directory
+ </p>
+
+ <p>
+ For more information about this intent, see the updated
+ {@code Intent} reference documentation in the
+ <a href="{@docRoot}preview/download.html#docs">N Preview SDK Reference</a>.
+ </p>
+ </li>
+</ul>
+
+
+
+<h2 id="accessibility">Accessibility Improvements</h2>
+
+<p>
+ This Preview includes changes intended to improve the usability of the
+ platform for users with low or impaired vision. These changes should
+ generally not require code changes in your app, however you should review
+ these feature and test them with your app to assess potential impacts to user
+ experience.
+</p>
+
+
+<h3 id="screen-zoom">Screen Zoom</h3>
+
+<p>
+ The Preview enables users to set <strong>Display size</strong>which magnifies
+ or shrinks all elements on the screen, thereby improving device accessibility
+ for users with low vision. Users cannot zoom the screen past a minimum screen
+ width of <a href=
+ "http://developer.android.com/guide/topics/resources/providing-resources.html">
+ sw320dp</a>, which is the width of a Nexus 4, a common medium-sized phone.
+</p>
+
+<div class="cols">
+
+<div class="col-6">
+ <img src="{@docRoot}preview/images/screen-zoom-1.png" alt="" height="XXX" id="figure1" />
+</div>
+<div class="col-6">
+ <img src="{@docRoot}preview/images/screen-zoom-2.png" alt="" height="XXX" id="figure1" />
+</div>
+
+</div> <!-- end cols -->
+<p class="img-caption">
+ <strong>Figure 3.</strong> The screen on the right shows the effect of
+ increasing the Display size of a device running an N Preview system image.
+</p>
+
+
+<p>
+ When the device density changes, the system notifies running apps in the
+ following ways:
+</p>
+
+<ul>
+ <li>If an app targets API level 23 or lower, the system automatically kills
+ all its background processes. This means that if a user switches away from
+ such an app to open the <em>Settings</em> screen and changes the
+ <strong>Display size</strong> setting, the system kills the app in the same
+ manner that it would in a low-memory situation. If the app has any foreground
+ processes, the system notifies those processes of the configuration change as
+ described in <a href="{@docRoot}guide/topics/resources/runtime-changes.html">Handling
+ Runtime Changes</a>, just as if the device's orientation had changed.
+ </li>
+
+ <li>If an app targets the N Developer Preview, all of its processes
+ (foreground and background) are notified of the configuration change as
+ described in <a href=
+ "{@docRoot}guide/topics/resources/runtime-changes.html">Handling
+ Runtime Changes</a>.
+ </li>
+</ul>
+
+<p>
+ Most apps do not need to make any changes to support this feature, provided
+ the apps follow Android best practices. You should verify that your app
+ behaves properly under Screen Zoom.
+</p>
+
+
+<h3 id="vision-settings">Vision Settings in Setup Wizard</h3>
+
+<p>
+ The Preview includes Vision Settings on the Welcome screen, where users can
+ set up the following accessibility settings on a new device:
+ <strong>Magnification gesture</strong>, <strong>Font size</strong>,
+ <strong>Display size</strong> and <strong>TalkBack</strong>. This change
+ increases the visibility of bugs related to different screen settings. To
+ assess the impact of this feature, you should test your apps with these
+ settings enabled. You can find the settings under <strong>Settings >
+ Accessibility</strong>.
+</p>
+
+
+<h2 id="open-jdk">Platform Migration toward OpenJDK 8</h2>
+
+<p>
+ The Preview moves Android’s Java language libraries to an OpenJDK-based
+ approach, creating a common code base for developers to build apps and
+ services. If your app depends on a private implementation of Java or
+ unspecified behavior, you should be aware of these known issues:
+</p>
+
+<ul>
+ <li>The {@code ArrayList} private field array is removed.
+ <p>
+ If your app, or a library it used, was dependent on a private field of
+ the ArrayList class, you may encounter an exception such as:
+ </p>
+<pre>
+java.lang.NoSuchFieldException: No field array in class Ljava/util/ArrayList;
+</pre>
+ </li>
+
+ <li>Calling a {@code Comparator} implementation with equal elements is
+ possible.
+ <p>
+ You can now call implementations of Comparator to compare an element to
+ itself. However, doing so may cause problems if the Comparator expects to
+ be called only with unique arguments.
+ </p>
+ </li>
+
+ <li>Crypto security provider has been removed.
+ <p>
+ You should only call to the Java Cryptography Extension (JCE) APIs with a
+ provider listed if the provider is included in the code of the APK.
+ Otherwise, your app needs to be able to handle the provider’s absence.
+ </p>
+
+ <p>
+ The reason apps use this provider is to take advantage of its
+ SecureRandom implementation. If your app was relying on setSeed() to
+ derive keys from strings, you must either switch to using SecretKeySpec
+ to load raw key bytes directly, or use a real key derivation function
+ (KDF).
+ </p>
+ </li>
+</ul>
+
+
+<h2 id="ndk">NDK Apps Linking to Platform Libraries</h2>
+
+<p>
+ The Preview includes namespace changes to prevent loading of non-public APIs.
+ If you use the NDK, you should only be using public APIs from the Android
+ platform. Using non-public APIs in the next official release of Android
+ can cause your app to crash.
+</p>
+
+<p>
+ In order to alert you to use of non-public APIs, apps running on a Preview
+ device generate an error in logcat output when an app calls a non-public API.
+ This error is also displayed on the device screen as a message to help
+ raise awareness of this situation. You should review your app code to
+ remove use of non-public platform APIs and thoroughly test your apps using
+ a preview device or emulator.
+</p>
+
+<p>
+ If your app depends on platform libraries, see the NDK documentation for
+ typical fixes for replacing common private APIs with public API equivalents.
+ You may also be linking to platform libraries without realizing it,
+ especially if your app uses a library that is part of the platform (such as
+ <code>libpng</code>), but is not part of the NDK. In that case, ensure that
+ your APK contains all the .so files you intended to link against.
+</p>
+
+<p class="caution">
+ <strong>Caution:</strong> Some third-party libraries may link to non-public
+ APIs. If your app uses these libraries, your app may crash when running
+ on the next official release of Android.
+</p>
+
+<p>
+ Apps should not depend on or use native libraries that are not included in
+ the NDK, because they may change, or be removed from one Android release to
+ another. The switch from OpenSSL to BoringSSL is an example of such a change.
+ Also, different devices may offer different levels of compatibility, because
+ there are no compatibility requirements for platform libraries not included
+ in the NDK. If you must access non-NDK libraries on older devices, make the
+ loading dependent on the Android API level.
+</p>
+
+<p>
+ To help you diagnose these types problems here are some example Java and NDK
+ errors you might encounter when attempting to build your app with the N
+ Developer Preview:
+</p>
+
+<p>Example Java error:</p>
+<pre>
+java.lang.UnsatisfiedLinkError: dlopen failed: library "/system/lib/libcutils.so"
+ is not accessible for the namespace "classloader-namespace"
+</pre>
+
+<p>Example NDK error:</p>
+<pre>
+dlopen failed: cannot locate symbol "__system_property_get" referenced by ...
+</pre>
+
+
+<p>
+ Here are some typical fixes for apps encountering these types of errors:
+</p>
+
+<ul>
+ <li>Use of getJavaVM and getJNIEnv from libandroid_runtime.so can be replaced
+ with standard JNI functions:
+<pre>
+AndroidRuntime::getJavaVM -> GetJavaVM from <jni.h>
+AndroidRuntime::getJNIEnv -> JavaVM::GetEnv or
+JavaVM::AttachCurrentThread from <jni.h>.
+</pre>
+ </li>
+
+ <li>Use of {@code property_get} symbol from {@code libcutils.so} can be
+ replaced with the public {@code alternative __system_property_get}:
+<pre>
+#include <sys/system_properties.h> and use __system_property_get
+</pre>
+ </li>
+
+ <li>Use of {@code SSL_ctrl} symbol from {@code libcrypto.so} should be
+ replaced with an app local version. For example, you should statically link
+ {@code libcyrpto.a} in your {@code .so} file or include your own dynamically
+ {@code libcrypto.so} from BoringSSL or OpenSSL in your app.
+ </li>
+</ul>
+
+<h2 id="afw">Android for Work</h2>
+<p>
+ The Preview contains changes for apps that target Android for Work, including
+ changes to certificate installation, password resetting, secondary user
+ management, and access to device identifiers. If you are building apps for
+ Android for Work environments, you should review these changes and modify
+ your app accordingly.
+</p>
+
+<ul>
+ <li>You must install a delegated certificate installer before the DPC can set
+ it. For both profile and device-owner apps targeting the N SDK, you should
+ install the delegated certificate installer before the device policy
+ controller (DPC) calls
+ <code>DevicePolicyManager.setCertInstallerPackage()</code>. If the installer
+ is not already installed, the system throws an
+ <code>IllegalArgumentException</code>.
+ </li>
+
+ <li>Reset password restrictions for device admins now apply to profile
+ owners.Device admins can no longer use
+ <code>DevicePolicyManager.resetPassword()</code>to clear passwords or change
+ ones that are already set. Device admins can still set a password, but only
+ when the device has no password, PIN, or pattern.
+ </li>
+
+ <li>Device and profile owners can manage accounts even if restrictions are
+ set.Device owners and profile owners can call the Account Management APIs
+ even if <code>DISALLOW_MODIFY_ACCOUNTS</code> user restrictions are in place.
+ </li>
+
+ <li>Device owners can manage secondary users more easily.When a device is
+ running in device owner mode, the <code>DISALLOW_ADD_USER</code> restriction
+ is automatically set. This prevents users from creating unmanaged secondary
+ users. In addition, the <code>CreateUser()</code> and
+ <code>createAndInitial()</code> methods are deprecated; the new
+ <code>DevicePolicyManager.createAndManageUser()</code> method replaces them.
+ </li>
+
+ <li>Device owners can access device identifiers.A Device owner can access the
+ Wi-Fi MAC address of a device, using
+ <code>DevicePolicyManagewr.getWifiMacAddress()</code> . If Wi-Fi has never
+ been enabled on the device, this method returns a value of {@code null}.
+ </li>
+</ul>
diff --git a/docs/html/preview/download.jd b/docs/html/preview/download.jd
new file mode 100644
index 0000000..ac9fd12
--- /dev/null
+++ b/docs/html/preview/download.jd
@@ -0,0 +1,375 @@
+page.title=Getting System Updates
+page.image=images/cards/card-download_16-9_2x.png
+meta.tags="preview", "system image"
+page.tags="preview", "developer preview"
+page.image=images/cards/card-n-downloads_2x.png
+
+@jd:body
+
+<div style="position:relative; min-height:600px">
+
+ <div class="wrap" id="tos" style="position:absolute;display:none;width:inherit;">
+
+ <p class="sdk-terms-intro">Before downloading and installing components of
+ the Android Preview SDK, you must agree to the following terms and
+ conditions.</p>
+
+ <h2 class="norule">Terms and Conditions</h2>
+
+ <div class="sdk-terms" onfocus="this.blur()" style="width:678px">
+This is the Android SDK Preview License Agreement (the “License Agreement”).
+
+1. Introduction
+
+1.1 The Android SDK Preview (referred to in the License Agreement as the “Preview” and specifically including the Android system files, packaged APIs, and Preview library files, if and when they are made available) is licensed to you subject to the terms of the License Agreement. The License Agreement forms a legally binding contract between you and Google in relation to your use of the Preview.
+
+1.2 "Android" means the Android software stack for devices, as made available under the Android Open Source Project, which is located at the following URL: http://source.android.com/, as updated from time to time.
+
+1.3 "Google" means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States.
+
+2. Accepting the License Agreement
+
+2.1 In order to use the Preview, you must first agree to the License Agreement. You may not use the Preview if you do not accept the License Agreement.
+
+2.2 By clicking to accept and/or using the Preview, you hereby agree to the terms of the License Agreement.
+
+2.3 You may not use the Preview and may not accept the License Agreement if you are a person barred from receiving the Preview under the laws of the United States or other countries including the country in which you are resident or from which you use the Preview.
+
+2.4 If you will use the Preview internally within your company or organization you agree to be bound by the License Agreement on behalf of your employer or other entity, and you represent and warrant that you have full legal authority to bind your employer or such entity to the License Agreement. If you do not have the requisite authority, you may not accept the License Agreement or use the Preview on behalf of your employer or other entity.
+
+3. Preview License from Google
+
+3.1 Subject to the terms of the License Agreement, Google grants you a royalty-free, non-assignable, non-exclusive, non-sublicensable, limited, revocable license to use the Preview, personally or internally within your company or organization, solely to develop applications to run on the Android platform.
+
+3.2 You agree that Google or third parties owns all legal right, title and interest in and to the Preview, including any Intellectual Property Rights that subsist in the Preview. "Intellectual Property Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you.
+
+3.3 You may not use the Preview for any purpose not expressly permitted by the License Agreement. Except to the extent required by applicable third party licenses, you may not: (a) copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the Preview or any part of the Preview; or (b) load any part of the Preview onto a mobile handset or any other hardware device except a personal computer, combine any part of the Preview with other software, or distribute any software or device incorporating a part of the Preview.
+
+3.4 You agree that you will not take any actions that may cause or result in the fragmentation of Android, including but not limited to distributing, participating in the creation of, or promoting in any way a software development kit derived from the Preview.
+
+3.5 Use, reproduction and distribution of components of the Preview licensed under an open source software license are governed solely by the terms of that open source software license and not the License Agreement. You agree to remain a licensee in good standing in regard to such open source software licenses under all the rights granted and to refrain from any actions that may terminate, suspend, or breach such rights.
+
+3.6 You agree that the form and nature of the Preview that Google provides may change without prior notice to you and that future versions of the Preview may be incompatible with applications developed on previous versions of the Preview. You agree that Google may stop (permanently or temporarily) providing the Preview (or any features within the Preview) to you or to users generally at Google's sole discretion, without prior notice to you.
+
+3.7 Nothing in the License Agreement gives you a right to use any of Google's trade names, trademarks, service marks, logos, domain names, or other distinctive brand features.
+
+3.8 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the Preview.
+
+4. Use of the Preview by You
+
+4.1 Google agrees that nothing in the License Agreement gives Google any right, title or interest from you (or your licensors) under the License Agreement in or to any software applications that you develop using the Preview, including any intellectual property rights that subsist in those applications.
+
+4.2 You agree to use the Preview and write applications only for purposes that are permitted by (a) the License Agreement, and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries).
+
+4.3 You agree that if you use the Preview to develop applications, you will protect the privacy and legal rights of users. If users provide you with user names, passwords, or other login information or personal information, you must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If users provide you with Google Account information, your application may only use that information to access the user's Google Account when, and for the limited purposes for which, each user has given you permission to do so.
+
+4.4 You agree that you will not engage in any activity with the Preview, including the development or distribution of an application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the servers, networks, or other properties or services of Google or any third party.
+
+4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through Android and/or applications for Android, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so.
+
+4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any breach of your obligations under the License Agreement, any applicable third party contract or Terms of Service, or any applicable law or regulation, and for the consequences (including any loss or damage which Google or any third party may suffer) of any such breach.
+
+4.7 The Preview is in development, and your testing and feedback are an important part of the development process. By using the Preview, you acknowledge that implementation of some features are still under development and that you should not rely on the Preview having the full functionality of a stable release. You agree not to publicly distribute or ship any application using this Preview as this Preview will no longer be supported after the official Android SDK is released.
+
+5. Your Developer Credentials
+
+5.1 You agree that you are responsible for maintaining the confidentiality of any developer credentials that may be issued to you by Google or which you may choose yourself and that you will be solely responsible for all applications that are developed under your developer credentials.
+
+6. Privacy and Information
+
+6.1 In order to continually innovate and improve the Preview, Google may collect certain usage statistics from the software including but not limited to a unique identifier, associated IP address, version number of the software, and information on which tools and/or services in the Preview are being used and how they are being used. Before any of this information is collected, the Preview will notify you and seek your consent. If you withhold consent, the information will not be collected.
+
+6.2 The data collected is examined in the aggregate to improve the Preview and is maintained in accordance with Google's Privacy Policy located at http://www.google.com/policies/privacy/.
+
+7. Third Party Applications
+
+7.1 If you use the Preview to run applications developed by a third party or that access data, content or resources provided by a third party, you agree that Google is not responsible for those applications, data, content, or resources. You understand that all data, content or resources which you may access through such third party applications are the sole responsibility of the person from which they originated and that Google is not liable for any loss or damage that you may experience as a result of the use or access of any of those third party applications, data, content, or resources.
+
+7.2 You should be aware the data, content, and resources presented to you through such a third party application may be protected by intellectual property rights which are owned by the providers (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on these data, content, or resources (either in whole or in part) unless you have been specifically given permission to do so by the relevant owners.
+
+7.3 You acknowledge that your use of such third party applications, data, content, or resources may be subject to separate terms between you and the relevant third party.
+
+8. Using Google APIs
+
+8.1 Google APIs
+
+8.1.1 If you use any API to retrieve data from Google, you acknowledge that the data may be protected by intellectual property rights which are owned by Google or those parties that provide the data (or by other persons or companies on their behalf). Your use of any such API may be subject to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this data (either in whole or in part) unless allowed by the relevant Terms of Service.
+
+8.1.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree that you shall retrieve data only with the user's explicit consent and only when, and for the limited purposes for which, the user has given you permission to do so.
+
+9. Terminating the License Agreement
+
+9.1 the License Agreement will continue to apply until terminated by either you or Google as set out below.
+
+9.2 If you want to terminate the License Agreement, you may do so by ceasing your use of the Preview and any relevant developer credentials.
+
+9.3 Google may at any time, terminate the License Agreement, with or without cause, upon notice to you.
+
+9.4 The License Agreement will automatically terminate without notice or other action upon the earlier of:
+(A) when Google ceases to provide the Preview or certain parts of the Preview to users in the country in which you are resident or from which you use the service; and
+(B) Google issues a final release version of the Android SDK.
+
+9.5 When the License Agreement is terminated, the license granted to you in the License Agreement will terminate, you will immediately cease all use of the Preview, and the provisions of paragraphs 10, 11, 12 and 14 shall survive indefinitely.
+
+10. DISCLAIMERS
+
+10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE PREVIEW IS AT YOUR SOLE RISK AND THAT THE PREVIEW IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE.
+
+10.2 YOUR USE OF THE PREVIEW AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE PREVIEW IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE. WITHOUT LIMITING THE FOREGOING, YOU UNDERSTAND THAT THE PREVIEW IS NOT A STABLE RELEASE AND MAY CONTAIN ERRORS, DEFECTS AND SECURITY VULNERABILITIES THAT CAN RESULT IN SIGNIFICANT DAMAGE, INCLUDING THE COMPLETE, IRRECOVERABLE LOSS OF USE OF YOUR COMPUTER SYSTEM OR OTHER DEVICE.
+
+10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+
+11. LIMITATION OF LIABILITY
+
+11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING.
+
+12. Indemnification
+
+12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Google, its affiliates and their respective directors, officers, employees and agents from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys’ fees) arising out of or accruing from (a) your use of the Preview, (b) any application you develop on the Preview that infringes any Intellectual Property Rights of any person or defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you of the License Agreement.
+
+13. Changes to the License Agreement
+
+13.1 Google may make changes to the License Agreement as it distributes new versions of the Preview. When these changes are made, Google will make a new version of the License Agreement available on the website where the Preview is made available.
+
+14. General Legal Terms
+
+14.1 the License Agreement constitutes the whole legal agreement between you and Google and governs your use of the Preview (excluding any services which Google may provide to you under a separate written agreement), and completely replaces any prior agreements between you and Google in relation to the Preview.
+
+14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is contained in the License Agreement (or which Google has the benefit of under any applicable law), this will not be taken to be a formal waiver of Google's rights and that those rights or remedies will still be available to Google.
+
+14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any provision of the License Agreement is invalid, then that provision will be removed from the License Agreement without affecting the rest of the License Agreement. The remaining provisions of the License Agreement will continue to be valid and enforceable.
+
+14.4 You acknowledge and agree that each member of the group of companies of which Google is the parent shall be third party beneficiaries to the License Agreement and that such other companies shall be entitled to directly enforce, and rely upon, any provision of the License Agreement that confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall be third party beneficiaries to the License Agreement.
+
+14.5 EXPORT RESTRICTIONS. THE PREVIEW IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE PREVIEW. THESE LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE.
+
+14.6 The License Agreement may not be assigned or transferred by you without the prior written approval of Google, and any attempted assignment without such approval will be void. You shall not delegate your responsibilities or obligations under the License Agreement without the prior written approval of Google.
+
+14.7 The License Agreement, and your relationship with Google under the License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from the License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction.
+ </div><!-- sdk terms -->
+
+
+
+ <div id="sdk-terms-form">
+ <p>
+ <input id="agree" type="checkbox" name="agree" value="1" onclick="onAgreeChecked()" />
+ <label id="agreeLabel" for="agree">I have read and agree with the above terms and conditions</label>
+ </p>
+ <p><a href="" class="button disabled" id="downloadForRealz" onclick="return onDownloadForRealz(this);"></a></p>
+ </div>
+
+
+ </div><!-- end TOS -->
+
+
+ <div id="landing">
+
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#sdk">Preview SDK</a></li>
+ <li><a href="#docs">Developer Documentation</a></li>
+ <li><a href="#images">Hardware System Images</a></li>
+ </ol>
+ </div>
+</div>
+
+
+<p>
+ The Android N Preview SDK includes development tools, Android system images,
+ and library files to help you test your app and the new APIs coming in the
+ next release of the platform. This document describes how to get the
+ downloadable components of the preview for testing your app.
+</p>
+
+
+<h2 id="sdk">Preview SDK</h2>
+
+<p>
+ The Preview SDK is available for download through the
+ <a href="{@docRoot}tools/help/sdk-manager.html">Android SDK Manager</a>.
+ For more information on downloading and configuring the SDK, see
+ <a href="{@docRoot}preview/setup-sdk.html#downloadSdk">Set Up the SDK</a>.
+</p>
+
+
+<h2 id="docs">Developer Documentation</h2>
+
+<p>
+ This download package provides detailed API reference
+ information and an API difference report for the preview.
+</p>
+
+<table>
+ <tr>
+ <th scope="col">Description</th>
+ <th scope="col">Download / Checksums</th>
+ </tr>
+ <tr id="docs-dl">
+ <td>Android N Preview 1<br>Developer Docs</td>
+ <td><a href="#top" onclick="onDownload(this)"
+ >n-preview-1-developer-docs.zip</a><br>
+ MD5: xxxx<br>
+ SHA-1: xxxx
+ </td>
+ </tr>
+<table>
+
+
+<h2 id="images">Hardware System Images</h2>
+
+<p>
+ These system images allow you to install a preview version of the platform on
+ a physical device for testing. By configuring a device with one of these
+ images, you can install and test your app to see how it performs on the next
+ version of the platform. The process of installing a system image on a device
+ <em>removes all data from the device</em>, so you should back up your data
+ before installing a system image.
+</p>
+
+<p class="warning">
+ <b>Warning:</b> The following Android system images are previews and are
+ subject to change. Your use of these system images is governed by the Android
+ SDK Preview License Agreement. The Android preview system images are not
+ stable releases, and may contain errors and defects that can result in damage
+ to your computer systems, devices, and data. The preview Android system
+ images are not subject to the same testing as the factory OS and can cause
+ your phone and installed services and applications to stop working.
+</p>
+
+<table>
+ <tr>
+ <th scope="col">Device</th>
+ <th scope="col">Download / Checksums</th>
+ </tr>
+
+ <tr id="hammerhead">
+ <td>Nexus 5X <br>"bullhead"</td>
+ <td><a href="#top" onclick="onDownload(this)"
+ >bullhead-Nxxxx-preview-xxxxxxx.tgz</a><br>
+ MD5: xxxxxxx<br>
+ SHA-1: xxxxxxx
+ </td>
+ </tr>
+
+ <tr id="shamu">
+ <td>Nexus 6P <br>"angler"</td>
+ <td><a href="#top" onclick="onDownload(this)"
+ >angler-Nxxxx-preview-xxxxxxx.tgz</a><br>
+ MD5: xxxxxxx<br>
+ SHA-1: xxxxxxx
+ </td>
+ </tr>
+
+ <tr id="volantis">
+ <td>Nexus 9 <br>"volantis"</td>
+ <td><a href="#top" onclick="onDownload(this)"
+ >volantis-Nxxxx-preview-xxxxxxx.tgz</a><br>
+ MD5: xxxxxxx<br>
+ SHA-1: xxxxxxx
+ </td>
+ </tr>
+
+ <tr id="fugu">
+ <td>Nexus Player <br>"fugu"</td>
+ <td><a href="#top" onclick="onDownload(this)"
+ >fugu-Nxxxx-preview-xxxxxxx.tgz</a><br>
+ MD5: xxxxxxx<br>
+ SHA-1: xxxxxxx
+ </td>
+ </tr>
+
+</table>
+
+<h3 id="install-image">Install an Image to a Device</h3>
+
+<p>
+ In order to use a device image for testing, you must install it on a
+ compatible device. Follow the instructions below to install a system image:
+</p>
+
+<ol>
+ <li>Download and uncompress one of the system image packages listed here.</li>
+ <li>Backup any data you want to preserve from the device.</li>
+ <li>Follow the instructions at
+ <a href="https://developers.google.com/android/nexus/images#instructions">
+ developers.google.com/android</a> to flash the image onto your device.</li>
+</ol>
+
+<h3 id="update-image">Updating a Device with the Preview</h3>
+
+<p>
+ Once you have installed a preview system image on a development device, the
+ device is upgraded automatically with the next preview release through
+ over-the-air (OTA) updates. When the update is available, the device displays
+ a notification that an update is available and allows you to install it. You
+ can also manually install the next preview image by repeating the procedure
+ in the previous section.
+</p>
+
+<h3 id="revertDevice">Revert a Device to Factory Specifications</h3>
+
+<p>
+ If you want to uninstall the preview and revert the device to factory
+ specifications, go to
+ <a href="http://developers.google.com/android/nexus/images">developers.google.com/android</a>
+ and download the image you want to flash to for your device. Follow the
+ instructions on that page to flash the image to your device.
+</p>
+
+ </div><!-- landing -->
+
+</div><!-- relative wrapper -->
+
+
+
+<script>
+ var urlRoot = "http://storage.googleapis.com/androiddevelopers/shareables/preview/";
+ function onDownload(link) {
+
+ $("#downloadForRealz").html("Download " + $(link).text());
+ $("#downloadForRealz").attr('href', urlRoot + $(link).text());
+
+ $("#tos").fadeIn('fast');
+ $("#landing").fadeOut('fast');
+
+ return true;
+ }
+
+
+ function onAgreeChecked() {
+ /* verify that the TOS is agreed */
+ if ($("input#agree").is(":checked")) {
+ /* reveal the download button */
+ $("a#downloadForRealz").removeClass('disabled');
+ } else {
+ $("a#downloadForRealz").addClass('disabled');
+ }
+ }
+
+ function onDownloadForRealz(link) {
+ if ($("input#agree").is(':checked')) {
+ /*
+ $("#tos").fadeOut('fast');
+ $("#landing").fadeIn('fast');
+ */
+
+ ga('send', 'event', 'M Preview', 'System Image', $("#downloadForRealz").html());
+
+ /*
+ location.hash = "";
+ */
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ $(window).hashchange( function(){
+ if (location.hash == "") {
+ location.reload();
+ }
+ });
+
+</script>
diff --git a/docs/html/preview/features/background-optimization.jd b/docs/html/preview/features/background-optimization.jd
new file mode 100644
index 0000000..1422db5
--- /dev/null
+++ b/docs/html/preview/features/background-optimization.jd
@@ -0,0 +1,426 @@
+page.title=Background Optimizations
+page.metaDescription=New restrictions to implicit broadcasts.
+page.keywords="android N", "implicit broadcasts", "job scheduler"
+@jd:body
+
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>
+ In this document
+ </h2>
+
+ <ol>
+ <li>
+ <a href="#connectivity-action">Restrictions on CONNECTIVITY_ACTION</a>
+ </li>
+
+ <li>
+ <a href="#sched-jobs">Scheduling Network Jobs on Unmetered
+ Connections</a>
+ </li>
+
+ <li>
+ <a href="#monitor-conn">Monitoring Network Connectivity While the App
+ is Running</a>
+ </li>
+
+ <li>
+ <a href="#persistant-monitor-conn">Persistent Monitoring of Network
+ Connectivity</a>
+ </li>
+
+ <li>
+ <a href="#media-broadcasts">Restrictions on NEW_PICTURE and
+ NEW_VIDEO</a>
+ </li>
+
+ <li>
+ <a href="#new-jobinfo">New JobInfo methods</a>
+ </li>
+
+ <li>
+ <a href="#new-jobparam">New JobParameter Methods</a>
+ </li>
+
+ <li>
+ <a href="#further-optimization">Further Optimizing Your App</a>
+ </li>
+ </ol>
+ </div>
+</div>
+
+<p>
+ Background processes can be memory and battery intensive. For example,
+ Implicit broadcasts frequently start background apps that have registered to
+ listen for them. This can have a substantial impact on device performance and
+ user experience.
+</p>
+
+<p>
+ To alleviate this issue, the N Developer Preview applies the following
+ restrictions:
+</p>
+
+<ul>
+ <li>Apps targeting the N Developer Preview will not receive {@link
+ android.net.ConnectivityManager#CONNECTIVITY_ACTION} broadcasts if they
+ register to receive them in their manifest. Apps running in the foreground
+ can still listen for {@code CONNECTIVITY_CHANGE} on their main thread with a
+ registered {@link android.content.BroadcastReceiver}.
+ </li>
+
+ <li>Apps will not be able to to send or receive {@code NEW_PICTURE} or {@code
+ NEW_VIDEO} broadcasts.
+ </li>
+</ul>
+
+<p>
+ The Android framework provides several solutions to mitigate the need for
+ these implicit broadcasts. For example, {@link android.app.job.JobScheduler}
+ and <a href=
+ "https://developers.google.com/android/reference/com/google/android/gms/gcm/GcmNetworkManager">
+ GcmNetworkManager</a> provide robust mechanisms to schedule network
+ operations when specified conditions, such as a connection to an unmetered
+ network, are met. You can also use {@link android.app.job.JobScheduler} to
+ react to changes to content providers. {@link android.app.job.JobInfo}
+ objects, built by the {@link android.app.job.JobInfo.Builder JobInfo.Builder}
+ class, encapsulate the parameters that {@link android.app.job.JobScheduler}
+ uses to schedule your job. When the conditions of the job are met, the system
+ executes this job on your app's {@link android.app.job.JobService}.
+</p>
+
+<p>
+ In this document, we will learn how to use alternative methods, such as
+ {@link android.app.job.JobScheduler}, to adapt your app to these new
+ restrictions.
+</p>
+
+<h2 id="connectivity-action">
+ Restrictions on CONNECTIVITY_ACTION
+</h2>
+
+<p>
+ Apps targeting the N Developer Preview do not receive {@link
+ android.net.ConnectivityManager#CONNECTIVITY_ACTION} broadcasts, even if they
+ register to receive them in their manifest. This could pose a problem for
+ apps that want to listen for network changes or perform bulk network
+ activities when the device connects to an unmetered network. Several
+ solutions to get around this restriction already exist in the Android
+ framework, but choosing the right one depends on what you want your app to
+ accomplish.
+</p>
+
+<p class="note">
+ <strong>Note:</strong> A {@link android.content.BroadcastReceiver} registered with
+ {@link android.content.Context#registerReceiver Context.registerReceiver()}
+ continues to receive these broadcasts on the app’s main activity thread.
+</p>
+
+<h3 id="sched-jobs">
+ Scheduling Network Jobs on Unmetered Connections
+</h3>
+
+<p>
+ When using the {@link android.app.job.JobInfo.Builder JobInfo.Builder} class
+ to build your {@link android.app.job.JobInfo} object, apply the {@link
+ android.app.job.JobInfo.Builder#setRequiredNetworkType
+ setRequiredNetworkType()} method and pass {@link android.app.job.JobInfo
+ JobInfo.NETWORK_TYPE_UNMETERED} as a job parameter. The following code sample
+ schedules a service when the device connects to an unmetered network and is
+ charging:
+</p>
+
+<pre>
+public static final int MY_BACKGROUND_JOB = 0;
+...
+public static void scheduleJob(Context context) {
+ JobScheduler js =
+ (JobScheduler) context.getSystemService(Context.JOB_SCHEDULER_SERVICE);
+ JobInfo job = new JobInfo.Builder(
+ MY_BACKGROUND_JOB,
+ new ComponentName(context, JobService.class))
+ .setRequiredNetworkType(JobInfo.NETWORK_TYPE_UNMETERED)
+ .setRequiresCharging(true)
+ .build();
+ js.schedule(job);
+}
+</pre>
+
+<p>
+ When the conditions for your job are met, your app receives a callback to run
+ the {@link android.app.job.JobService#onStartJob onStartJob()} method in the
+ specified {@code JobService.class}. To see more examples of {@link
+ android.app.job.JobScheduler} implementation, see the <a href=
+ "{@docRoot}samples/JobScheduler/index.html">JobScheduler sample app</a>.
+</p>
+
+<p>
+Applications that use GMSCore services, and target Android 5.0 (API level 21)
+or lower, should use <a href=
+"https://developers.google.com/android/reference/com/google/android/gms/gcm/GcmNetworkManager">
+GcmNetworkManager</a> and specify {@code Task.NETWORK_STATE_UNMETERED}.
+</p>
+
+<h3 id="monitor-conn">
+ Monitoring Network Connectivity While the App is Running
+</h3>
+
+<p>
+ Apps running in the foreground can still listen for {@code
+ CONNECTIVITY_CHANGE} with a registered {@link
+ android.content.BroadcastReceiver}. However, the {@link
+ android.net.ConnectivityManager} API provides a more robust method to request
+ a callback during specified network conditions.
+</p>
+
+<p>
+ {@link android.net.NetworkRequest} objects define the parameters of the
+ network callback in terms of {@link android.net.NetworkCapabilities}. You
+ create {@link android.net.NetworkRequest} objects with the {@link
+ android.net.NetworkRequest.Builder NetworkRequest.Builder} class. {@link
+ android.net.ConnectivityManager#registerNetworkCallback(android.net.NetworkRequest,
+ android.net.ConnectivityManager.NetworkCallback) registerNetworkCallback()}
+ then passes the {@link android.net.NetworkRequest} object to the system. When
+ the network conditions are met, the app receives a callback to execute the
+ {@link android.net.ConnectivityManager.NetworkCallback#onAvailable
+ onAvailable()} method defined in its {@link
+ android.net.ConnectivityManager.NetworkCallback} class.
+</p>
+
+<p>
+ The app continues to receive callbacks until either the app exits or it calls
+ {@link android.net.ConnectivityManager#unregisterNetworkCallback
+ unregisterNetworkCallback()}.
+</p>
+
+<h3 id="persistant-monitor-conn">
+ Persistent Monitoring of Network Connectivity
+</h3>
+
+<p>
+ The {@link android.net.ConnectivityManager} API also provides a method to
+ persistently monitor network connectivity. Due to its impact on performance,
+ however, it should be used with caution.
+</p>
+
+<p>
+ An app may use {@link
+ android.net.ConnectivityManager#registerNetworkCallback(android.net.NetworkRequest,
+ android.app.PendingIntent) registerNetworkCallback()} to register a {@link
+ android.app.PendingIntent} rather than a {@link
+ android.net.ConnectivityManager.NetworkCallback}. The request may outlive the
+ calling app and require it to start up in order to process a callback.
+</p>
+
+<p>
+ Before considering this option, think twice about whether this solution is
+ actually necessary, and consider the impact to performance and user
+ experience when doing so. Only apps that have a real need to start up on a
+ network change should implement this solution. Otherwise, every effort should
+ be taken to <a href="#connectivity-action">implement the alternatives</a>.
+</p>
+
+<h2 id="media-broadcasts">
+ Restrictions on NEW_PICTURE and NEW_VIDEO
+</h2>
+
+<p>
+ In the N Developer Preview, apps are not able to send or receive {@code
+ NEW_PICTURE} or {@code NEW_VIDEO} broadcasts. This restriction helps
+ alleviate the performance and user experience impacts when several apps must
+ wake up in order to process them. The N Developer Preview extends {@link
+ android.app.job.JobInfo} and {@link android.app.job.JobParameters} to provide
+ an alternative solution.
+</p>
+
+<h3 id="new-jobinfo">
+ New JobInfo methods
+</h3>
+
+<p>
+ To help trigger jobs on content URI changes, the N Developer Preview extends
+ the {@link android.app.job.JobInfo} API with the following methods:
+</p>
+
+<dl>
+ <dt>
+ {@code JobInfo.TriggerContentUri()}
+ </dt>
+
+ <dd>
+ Encapsulates parameters required to trigger a job on content URI changes.
+ </dd>
+
+ <dt>
+ {@code JobInfo.Builder.addTriggerContentUri()}
+ </dt>
+
+ <dd>
+ Passes a {@code TriggerContentUri} object to {@link
+ android.app.job.JobInfo}. The encapsulated content URI is monitored with a
+ {@link android.database.ContentObserver}. If there are multiple {@code
+ TriggerContentUri} objects associated with a job, the system provides a
+ callback even if it reports a change in only one of the content URIs.
+ </dd>
+
+ <dd>
+ Add the {@code TriggerContentUri.FLAG_NOTIFY_FOR_DESCENDANTS} flag to
+ trigger the job if any descendants of the given URI change. This flag
+ corresponds to the {@code notifyForDescendants} parameter passed to {@link
+ android.content.ContentResolver#registerContentObserver
+ registerContentObserver()}.
+ </dd>
+</dl>
+
+<p class="note">
+ <strong>Note:</strong> {@code TriggerContentUri()} cannot be used in
+ combination with {@link android.app.job.JobInfo.Builder#setPeriodic
+ setPeriodic()} or {@link android.app.job.JobInfo.Builder#setPersisted
+ setPersisted()}. To continually monitor for content changes, schedule a new
+ {@link android.app.job.JobInfo} before the app’s {@link
+ android.app.job.JobService} finishes handling the most recent callback.
+</p>
+
+<p>
+ The following sample code schedules a job to trigger when the system reports
+ a change to the content URI, {@code MEDIA_URI}:
+</p>
+
+<pre>
+public static final int MY_BACKGROUND_JOB = 0;
+...
+public static void scheduleJob(Context context) {
+ JobScheduler js =
+ (JobScheduler) context.getSystemService(Context.JOB_SCHEDULER_SERVICE);
+ JobInfo.Builder builder = new JobInfo.Builder(
+ MY_BACKGROUND_JOB,
+ new ComponentName(context, MediaContentJob.class));
+ builder.addTriggerContentUri(
+ new JobInfo.TriggerContentUri(MEDIA_URI,
+ JobInfo.TriggerContentUri.FLAG_NOTIFY_FOR_DESCENDANTS));
+ js.schedule(builder.build());
+}
+</pre>
+<p>
+ When the system reports a change in the specified content URI(s), your app
+ receives a callback and a {@link android.app.job.JobParameters} object is
+ passed to the {@link android.app.job.JobService#onStartJob onStartJob()}
+ method in {@code MediaContentJob.class}.
+</p>
+
+<h3 id="new-jobparam">
+ New JobParameter Methods
+</h3>
+
+<p>
+ The N Developer Preview also extends {@link android.app.job.JobParameters} to
+ allow your app to receive useful information about what content authorities
+ and URIs triggered the job:
+</p>
+
+<dl>
+ <dt>
+ {@code Uri[] getTriggeredContentUris()}
+ </dt>
+
+ <dd>
+ Returns an array of URIs that have triggered the job. This will be {@code
+ null} if either no URIs have triggered the job (for example, the job was
+ triggered due to a deadline or some other reason), or the number of changed
+ URIs is greater than 50.
+ </dd>
+
+ <dt>
+ {@code String[] getTriggeredContentAuthorities()}
+ </dt>
+
+ <dd>
+ Returns a string array of content authorities that have triggered the job.
+ If the returned array is not {@code null}, use {@code getTriggeredContentUris()}
+ to retrieve the details of which URIs have changed.
+ </dd>
+</dl>
+
+<p>
+ The following sample code overrides the {@link
+ android.app.job.JobService#onStartJob JobService.onStartJob()} method and
+ records the content authorities and URIs that have triggered the job:
+</p>
+
+<pre>
+@Override
+public boolean onStartJob(JobParameters params) {
+ StringBuilder sb = new StringBuilder();
+ sb.append("Media content has changed:\n");
+ if (params.getTriggeredContentAuthorities() != null) {
+ sb.append("Authorities: ");
+ boolean first = true;
+ for (String auth :
+ params.getTriggeredContentAuthorities()) {
+ if (first) {
+ first = false;
+ } else {
+ sb.append(", ");
+ }
+ sb.append(auth);
+ }
+ if (params.getTriggeredContentUris() != null) {
+ for (Uri uri : params.getTriggeredContentUris()) {
+ sb.append("\n");
+ sb.append(uri);
+ }
+ }
+ } else {
+ sb.append("(No content)");
+ }
+ Log.i(TAG, sb.toString());
+ return true;
+}
+</pre>
+
+<h2 id="further-optimization">
+ Further Optimizing Your App
+</h2>
+
+<p>
+ Optimizing your apps to run on low-memory devices, or in low-memory
+ conditions, can improve performance and user experience. Eliminating the use
+ of implicit broadcasts and background services is a great way to make sure
+ your app runs well on such devices. Although the N Developer Preview takes
+ steps to limit the use of certain implicit broadcasts, consider optimizing
+ your app to run without the use of implicit broadcasts and background
+ services, entirely.</p>
+
+<p>
+ To help you test how your app behaves without those background processes, The
+ N Developer Preview introduces some additional <a href=
+ "{@docRoot}tools/help/adb.html">Android Debug Bridge (ADB)</a> commands:
+</p>
+
+<ul>
+ <li>To simulate conditions where implicit broadcasts and background services
+ are unavailable, enter the following command:
+ </li>
+
+ <li style="list-style: none; display: inline">
+<pre class="no-pretty-print">
+{@code $ adb shell cmd appops set RUN_IN_BACKGROUND ignore}
+</pre>
+ </li>
+
+ <li>To re-enable implicit broadcasts and background services, enter the
+ following command:
+ </li>
+
+ <li style="list-style: none; display: inline">
+<pre class="no-pretty-print">
+{@code $ adb shell cmd appops set RUN_IN_BACKGROUND allow}
+</pre>
+ </li>
+</ul>
+
+<p>
+ The Android framework is constantly evolving to help apps run great on a wide
+ variety of devices. To learn more and join the discussion, <a href=
+ "{@docRoot}">read this blog post!</a>
+</p>
diff --git a/docs/html/preview/features/data-saver.jd b/docs/html/preview/features/data-saver.jd
new file mode 100644
index 0000000..17e78eb
--- /dev/null
+++ b/docs/html/preview/features/data-saver.jd
@@ -0,0 +1,146 @@
+page.title=Data Saver
+metaDescription=User-enabled data usage optimization.
+page.keywords="android N", "data usage", "metered network"
+@jd:body
+
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>
+ In this document
+ </h2>
+
+ <ol>
+ <li>
+ <a href="#status">Checking User Data Saver Preferences</a>
+ </li>
+
+ <li>
+ <a href="#monitor-changes">Monitoring Changes to Data Saver
+ Preferences</a>
+ </li>
+ </ol>
+ </div>
+</div>
+
+<p>
+ Over the life of a smartphone, the cost of a cellular data plan can easily
+ exceed the cost of the device itself. In the N Developer Preview, users can
+ enable Data Saver in order to use less data, whether roaming, near the end of
+ the billing cycle, or on a small prepaid data pack.
+</p>
+
+<p>
+ When a user enables Data Saver in <strong>Settings</strong> and the device is
+ on a metered network, the system blocks background data usage and signals
+ apps to use less data in the foreground wherever possible. Users can
+ whitelist specific apps to allow background metered data usage even when Data
+ Saver is turned on.
+</p>
+
+<p>
+ The N Developer Preview extends the {@link android.net.ConnectivityManager}
+ API to provide apps a way to <a href="#status">retrieve the user’s Data Saver
+ preferences</a> and <a href="#monitor-changes">monitor preference
+ changes</a>. It is considered good practice for apps to check whether the
+ user has enabled Data Saver and make an effort to limit foreground and
+ background data usage.
+</p>
+
+<h1 id="status">
+ Checking the User's Data Saver Preferences
+</h1>
+
+<p>
+ In the N Developer Preview, apps can use the {@link
+ android.net.ConnectivityManager} API to determine what data usage
+ restrictions are being applied. The {@code getRestrictBackgroundStatus()}
+ method returns one of the following values:
+</p>
+
+<dl>
+ <dt>
+ {@code RESTRICT_BACKGROUND_STATUS_DISABLED}
+ </dt>
+
+ <dd>
+ Data Saver is disabled.
+ </dd>
+
+ <dt>
+ {@code RESTRICT_BACKGROUND_STATUS_ENABLED}
+ </dt>
+
+ <dd>
+ The user has enabled Data Saver for this app. Apps should make an effort to limit data
+ usage in the foreground and gracefully handle restrictions to background
+ data usage.
+ </dd>
+
+ <dt>
+ {@code RESTRICT_BACKGROUND_STATUS_WHITELISTED}
+ </dt>
+
+ <dd>
+ The user has enabled Data Saver but the app is whitelisted. Apps should
+ still make an effort to limit foreground and background data usage.
+ </dd>
+</dl>
+
+<p>
+ It is considered good practice to limit data usage whenever the device is
+ connected to a metered network, even if Data Saver is disabled or the app
+ is whitelisted. The following sample code uses {@link
+ android.net.ConnectivityManager#isActiveNetworkMetered
+ ConnectivityManager.isActiveNetworkMetered()} and {@code
+ ConnectivityManager.getRestrictBackgroundStatus()} to determine how much data
+ the app should use:
+</p>
+
+<pre>
+ConnectivityManager connMgr = (ConnectivityManager)
+ getSystemService(Context.CONNECTIVITY_SERVICE);
+// Checks if the device is on a metered network
+if (connMgr.isActiveNetworkMetered()) {
+ // Checks user’s Data Saver settings.
+ switch (connMgr.getRestrictBackgroundStatus) {
+ case RESTRICT_BACKGROUND_STATUS_ENABLED:
+ // Background data usage is blocked for this app. Wherever possible,
+ // the app should also use less data in the foreground.
+
+ case RESTRICT_BACKGROUND_STATUS_WHITELISTED:
+ // The app is whitelisted. Wherever possible,
+ // the app should use less data in the foreground and background.
+
+ case RESTRICT_BACKGROUND_STATUS_DISABLED:
+ // Data Saver is disabled. Since the device is connected to a
+ // metered network, the app should use less data wherever possible.
+ }
+} else {
+ // The device is not on a metered network.
+ // Use data as required to perform syncs, downloads, and updates.
+}
+</pre>
+
+<h1 id="monitor-changes">
+ Monitoring Changes to Data Saver Preferences
+</h1>
+
+<p>
+ Apps can monitor changes to Data Saver preferences by creating a {@link
+ android.content.BroadcastReceiver} to listen for {@code
+ ConnectivityManager.ACTION_RESTRICT_BACKGROUND_CHANGED} ({@code
+ "android.net.conn.RESTRICT_BACKGROUND_CHANGED"}) and dynamically registering
+ the receiver with {@link android.content.Context#registerReceiver
+ Context.registerReceiver()}. When an app receives this broadcast, it should
+ <a href="#status">check if the new Data Saver preferences affect its
+ permissions</a> by calling {@code
+ ConnectivityManager.getRestrictBackgroundStatus()}.
+</p>
+
+<p class="note">
+ <strong>Note:</strong> The system only sends this broadcast to apps that
+ dynamically register for them with {@link
+ android.content.Context#registerReceiver Context.registerReceiver()}. Apps
+ that register to receive this broadcast in their manifest will not receive
+ them.
+</p>
diff --git a/docs/html/preview/features/direct-boot.jd b/docs/html/preview/features/direct-boot.jd
new file mode 100644
index 0000000..4153d40
--- /dev/null
+++ b/docs/html/preview/features/direct-boot.jd
@@ -0,0 +1,180 @@
+page.title=Direct Boot
+page.keywords=preview,sdk,direct boot
+page.tags=androidn
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#run">Requesting Access to Run During Direct Boot</a></li>
+ <li><a href="#access">Accessing Device Encrypted Storage</a></li>
+ <li><a href="#notification">Getting Notified of User Unlock</a></li>
+ <li><a href="#migrating">Migrating Existing Data</a></li>
+ <li><a href="#testing">Testing Your Encryption Aware App</a></li>
+ </ol>
+</div>
+</div>
+
+<p>Android N Developer Preview runs in a secure, <i>Direct Boot</i> mode
+when the device has been powered on but the user has not unlocked the
+device. To support this, the system provides two storage locations for data:</p>
+
+<ul>
+<li><i>Credential encrypted storage</i>, which is the default storage location
+and only available after the user has unlocked the device.</li>
+<li><i>Device encrypted storage</i>, which is a storage location available both
+during Direct Boot mode and after the user has unlocked the device.</li>
+</ul>
+
+<p>By default, apps do not run during Direct Boot mode.
+If your app needs to take action during Direct Boot mode, you can register
+app components that should be run during this mode. Some common use cases
+for apps needing to run during Direct Boot mode include:</p>
+
+<ul>
+<li>Apps that have scheduled notifications, such as alarm clock
+apps.</li>
+<li>Apps that provide important user notifications, like SMS apps.</li>
+<li>Apps that provide accessibility services, like Talkback.</li>
+</ul>
+
+<p>If your app needs to access data while running in Direct Boot mode, use
+device encrypted storage. Device encrypted storage contains data
+encrypted with a key that is only available after a device has performed a
+successful verified boot.</p>
+
+<p>For data that should be encrypted with a key associated with user
+credentials, such as a PIN or password, use credential encrypted storage.
+Credential encrypted storage is only available after the user has successfully
+unlocked the device, up until when the user restarts the device again. If the
+user enables the lock screen after unlocking the device, this doesn't lock
+credential encrypted storage.</p>
+
+<h2 id="run">Requesting Access to Run During Direct Boot</h2>
+
+<p>Apps must register their components with the system before they
+can run during Direct Boot mode or access device encrypted
+storage. Apps register with the system by marking components as
+<i>encryption aware</i>. To mark your component as encryption aware, set the
+<code>android:encryptionAware</code> attribute to true in your manifest.<p>
+
+<p>Encryption aware components can register to receive a
+<code>LOCKED_BOOT_COMPLETED</code> broadcast message from the
+system when the device has been restarted. At this point device encrypted
+storage is available, and your component can execute tasks that need to be
+run during Direct Boot mode, such as triggering a scheduled alarm.</p>
+
+<p>The following code snippet is an example of how to register a
+{@link android.content.BroadcastReceiver} as encryption aware, and add an
+intent filter for <code>LOCKED_BOOT_COMPLETED</code>, in the app manifest:</p>
+
+<pre>
+<receiever
+ android:encryptionAware="true" >
+ ...
+ <intent-filter>
+ <action android:name="android.intent.action.LOCKED_BOOT_COMPLETED" />
+ </intent-filter>
+</receiver>
+</pre>
+
+<p>Once the user has unlocked the device, all components can access both the
+device encrypted storage as well as credential encrypted storage.</p>
+
+<h2 id="access">Accessing Device Encrypted Storage</h2>
+
+<p>To access device encrypted storage, create a second
+{@link android.content.Context} instance by calling
+<code>Context.createDeviceEncryptedStorageContext()</code>. All storage API
+calls made using this context access the device encrypted storage. The
+following example accesses the device encrypted storage and opens an existing
+app data file:</p>
+
+<pre>
+Context directBootContext = Context.createDeviceEncryptedStorageContext();
+// Access appDataFilename that lives in device encrypted storage
+FileInputStream inStream = directBootContext.openFileInput(appDataFilename);
+// Use inStream to read content...
+</pre>
+
+<p>Use device encrypted storage only for
+information that must be accessible during Direct Boot mode.
+Don't use device encrypted storage as a general-purpose encrypted store.
+For private user information, or encrypted data that isn't needed during
+Direct Boot mode, use credential encrypted storage.</p>
+
+<h2 id="notification">Getting Notified of User Unlock</h2>
+
+<p>Once the user unlocks the device after restart, your app can switch to
+accessing credential encrypted storage and use regular system services that
+depend on user credentials.</p>
+
+<p>To get notified when the user unlocks the device after a reboot,
+register a {@link android.content.BroadcastReceiver} from a running component
+to listen for the <code>ACTION_USER_UNLOCKED</code> message. Or, you can
+receive the existing {@link android.content.Intent#ACTION_BOOT_COMPLETED
+ACTION_BOOT_COMPLETED} message, which now indicates the device has booted and
+the user has unlocked the device.</p>
+
+<p>You can directly query if the user has unlocked the device by calling
+<code>UserManager.isUserUnlocked()</code>.</p>
+
+<h2 id="migrating">Migrating Existing Data</h2>
+
+<p>If a user updates their device to use Direct Boot mode, you might have
+existing data that needs to get migrated to device encrypted storage. Use
+<code>Context.migrateSharedPreferencesFrom()</code> and
+<code>Context.migrateDatabaseFrom()</code> to migrate preference and database
+data between credential encrypted storage and device encrypted storage.</p>
+
+<p>Use your best judgment when deciding what data to migrate from credential
+encrypted storage to device encrypted storage. You should not migrate
+private user information, such as passwords or authorization tokens, to
+device encrypted storage. In some scenarios, you might need to manage
+separate sets of data in the two encrypted stores.</p>
+
+<h2 id="testing">Testing Your Encryption Aware App</h2>
+
+<p>Test your encryption aware app using the new Direct Boot mode. There are
+two ways to enable Direct Boot.</p>
+
+<p class="caution"><strong>Caution:</strong> Enabling Direct Boot
+wipes all user data on the device.</p>
+
+<p>On supported devices with Android N Developer Preview installed, enable
+Direct Boot by doing one of the following:</p>
+
+<ul>
+<li>On the device, enable <b>Developer options</b> if you haven't already by
+going to <b>Settings > About phone</b>, and tapping <b>Build number</b>
+seven times. Once the developer options screen is available, go to
+<b>Settings > Developer options</b> and select
+<b>Convert to file encryption</b>.</li>
+<li>Use the following adb shell commands to enable Direct Boot mode:
+<pre class="no-pretty-print">
+$ adb reboot-bootloader
+$ fastboot --wipe-and-use-fbe
+</pre>
+</li>
+</ul>
+
+<p>An emulated Direct Boot mode is also available, in case you need to switch
+modes on your test devices. Emulated mode should only be used during
+development and may cause data loss. To enable emulated Direct Boot mode,
+set a lock pattern on the device, choose "No thanks" if prompted for a
+secure start-up screen when setting a lock pattern, and then use the
+following adb shell command:</p>
+
+<pre class="no-pretty-print">
+$ adb shell sm set-emulate-fbe true
+</pre>
+
+<p>To turn off emulated Direct Boot mode, use the following command:</p>
+
+<pre class="no-pretty-print">
+$ adb shell sm set-emulate-fbe false
+</pre>
+
+<p>Using these commands causes the device to reboot.</p>
diff --git a/docs/html/preview/features/icu4j-framework.jd b/docs/html/preview/features/icu4j-framework.jd
new file mode 100644
index 0000000..6f2eb39
--- /dev/null
+++ b/docs/html/preview/features/icu4j-framework.jd
@@ -0,0 +1,171 @@
+page.title=ICU4J Support in the Android Framework
+
+@jd:body
+
+<div id="tb-wrapper">
+<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>
+</ol>
+
+<h2>See Also</h2>
+<ol>
+ <li>
+ <a class="external-link" href=
+ "http://userguide.icu-project.org">Documentation for ICU4J</a>
+ </li>
+
+ <li>
+ <a class="external-link" href=
+ "http://site.icu-project.org/#TOC-What-is-ICU-">Latest standards supported
+ by ICU4J</a>
+ </li>
+</ol>
+</div>
+</div>
+
+<p>
+ ICU4J is an open-source, widely used set of Java libraries providing Unicode
+ and globalization support for software applications. The N Developer Preview
+ exposes a subset of the ICU4J APIs in the Android framework for app developers
+ to use under the {@code android.icu} package. These APIs use
+ localization data present on the device. As a result, you can reduce your APK
+ footprint by not compiling the ICU4J libraries into your APK; instead, you can
+ simply call out to them in the framework. (In this case, you may want to provide
+ <a href="{@docRoot}google/play/publishing/multiple-apks.html">multiple versions
+ of your APK</a>, so users running versions of Android lower than the N Developer
+ Preview can download a version of the app that contains the ICU4J libraries.)
+</p>
+
+<p>
+ This document begins by providing some basic information on the minimum
+ Android API levels required to support these libraries. It then explains what
+ you need to know about the Android-specific implementation of ICU4J. Finally,
+ it tells you how to use the ICU4J APIs in the Android framework.
+</p>
+
+<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
+ 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
+ them as deprecated but will continue to include them.
+</p>
+
+<p class="table-caption"><strong>Table 1.</strong> ICU and CLDR versions used
+ in the N Preview.</p>
+<table>
+<tr>
+<th>Android API level</th>
+<th>ICU version</th>
+<th>CLDR version</th>
+</tr>
+<tr>
+<td>N Developer Preview</td>
+<td>56</td>
+<td>28</td>
+</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>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
+resources</a>.</li>
+</ul>
+
+<h2 id="migration">Migrating to the android.icu package from com.ibm.icu</h2>
+
+<p>
+ If you are already using the ICU4J APIs in your app, and the
+ <code>android.icu</code> APIs meet your requirements, then migrating to
+ the framework APIs requires you to change your Java imports
+ from <code>com.ibm.icu</code> to <code>android.icu</code>. You may then
+ remove your own copy of ICU4J files from the APK.
+</p>
+
+<p class="note">
+ <b>Note</b>: ICU4J in the Android framework uses 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>
+
+<h3 id="migrate-from-android">
+ Migrating to android.icu APIs from other Android SDK APIs
+</h3>
+
+<p>
+ Some classes in the <code>java</code> and<code>android</code> packages have
+ equivalents to those found in ICU4J. However, ICU4J often provides broader
+ support for standards and languages.
+</p>
+<p>Here are some examples to get you started:</p>
+<table>
+<tr>
+<th>Class</th>
+<th>Alternatives</th>
+</tr>
+<tr>
+<td><code>java.lang.Character</code> </td>
+<td><code>android.icu.lang.UCharacter</code> </td>
+</tr>
+<tr>
+<td><code>java.text.BreakIterator</code> </td>
+<td><code>android.icu.text.BreakIterator</code> </td>
+</tr>
+<tr>
+<td><code>java.text.DecimalFormat</code> </td>
+<td><code>android.icu.text.DecimalFormat</code> </td>
+</tr>
+<tr>
+<td><code>java.util.Calendar</code></td>
+<td>
+<code>android.icu.util.Calendar</code></td>
+</tr>
+<tr>
+<td><code>android.text.BidiFormatter</code>
+ </td>
+<td><code>android.icu.text.Bidi</code>
+ </td>
+</tr>
+<tr>
+<td><code>android.text.format.DateFormat</code>
+ </td>
+<td><code>android.icu.text.DateFormat</code>
+ </td>
+</tr>
+<tr>
+<td><code>android.text.format.DateUtils</code> </td>
+<td><code>android.icu.text.DateFormat</code>
+<code>android.icu.text.RelativeDateTimeFormatter</code>
+</td>
+</tr>
+</table>
+
+<h2 id="licence">Licensing</h2>
+
+<p>
+ ICU4J is released under the ICU license. For details, see the <a class=
+ "external-link" href=
+ "http://userguide.icu-project.org/icufaq#TOC-How-is-the-ICU-licensed-">ICU
+ User Guide.</a>
+</p>
diff --git a/docs/html/preview/features/multi-window.jd b/docs/html/preview/features/multi-window.jd
new file mode 100644
index 0000000..bfc4b82
--- /dev/null
+++ b/docs/html/preview/features/multi-window.jd
@@ -0,0 +1,573 @@
+page.title=Multi-Window Support
+page.metaDescription=New support in the N Developer Preview for showing more than one app at a time.
+page.keywords="multi-window", "android N", "split screen", "free-form"
+
+@jd:body
+
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#overview">Overview</a></li>
+ <li><a href="#lifecycle">Multi-Window Lifecycle</a></li>
+ <li><a href="#configuring">Configuring Your App for Multi-Window
+ Mode</a></li>
+ <li><a href="#running">Running Your App in Multi-Window Mode</a></li>
+ <li><a href="#testing">Testing Your App's Multi-Window Support</a></li>
+ </ol>
+ </div>
+</div>
+
+<p>
+ The N Developer Preview adds support for displaying more than one app at the
+ same time. On handheld devices, two apps can run side-by-side or
+ one-above-the-other in <em>split-screen</em> mode. On TV devices, apps can
+ use <em>picture-in-picture</em> mode to continue video playback while users
+ are interacting with another app.
+</p>
+
+<p>
+ If you build your app with the N Preview SDK, you can configure how your app
+ handles multi-window display. For example, you can specify your activity's
+ minimum allowable dimensions, preventing users from making the activity
+ window smaller than that size. You can also disable multi-window display for
+ your app, ensuring that the system only shows your app in full-screen
+ mode.
+</p>
+
+<h2 id="overview">Overview</h2>
+
+<p>
+ The N Developer Preview allows several apps to share the screen at once. For
+ example, a user could split the screen, viewing a web page on the left side
+ while composing an email on the right side. The user experience depends on
+ the device:
+</p>
+
+<ul>
+ <li>Handheld devices running the N Developer Preview offer split-screen
+ mode. In this mode, the system fills the screen with two apps, showing them
+ either side-by-side or one-above-the-other. The user can drag the dividing
+ line separating the two to make one app larger and the other smaller.
+ </li>
+
+ <li>On Nexus Player running the N Developer Preview, apps can put themselves
+ in <a href="picture-in-picture.html">picture-in-picture mode</a>, allowing
+ them to continue showing content while the user browses or interacts with
+ other apps.
+ </li>
+
+ <li>Manufacturers of larger devices can choose to enable freeform
+ mode, in which the user can freely resize each activity. If the
+ manufacturer enables this feature, the device offers freeform mode in addition
+ to split-screen mode.
+ </li>
+</ul>
+
+<img src="{@docRoot}preview/images/mw-splitscreen.png" alt="" width="641"
+ id="img-split-screen" />
+<p class="img-caption">
+ <strong>Figure 1.</strong> Two apps running side-by-side in split-screen mode.
+</p>
+
+<p>
+ The user can switch into multi-window mode in the following ways:
+</p>
+
+<ul>
+ <li>If the user opens the <a href="{@docRoot}guide/components/recents.html">Overview
+ screen</a> and performs a long press on an
+ activity title, they can drag that activity to a highlighted portion of the
+ screen to put the activity in multi-window mode.
+ </li>
+
+ <li>If the user performs a long press on the Overview button, the device puts
+ the current activity in multi-window mode, and opens the Overview screen to
+ let the user choose another activity to share the screen.
+ </li>
+</ul>
+
+<p>
+ Users can <a href="{@docRoot}guide/topics/ui/drag-drop.html">drag and
+ drop</a> data from one activity to another while the activities are sharing
+ the screen. (Previously, users could only drag and drop data within a single
+ activity.)
+</p>
+
+<h2 id="lifecycle">Multi-Window Lifecycle</h2>
+
+<p>
+ Multi-window mode does not change the <a href=
+ "{@docRoot}training/basics/activity-lifecycle/index.html">activity
+ lifecycle</a>.
+</p>
+
+<p>
+ In multi-window mode, only the activity the user has most recently interacted
+ with is active at a given time. This activity is considered <em>topmost</em>.
+ All other activities are in the paused state, even if they are visible.
+ However, the system gives these paused-but-visible activities higher priority
+ than activities that are not visible. If the user interacts with one of the
+ paused activities, that activity is resumed, and the previously topmost
+ activity is paused.
+</p>
+
+<p class="note">
+ <strong>Note:</strong> In multi-window mode, an app can be in the paused
+ state and still be visible to the user. An app might need to continue its
+ activities even while paused. For example, a video-playing app that is in
+ paused mode but is visible should continue showing its video.
+</p>
+
+<p>
+ When the user puts an app into multi-window mode, the system notifies the
+ activity of a configuration change, as specified in <a href=
+ "{@docRoot}guide/topics/resources/runtime-changes.html">Handling Runtime
+ Changes</a>. Essentially, this change has the same activity-lifecycle
+ implications as when the system notifies the app that the device has switched
+ from portrait to landscape mode, except that the device dimensions are
+ changed instead of just being swapped. As discussed in <a href=
+ "{@docRoot}guide/topics/resources/runtime-changes.html">Handling Runtime
+ Changes</a>, your activity can handle the configuration change itself, or it
+ can allow the system to destroy the activity and recreate it with the new
+ dimensions.
+</p>
+
+<p>
+ If the user is resizes a window and makes it larger in either dimension,
+ the system fills in the expanded
+ area with the color specified by the {@link android.R.attr#windowBackground
+ windowBackground} attribute, or by the default
+ <code>windowBackgroundFallback</code> style attribute. When the user finishes
+ resizing the window, the activity is redrawn with its new dimensions, as
+ described in <a href=
+ "{@docRoot}guide/topics/resources/runtime-changes.html">Handling Runtime
+ Changes</a>.
+</p>
+
+<h2 id="configuring">Configuring Your App for Multi-Window Mode</h2>
+
+<p>
+ If your app targets the N Developer Preview, you can configure how and
+ whether your app's activities support multi-window display. You can set
+ attributes in your manifest to control both size and layout.
+ A root activity's attribute settings apply to all activities
+ within its task stack.
+</p>
+
+<p class="note">
+ <strong>Note:</strong> If you build a multi-orientation app with a version of the
+ SDK earlier than the N Developer Preview, and the user uses the app in
+ multi-window mode, the system forcibly resizes the app. The system presents a
+ dialog box warning the user that the app may behave unexpectedly. The system
+ does <em>not</em> resize fixed-orientation apps; if
+ the user attempts to open a fixed-orientation app under multi-window mode,
+ the app takes over the whole screen.
+</p>
+
+<h4 id="resizeableActivity">android:resizeableActivity</h4>
+<p>
+ Set this attribute in your manifest's <code><activity></code> or
+ <code><application></code> node to enable or disable multi-window
+ display:
+</p>
+
+<pre>
+android:resizableActivity=["true" | "false"]
+</pre>
+
+<p>
+ If this attribute is set to true, the activity can be launched in
+ split-screen and freeform modes. If the attribute is set to false, the
+ activity does not support multi-window mode. If this value is false, and the
+ user attempts to launch the activity in multi-window mode, the activity takes
+ over the full screen.
+</p>
+
+<p>
+ If your app targets the N Developer Preview, but you do not specify a value
+ for this attribute, the attribute's value defaults to true.
+</p>
+
+<h4 id="supportsPictureInPicture">android:supportsPictureInPicture</h4>
+
+<p>
+ Set this attribute in your manifest's <code><activity></code> node to
+ indicate whether the activity supports picture-in-picture display.
+</p>
+
+<pre>
+android:supportsPictureInPicture=["true" | "false"]
+</pre>
+
+<h3 id="layout">Layout attributes</h3>
+
+<p>
+ With the N Developer Preview, the <code><layout></code> manifest element
+ supports several attributes that affect how an activity behaves in
+ multi-window mode:
+</p>
+
+<dl>
+ <dt>
+ <code>android:defaultWidth</code>
+ </dt>
+
+ <dd>
+ Default width of the activity when launched in freeform mode.
+ </dd>
+
+ <dt>
+ <code>android:defaultHeight</code>
+ </dt>
+
+ <dd>
+ Default height of the activity when launched in freeform mode.
+ </dd>
+
+ <dt>
+ <code>android:gravity</code>
+ </dt>
+
+ <dd>
+ Initial placement of the activity when launched in freeform mode. See the
+ {@link android.view.Gravity} reference for suitable values.
+ </dd>
+
+ <dt>
+ <code>android:minimalSize</code>
+ </dt>
+
+ <dd>
+ Minimum height and minimum width for the activity in both split-screen
+ and freeform modes. The system does not permit the user to resize the
+ activity below the specified size in either dimension.
+ </dd>
+</dl>
+
+<p>
+ For example, the following code shows how to specify an activity's default
+ size and location, and its minimum size, when the activity is displayed in
+ freeform mode:
+</p>
+
+<pre>
+<activity android:name=".MyActivity">
+ <layout android:defaultHeight="500dp"
+ android:defaultWidth="600dp"
+ android:gravity="top|end"
+ android:minimalSize="450dp" />
+</activity>
+</pre>
+
+<h2 id="running">Running Your App in Multi-Window Mode</h2>
+
+<p>
+ The N Developer Preview offers new functionality to support apps that can run
+ in multi-window mode.
+</p>
+
+<h3 id="disabled-features">Disabled features in multi-window mode</h3>
+
+<p>
+ Certain features are disabled or ignored when a device is in multi-window
+ mode, because they don’t make sense for an activity which may be sharing the
+ device screen with other activities or apps. Such features include:
+
+<ul>
+ <li>Some <a href="{@docRoot}training/system-ui/index.html">System UI</a>
+ customization options are disabled; for example, apps cannot hide the status
+ bar if they are not running in full-screen mode.
+ </li>
+
+ <li>The system ignores changes to the <code><a href=
+ "{@docRoot}guide/topics/manifest/activity-element.html#screen"
+ >android:screenOrientation</a></code> attribute.
+ </li>
+</ul>
+
+<h3 id="change-notification">Multi-window change notification and querying</h3>
+
+<p>
+ The following new methods have been added to the {@link android.app.Activity}
+ class to support multi-window display. For details on each method, see the
+ <a href="{@docRoot}preview/download.html#docs">N Preview SDK Reference</a>
+</p>
+
+<dl>
+ <dt>
+ <code>Activity.inMultiWindow()</code>
+ </dt>
+
+ <dd>
+ Call to find out if the activity is in multi-window mode.
+ </dd>
+
+ <dt>
+ <code>Activity.inPictureInPicture()</code>
+ </dt>
+
+ <dd>
+ Call to find out if the activity is in picture-in-picture mode.
+
+ <p class="note">
+ <strong>Note:</strong> Picture-in-picture mode is a special case of
+ multi-window mode. If <code>myActivity.inPictureInPicture()</code>
+ returns true, then <code>myActivity.inMultiWindow()</code> also returns
+ true.
+ </p>
+ </dd>
+
+ <dt>
+ <code>Activity.onMultiWindowChanged()</code>
+ </dt>
+
+ <dd>
+ The system calls this method whenever the activity goes into or out of
+ multi-window mode. The system passes the method a value of true if the
+ activity is entering multi-window mode, and false if the activity is
+ leaving multi-window mode.
+ </dd>
+
+ <dt>
+ <code>Activity.onPictureInPictureChanged()</code>
+ </dt>
+
+ <dd>
+ The system calls this method whenever the activity goes into or out of
+ picture-in-picture mode. The system passes the method a value of true if
+ the activity is entering picture-in-picture mode, and false if the activity
+ is leaving picture-in-picture mode.
+ </dd>
+</dl>
+
+<p>
+ There are also {@link android.app.Fragment} versions of each of these
+ methods, for example <code>Fragment.inMultiWindow()</code>.
+</p>
+
+<h3 id="entering-pip">Entering picture-in-picture mode</h3>
+
+<p>
+ To put an activity in picture-in-picture mode, call the new method
+ <code>Activity.enterPictureInPicture()</code>. This method has no effect if
+ the device does not support picture-in-picture mode. For more information,
+ see the <a href="picture-in-picture.html">Picture-in-Picture</a> documentation.
+</p>
+
+<h3 id="launch">Launch New Activities in Multi-Window Mode</h3>
+
+<p>
+ When you launch a new activity, you can hint to the system that the new
+ activity should be displayed adjacent to the current one, if possible. To do
+ this, use the flag
+ <code>Intent.FLAG_ACTIVITY_LAUNCH_TO_ADJACENT</code>. Passing
+ this flag requests the following behavior:
+</p>
+
+<ul>
+ <li>If the device is in split-screen mode, the system attempts to create the
+ new activity next to the activity that launched it, so the two activities
+ share the screen. The system is not guaranteed to be able to do this, but it
+ makes the activities adjacent if possible.
+ </li>
+
+ <li>If the device is not in split-screen mode, this flag has no effect.
+ </li>
+</ul>
+
+<p>
+ If a device is in freeform mode and you are launching a new activity, you can
+ specify the new activity's dimensions and screen location by calling
+ <code>ActivityOptions.setLaunchBounds()</code>. This method has no effect if
+ the device is not in multi-window mode.
+</p>
+
+<p class="note">
+ <strong>Note:</strong> If you launch an activity within a task stack, the
+ activity replaces the activity on the screen, inheriting all of its
+ multi-window properties. If you want to launch the new activity as a separate
+ window in multi-window mode, you must launch it in a new task stack.
+</p>
+
+<h3 id="dnd">Supporting drag and drop</h3>
+
+<p>
+ Users can <a href="{@docRoot}guide/topics/ui/drag-drop.html">drag and
+ drop</a> data from one activity to another while the two activities are
+ sharing the screen. (Previously, users could only drag and drop data within a
+ single activity.) For this reason, you may want to add drag and drop
+ functionality to your app if your app does not currently support it.
+</p>
+
+<p>
+ The N Preview SDK extends the <a href=
+ "{@docRoot}reference/android/view/package-summary.html"><code>android.view</code></a>
+ package to support cross-app drag and drop. For details on the following
+ classes and methods, see the <a href="{@docRoot}preview/download.html#docs">N
+ Preview SDK Reference</a>.
+</p>
+
+<dl>
+ <dt>
+ <code>android.view.DropPermissions</code>
+ </dt>
+
+ <dd>
+ Token object responsible for specifying the permissions granted to the app
+ that receives a drop.
+ </dd>
+
+ <dt>
+ <code>View.startDragAndDrop()</code>
+ </dt>
+
+ <dd>
+ New alias for {@link android.view.View#startDrag View.startDrag()}.
+ </dd>
+
+ <dt>
+ <code>View.cancelDragAndDrop()</code>
+ </dt>
+
+ <dd>
+ Cancels a drag operation currently in progress. Can only be called by the
+ app that originated the drag operation.
+ </dd>
+
+ <dt>
+ <code>View.updateDragShadow()</code>
+ </dt>
+
+ <dd>
+ Replaces the drag shadow for a drag operation currently in progress. Can
+ only be called by the app that originated the drag operation.
+ </dd>
+
+ <dt>
+ <code>Activity.requestDropPermissions()</code>
+ </dt>
+
+ <dd>
+ Requests the permissions for the content URIs passed with the {@link
+ android.content.ClipData} contained in a {@link android.view.DragEvent}.
+ </dd>
+</dl>
+
+<h2 id="testing">Testing Your App's Multi-Window Support</h2>
+
+<p>
+ Whether or not you update your app for the N Developer Preview, you should
+ verify how it behaves in multi-window mode in case a user tries to launch it
+ in multiwindow mode on a device running the N Developer Preview.
+</p>
+
+<h3 id="configuring">Configuring a Test Device</h3>
+
+<p>
+ If you install the N Developer Preview on a device, split-screen mode is
+ automatically supported.
+</p>
+
+<h3 id="test-non-n">If your app was not built with the N Preview SDK</h3>
+
+<p>
+ If you did not build your app with the N Preview SDK and the user attempts to use
+ the app in multi-window mode, the system forcibly resizes the app unless the app
+ declares a fixed orientation.
+</p>
+
+<p>
+ If your app does not declare a fixed orientation, you should launch your app
+ on a device running the N Developer Preview and attempt to put the app in
+ split-screen mode. Verify that the user experience is
+ acceptable when the app is forcibly resized.
+</p>
+
+<p>
+ If the app declares a fixed orientation, you should attempt to put the app in
+ multi-window mode. Verify that when you do so, the app remains
+ in full-screen mode.
+</p>
+
+<h3 id="test-mw">If you support multi-window mode</h3>
+
+<p>
+ If you built your app with the N Preview SDK and have not disabled
+ multi-window support, verify the following behavior under both split-screen
+ and freeform modes.
+</p>
+
+<ul>
+ <li>Launch the app in full-screen mode, then switch to multi-window mode by
+ long-pressing the Overview button. Verify that the app switches properly.
+ </li>
+
+ <li>Launch the app directly in multi-window mode, and verify that the app
+ launches properly. You can launch an app in multi-window mode by pressing the
+ Overview button, then long-pressing the title bar of your app and dragging it
+ to one of the highlighted areas on the screen.
+ </li>
+
+ <li>Resize your app in split-screen mode by dragging the divider line.
+ Verify that the app resizes without crashing, and that necessary UI elements
+ are visible.
+ </li>
+
+ <li>If you have specified minimum dimensions for your app, attempt to resize
+ the app below those dimensions. Verify that you cannot resize the app to be
+ smaller than the specified minimum.
+ </li>
+
+ <li>Through all tests, verify that your app's performance is acceptable. For
+ example, verify that there is not too long a lag to update the UI after the
+ app is resized.
+ </li>
+</ul>
+
+<h4 id="test-checklist">Testing checklist</h4>
+
+<p>
+ To verify your app's performance in multi-window mode, try the following
+ operations. You should try these operations in both split-screen and
+ multi-window mode, except where otherwise noted.
+</p>
+
+<ul>
+ <li>Enter and leave multi-window mode.
+ </li>
+
+ <li>Switch from your app to another app, and verify that the app behaves
+ properly while it is visible but not active. For example, if your app is
+ playing video, verify that the video continues to play while the user is
+ interacting with another app.
+ </li>
+
+ <li>In split-screen mode, try moving the dividing bar to make your app both
+ larger and smaller. Try these operations in both side-by-side and
+ one-above-the-other configurations. Verify that the app does not crash,
+ essential functionality is visible, and the resize operation doesn't take too
+ long.
+ </li>
+
+ <li>Perform several resize operations in rapid succession. Verify that your
+ app doesn't crash or leak memory. For information about checking your app's
+ memory usage, see <a href="{@docRoot}tools/debugging/debugging-memory.html">
+ Investigating Your RAM Usage</a>.
+ </li>
+
+ <li>Use your app normally in a number of different window configurations, and
+ verify that the app behaves properly. Verify that text is readable, and that
+ UI elements aren't too small to interact with.
+ </li>
+</ul>
+
+<h3 id="test-disabled-mw">If you have disabled multi-window support</h3>
+
+<p>
+ If you disabled multi-window support by setting
+ <code>android:resizableActivity="false"</code>, you should launch your app on
+ a device running the N Developer Preview and attempt to put the app in
+ freeform and split-screen modes. Verify that when you do so, the app remains
+ in full-screen mode.
+</p>
diff --git a/docs/html/preview/features/multilingual-support.jd b/docs/html/preview/features/multilingual-support.jd
new file mode 100644
index 0000000..aadc940
--- /dev/null
+++ b/docs/html/preview/features/multilingual-support.jd
@@ -0,0 +1,214 @@
+page.title=Language and Locale
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+<h2>In this document:</h2>
+<ol>
+ <li><a href="#preN">Challenges in Resolving Language Resources</a></li>
+ <li><a href="#postN">Improvements to Resource-Resolution Strategy</a></li>
+ <li><a href="#design">Designing your App to Support Additional
+ Locales</a></li>
+
+</ol>
+
+</div>
+</div>
+
+<p>Android N Developer Preview provides enhanced support for multilingual users,
+allowing them to select multiple locales in settings. The Preview
+provides this capability by greatly expanding the number of locales supported
+and changing the way the system resolves resources. The new method of resolving
+resources is more robust and designed to be compatible with existing APKs, but
+you should take extra care to spot any unexpected behavior. For example, you
+should test to make sure that your app defaults to the expected language. Also,
+if your app supports multiple languages, you should ensure that this support works as
+intended. Finally, you should try to ensure that your app gracefully handles
+languages that you didn't explicitly design it to support.</p>
+
+<p>This document starts by explaining the resource resolution strategy prior to
+the Preview. Next, it describes the Preview's improved
+resource-resolution strategy. Last, it explains how to take advantage of
+the expanded number of locales to support more multilingual users.</p>
+
+<h2 id="preN">Challenges in Resolving Language Resources</h2>
+
+<p>Prior to this Preview, Android could not always successfully
+ match app and system locales. For example, suppose that your app's default language
+ is US English, but that it also has Spanish strings localized in {@code es_ES}
+ resource files.</p>
+<p>When your Java code referred to strings, it would resolve string languages as
+follows:</p>
+<ul>
+<li>If a device were set to {@code es_MX} (Spanish-Mexico), Android would load
+strings from {@code es_ES} resource files.</li>
+<li>If the device were set to {@code en_AU}, Android would fall back on {@code
+en_US}. The system would also default to {@code en_US} if the user chose a
+language that the app didn't support at all, like French.</li>
+</ul>
+
+
+<p>These resolution problems arose because the system stripped the country code
+ off of the locale if it could not find an exact match. For example:</p>
+<p class="table-caption" id="t-resource-res">
+<strong>Table 1.</strong> Resource resolution without an exact locale match.
+</p>
+<table>
+<tbody>
+<tr>
+<th>User Settings</th>
+<th>App Resources</th>
+<th>Resource Resolution</th>
+</tr>
+<tr>
+<td>fr_CH</td>
+<td>
+default (en)<br>
+de_DE<br>
+es_ES<br>
+fr_FR<br>
+it_IT<br>
+</td>
+ <td>
+Try fr_CH => Fail<br>
+Try fr => Fail<br>
+Use default (en)
+</td>
+ </tr>
+ </tbody>
+</table>
+
+
+<p>In this example, the system displays English strings without
+knowing whether the user can understand English. This behavior is pretty common
+today. The Preview should substantially reduce the frequency
+of outcomes like this one.</p>
+
+<h2 id="postN">Improvements to Resource-Resolution Strategy</h2>
+<p>The Preview brings more robust resource resolution, and
+finds better fallbacks automatically. However, to speed up resolution and improve
+ maintainability, you should store resources in the most common parent dialect.
+ For example, if you were storing Spanish resources in the {@code es-US} directory
+ before, move them into the {@code es-419} directory, which contains Latin American Spanish.
+ Similarly, if you have resource strings in a folder named {@code en-GB}, rename
+ the folder to {@code en-001} (international English), because the most common
+ parent for <code>en-GB</code> strings is {@code en-001}.
+ The following examples explain why these practices improve performance and
+reliability of resource resolution.</p>
+
+<h3>Resource resolution examples</h3>
+
+<p>With this Preview, the case described in <strong>Table 1</strong> is resolved
+differently:</p>
+
+<p class="table-caption" id="t-improved-res">
+<strong>Table 2.</strong> An improved resolution strategy for when there is no
+exact locale match.</p>
+<table>
+<tr>
+<th>User Settings</th>
+<th>App Resources</th>
+<th>Resource Resolution</th>
+</tr>
+<tr>
+<td><ol>
+<li> fr_CH</li>
+</ol>
+</td>
+<td>
+default (en)<br>
+de_DE<br>
+es_ES<br>
+fr_FR<br>
+it_IT<br>
+</td>
+<td>
+Try fr_CH => Fail<br>
+Try fr => Fail<br>
+Try children of fr => fr_FR<br>
+Use fr_FR
+</td>
+</tr>
+
+</table>
+
+
+<p>Now the user gets French resources instead of English. This example also shows
+ why you should store French strings in {@code fr} rather than {@code fr_FR}
+ for Android N. Here the course of action is to match the closest parent dialect,
+ making resolution faster and more predictable.</p>
+
+<p>In addition to this improved resolution logic, Android now offers more
+ user languages to choose from. Let’s try the above example again with Italian
+ specified as an additional user language, but without app support for French. </p>
+
+<p class="table-caption" id="t-2d-choice">
+<strong>Table 3.</strong> Resource resolution when the app only matches the
+user's second-preferred locale setting.</p>
+<table>
+<tr>
+<th>User Settings</th>
+<th>App Resources</th>
+<th>Resource Resolution</th>
+
+</tr>
+<tr>
+<td><ol>
+<li> fr_CH</li>
+<li> it_CH</li>
+</ol>
+</td>
+<td>
+default (en)<br>
+de_DE<br>
+es_ES<br>
+it_IT<br>
+</td>
+<td>
+Try fr_CH => Fail<br>
+Try fr => Fail<br>
+Try children of fr => Fail<br>
+Try it_CH => Fail<br>
+Try it => Fail<br>
+Try children of it => it_IT<br>
+Use it_IT
+</td>
+
+</tr>
+
+</table>
+<p>The user still gets a language they understand, even though the app doesn’t
+support French.</p>
+
+
+<h2 id="design">Designing your App to Support Additional Locales</h2>
+<h3>LocaleList API</h3>
+
+<p>The Preview adds a new API {@code LocaleList.GetDefault()}
+that lets apps directly query the list of languages a user has specified. This API
+allows you to create more sophisticated
+ app behavior and better-optimized display of content. For example, Search
+ can show results in multiple languages based on user’s settings. Browser apps
+ can avoid offering to translate pages in a language the user already knows,
+ and keyboard apps can auto-enable all appropriate layouts. </p>
+
+<h3>Formatters</h3>
+
+<p>Up through Android 6.0 (API level 23), Android supported only one or two locales
+ for many common languages
+(en, es, ar, fr, ru). Because there were only a few variants of each language,
+apps could get away with storing some numbers and dates as hard coded strings
+in resource files. However, with Android's broadened set of supported locales,
+there can be
+significant differences in formats for dates, times, currencies, and similar
+information even within a single locale. Hard-coding your formats can produce a
+confusing experience for end users. Therefore, when developing for Android N
+make sure to use formatters instead of hard coding numbers and date strings.</p>
+
+<p>A prime example is Arabic, whose support the Android N expands from
+one {@code ar_EG} to 27 Arabic locales. These locales can share most resources,
+but some prefer ASCII digits, while others prefer native digits. For example,
+when you want to create a sentence with a digit variable, such as
+"Choose a 4 digit pin", use formatters as shown below:</p>
+
+<pre> format(locale, "Choose a %d-digit PIN", 4)</pre>
diff --git a/docs/html/preview/features/notification-updates.jd b/docs/html/preview/features/notification-updates.jd
new file mode 100644
index 0000000..56e5c79
--- /dev/null
+++ b/docs/html/preview/features/notification-updates.jd
@@ -0,0 +1,315 @@
+page.title=Notifications
+page.tags=notifications
+helpoutsWidget=true
+
+trainingnavtop=true
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<!-- table of contents -->
+<h2>This document includes</h2>
+<ol>
+ <li><a href="#direct">Direct Reply</a></li>
+ <li><a href="#bundle">Bundled Notifications</a></li>
+ <li><a href="#custom">Custom Views</a></li>
+</ol>
+
+</div>
+</div>
+
+<p>The Android N Developer Preview introduces several new APIs that allow apps to post
+notifications that are highly visible and interactive.</p>
+
+<p>The Preview extends the existing {@link android.support.v4.app.RemoteInput}
+notification API to support inline replies on handsets. This feature allows users
+ to quickly respond from the notification shade without visiting your app.</p>
+
+<p>
+ The Preview also allows you to bundle similar notifications to
+ appear as a single notification. To make this possible, the
+ Preview uses the existing {@link
+ android.support.v4.app.NotificationCompat.Builder#setGroup
+ NotificationCompat.Builder.setGroup()} method. Users can expand each of the
+ notifications, and perform actions such as reply and dismiss on each of the
+ notifications, individually from the notification shade.
+</p>
+
+<p>Last, the Preview also adds two new custom view style APIs that
+allow you to leverage system decorations in your app’s customized notification
+views.</p>
+
+<p>This document highlights some of the key changes that you should take into
+ account when using the new notification features in your apps.</p>
+
+<h2 id="direct">Direct Reply</h2>
+
+<p>With the Direct Reply feature in the Preview, users can quickly
+respond to text messages or update task lists directly within the notification
+interface. On a handheld, the inline reply action appears as an additional button
+ attached to the notification. When a user replies via keyboard, the system attaches
+ the text response to the intent
+ you had specified for the notification action and sends the intent to your
+ handheld app.
+
+
+<img id="fig-reply-button" src="{@docRoot}preview/images/inline-reply.png">
+<p class="img-caption">
+ <strong>Figure 1.</strong> The Preview adds the <strong>Reply</strong>
+ action button.
+</p>
+
+<h3>Adding inline reply actions</h3>
+
+<p>To create a notification action that supports direct reply:
+</p>
+
+<ol>
+<li>Create an instance of {@link android.support.v4.app.RemoteInput.Builder}
+ that you can add to your notification
+action. This class's constructor accepts a string that the system uses as the key
+ for the text input. Later, your handheld app uses that key to retrieve the text
+ of the input.
+
+<pre>
+// Key for the string that's delivered in the action's intent
+private static final String KEY_TEXT_REPLY = "key_text_reply";
+String replyLabel = getResources().getString(R.string.reply_label);
+RemoteInput remoteInput = new RemoteInput.Builder(KEY_TEXT_REPLY)
+ .setLabel(replyLabel)
+ .build();
+</pre>
+</li>
+<li>Attach the {@link android.support.v4.app.RemoteInput}
+ object to an action using <code>addRemoteInput()</code>.
+
+<pre>
+// Create the reply action and add the remote input
+Notification.Action action =
+ new Notification.Action.Builder(R.drawable.ic_reply_icon,
+ getString(R.string.label), replyPendingIntent)
+ .addRemoteInput(remoteInput)
+ .build();
+</pre>
+</li>
+
+<li>Apply the action to a notification and issue the notification.
+
+<pre>
+// Build the notification and add the action
+Notification notification =
+ new Notification.Builder(mContext)
+ .setSmallIcon(R.drawable.ic_message)
+ .setContentTitle(getString(R.string.title))
+ .setContentText(getString(R.string.content))
+ .addAction(action))
+ .build();
+
+// Issue the notification
+NotificationManager notificationManager =
+ NotificationManager.from(mContext);
+notificationManager.notify(notificationId, notification);
+
+</pre>
+</li>
+
+</ol>
+
+
+<p> The system prompts the user to input a response when they trigger the
+notification action. </p>
+
+<img id="fig-user-input" src="{@docRoot}preview/images/inline-type-reply.png">
+<p class="img-caption">
+ <strong>Figure 2.</strong> The user inputs text from the notification shade.
+</p>
+
+<h3>Retrieving user input from the inline reply</h3>
+
+<p>To receive user input from the notification interface to the activity you
+declared in the reply action's intent:</p>
+<ol>
+<li> Call {@link android.support.v4.app.RemoteInput#getResultsFromIntent
+ getResultsFromIntent()} by passing the notification action’s intent as
+ the input parameter. This method returns a {@link android.os.Bundle} that
+ contains the text response.
+</li>
+
+<pre>
+Bundle remoteInput = RemoteInput.getResultsFromIntent(intent);
+</pre>
+
+<li>Query the bundle using the result key (provided to the {@link
+ android.support.v4.app.RemoteInput.Builder} constructor).
+</li>
+</ol>
+
+<p>The following code snippet illustrates how a method retrieves the input text
+from a bundle:</p>
+
+<pre>
+// Obtain the intent that started this activity by calling
+// Activity.getIntent() and pass it into this method to
+// get the associated string.
+
+private CharSequence getMessageText(Intent intent) {
+ Bundle remoteInput = RemoteInput.getResultsFromIntent(intent);
+ if (remoteInput != null) {
+ return remoteInput.getCharSequence(KEY_TEXT_REPLY);
+ }
+ return null;
+ }
+</pre>
+
+<p>Apps can apply logic to decide what actions to take on the retrieved
+text.
+For interactive apps (like chats), provide more context in the notification itself
+ (for example, multiple lines of chat history, including the user’s own messages)
+ so that the user can respond appropriately.
+When the user responds via {@link android.support.v4.app.RemoteInput},
+ include the text in the reply history with the {@code setRemoteInputHistory()}
+ method.
+
+
+<img id="fig-chat-history" src=
+"{@docRoot}preview/images/inline-reply-sent.png">
+<p class="img-caption">
+ <strong>Figure 3.</strong> Screenshot of chat history in the notification
+ shade.
+</p>
+
+<h2 id="bundle">Bundled Notifications</h2>
+
+<p>The Preview provides developers with a new way to represent
+ a queue of notifications: <em>bundled notifications</em>. This is similar to the
+ <a href="{@docRoot}/training/wearables/notifications/stacks.html">Notification
+ Stacks</a> feature in Android Wear. For example, if your app creates notifications
+ for received messages, when more than one message is received, bundle the
+ notifications together as a single group. You can
+ use the existing {@link android.support.v4.app.NotificationCompat.Builder#setGroup
+Builder.setGroup()} method to bundle similar notifications.</p>
+
+<p>
+ A notification group imposes a hierarchy on the notifications comprising it.
+ At the top of that hierarchy is a parent notification that displays the first
+ line of the first notification in the group. The user can progressively
+ expand the notification group, and the system shows more information as the
+ user drills deeper. When the user expands the bundle, the system reveals the
+ first line of each notification within the bundle; when the user expands one
+ of those notifications, the system reveals its entire content.
+</p>
+
+<img id="fig-bundles" src="{@docRoot}preview/images/bundles.png">
+<p class="img-caption">
+ <strong>Figure 4.</strong> The user can progressively expand the notification
+ group.
+</p>
+
+<p>To learn how to add notifications to a group, see
+<a href="{@docRoot}training/wearables/notifications/stacks.html#AddGroup">Add
+Each Notification to a Group</a>.</p>
+
+
+<h3 id="best-practices">Best practices for bundled notifications</h3>
+<p>This section provides guidelines about when to use notification groups instead
+of the {@link android.app.Notification.InboxStyle} notifications that have been available
+ in earlier versions of the Android platform.</p>
+<h3>When to use bundled notifications</h3>
+
+<p>You should use notification groups only if all of the following conditions are
+true for your use case:</p>
+
+<ul>
+ <li>The child notifications are complete notifications and can be displayed
+ individually without the need for a group summary.</li>
+ <li>There is a benefit to surfacing the child notifications individually. For
+ example:
+ </li>
+ <ul>
+ <li>They are actionable, with actions specific to each child.</li>
+ <li>There is more information to the child that the user wants to read.</li>
+ </ul>
+</ul>
+
+<p>Examples of good use cases for notification groups include: a messaging app
+displaying a list of incoming messages, or an email app displaying a list of
+received emails.</p>
+
+<p>Examples of where a single notification (InboxStyle or BigTextStyle) is preferable
+ include: Individual messages from a single person, or a list representation of
+ single-line text items.</p>
+
+<h3 id ="post">Displaying bundled notifications</h3>
+<p>When a group only has a single child notification, the app should in general
+not post a notification group, but instead post that notification individually.
+Only if it accumulates more than one child should it display the notifications
+ in a group.</p>
+
+<p>Similarly, when a user swipes away children of an expanded
+notification group, the app should remove the group as soon as there is only a
+single child left. It should then convert the child into a normal, single
+ notification.</p>
+
+<h3>Peeking notifications</h3>
+
+<p>While the system usually displays child notifications as a group, you can set
+ them to temporarily appear as
+ <a href="{@docRoot}guide/topics/ui/notifiers/notifications.html#Heads-up">
+ heads-up notifications</a>. This feature is especially useful because it allows
+ immediate access to the most recent child and the actions associated with it.
+</p>
+
+
+<h3>Backwards compatibility</h3>
+
+<p>On handhelds, notification groups are available beginning from this
+Preview. However, on tablets, the notification groups API has been available since
+Android Android 5.0 (API level 21). </p>
+
+<p>All Android Wear devices have this feature, regardless of API level.
+ The only action a Wear developer must take is to verify that the app behavior
+ corresponds to the <a href="#best-practices">guidelines</a> described above.</p>
+
+<p>In order to support backward compatibility, an app should still have
+an inbox style or an equivalent notification representative for the whole information
+ content of the group including the children on Android 5.0 and above.
+For convenience, an app can usually reuse the notification group summary and define
+ it as an inbox-style notification, with each line corresponding to one child
+ notification.
+ </p>
+
+<h2 id="custom"> Custom Views</h2>
+<p>Starting from this Preview, you can customize notification views and
+still obtain system decorations like notification headers, actions, and expandable
+layouts.</p>
+
+<p>To enable this capability, Android N adds the following APIs to style your
+ custom view:</p>
+
+<dl>
+<dt>
+{@code DecoratedCustomViewStyle()}</dt>
+<dd> Styles notifications other than media
+notifications.</dd>
+<dt>
+{@code DecoratedMediaCustomViewStyle()}</dt>
+<dd> Styles media notifications.</dd>
+</dl>
+
+<p>To use this new API, call the {@code setStyle()} method, passing to it
+the desired custom view style.</p>
+
+<p>This snippet shows how to construct a custom notification object with the
+{@code DecoratedCustomViewStyle()} method.</p>
+
+<pre>
+Notification noti = new Notification.Builder()
+ .setSmallIcon(R.drawable.ic_stat_player)
+ .setLargeIcon(albumArtBitmap))
+ .setCustomContentView(contentView);
+ .setStyle(new Notification.DecoratedCustomViewStyle())
+ .build();
+
+</pre>
diff --git a/docs/html/preview/features/picture-in-picture.jd b/docs/html/preview/features/picture-in-picture.jd
new file mode 100644
index 0000000..9a96de2
--- /dev/null
+++ b/docs/html/preview/features/picture-in-picture.jd
@@ -0,0 +1,175 @@
+page.title=Picture-in-picture
+page.keywords=preview,sdk,PIP,Picture-in-picture
+page.tags=androidn
+
+@jd:body
+
+<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
+Picture-in-picture</a></li>
+ <li><a href="#best">Best Practices</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
+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>
+
+<p>Your app can decide when to trigger PIP mode. Here are some examples on
+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
+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>
+</ul>
+
+<p>The PIP window is 240 x 135 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
+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>
+
+<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
+register your activities that support PIP, switch your activity to PIP mode as
+needed, and make sure UI elements are hidden and video playback continues when
+the activity is in PIP mode.</p>
+
+<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
+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>
+
+<pre>
+<activity android:name="VideoActivity"
+ android:resizeableActivity="true"
+ android:supportsPictureInPicture="true"
+ android:configChanges=
+ "screenSize|smallestScreenSize|screenLayout|orientation"
+ ...
+</pre>
+
+<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>
+
+<h2 id="pip_button">Switching Your Activity to Picture-in-picture</h2>
+
+When you need to switch your activity into PIP mode, call
+<code>Activity.enterPictureInPicture()</code>. The following example switches
+to PIP mode when the user selects a dedicated PIP button on a media control
+bar:</p>
+
+<pre>
+@Override
+public void onActionClicked(Action action) {
+ if (action.getId() == R.id.lb_control_picture_in_picture) {
+ getActivity().enterPictureInPicture();
+ return;
+ }
+ ...
+</pre>
+
+<p>Adding a PIP button to your media control bar lets your user easily switch
+to PIP mode while controlling video playback.</p>
+
+<img src="{@docRoot}preview/images/pip-button.png" />
+<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>
+
+<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,
+and restore these elements when your activity becomes full-screen again.
+Override <code>Activity.onPictureInPictureChanged()</code> or
+<code>Fragment.onPictureInPictureChanged()</code> and enable or
+disable your UI elements as needed, for example:</p>
+
+<pre>
+@Override
+public void onPictureInPictureChanged(boolean inPictureInPicture) {
+ if (inPictureInPicture) {
+ // Hide the controls in picture-in-picture mode.
+ ...
+ } else {
+ // Restore the playback UI based on the playback status.
+ ...
+ }
+}
+</pre>
+
+<h2 id="continuing_playback">Continuing Video Playback While in
+Picture-in-picture</h2>
+
+<p>When your activity switches to PIP, the system considers the activity in a
+paused state, and calls your activity's <code>onPause()</code> method. Video
+playback should not be paused and should continue playing if the activity is
+paused due to PIP mode. Check for PIP in your activity's
+<code>onPause()</code> method and handle playback appropriately, for
+example:</p>
+
+<pre>
+@Override
+public void onPause() {
+ // If called due to PIP, do not pause playback
+ if (inPictureInPicture()) {
+ // Continue playback
+ ...
+ }
+ // If paused but not in PIP, pause playback if necessary
+ ...
+}
+</pre>
+
+<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>
+
+<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>
+
+<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
+in any area that can be obscured by the PIP window.</p>
+
+<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/features/scoped-folder-access.jd b/docs/html/preview/features/scoped-folder-access.jd
new file mode 100644
index 0000000..f625978
--- /dev/null
+++ b/docs/html/preview/features/scoped-folder-access.jd
@@ -0,0 +1,125 @@
+page.title=Scoped Directory Access
+page.keywords=preview,sdk,scoped directory access
+page.tags=androidn
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#accessing">Accessing an External Storage Directory</a></li>
+ <li><a href="#removable">Accessing a Directory on Removable Media</a></li>
+ <li><a href="#best">Best Practices</a></li>
+ </ol>
+</div>
+</div>
+
+<p>Apps such as photo apps usually just need access to specific directories in
+external storage, such as the <code>Pictures</code> directory. Existing
+approaches to accessing external storage aren't designed to easily provide
+targeted directory access for these types of apps. For example:</p>
+
+<ul>
+<li>Requesting {@link android.Manifest.permission#READ_EXTERNAL_STORAGE}
+or {@link android.Manifest.permission#WRITE_EXTERNAL_STORAGE} in your manifest
+allows access to all public directories on external storage, which might be
+more access than what your app needs.</li>
+<li>Using the
+<a href="{@docRoot}guide/topics/providers/document-provider.html">Storage
+Access Framework</a> usually makes your user pick directories
+via a system UI, which is unnecessary if your app always accesses the same
+external directory.</li>
+</ul>
+
+<p>The Android N Developer Preview provides a new simplified API to access
+common external storage directories. </p>
+
+<h2 id="accessing">Accessing an External Storage Directory</h2>
+
+<p>Use the <code>StorageManager</code> class to get the appropriate
+<code>StorageVolume</code> instance. Then, create an intent by calling the
+<code>StorageVolume.createAccessIntent()</code> method of that instance.
+Use this intent to access external storage directories. To get a list of
+all available volumes, including removable media volumes, use
+<code>StorageManager.getVolumesList()</code>.</p>
+
+<p>The following code snippet is an example of how to open the
+<code>Pictures</code> directory in the primary shared storage:</p>
+
+<pre>
+StorageManager sm = (StorageManager)getSystemService(Context.STORAGE_SERVICE);
+StorageVolume volume = sm.getPrimaryVolume();
+Intent intent = volume.createAccessIntent(Environment.DIRECTORY_PICTURES);
+startActivityForResult(intent, request_code);
+</pre>
+
+<p>The system attempts to grant access to the external directory, and if
+necessary confirms access with the user using a simplified UI:</p>
+
+<img src="{@docRoot}preview/images/scoped-folder-access-framed.png"
+srcset="{@docRoot}preview/images/scoped-folder-access-framed.png 1x,
+{@docRoot}preview/images/scoped-folder-access-framed_2x.png 2x" />
+<p class="img-caption"><strong>Figure 1.</strong> An application requesting
+access to the Pictures directory.</p>
+
+<p>If the user grants access, the system calls your
+<code>onActivityResult()</code> override with a result code of
+<code>Activity.RESULT_OK</code>, and intent data that contains the URI. Use
+the provided URI to access directory information, similar to using URIs
+returned by the
+<a href="{@docRoot}guide/topics/providers/document-provider.html">Storage
+Access Framework</a>.</p>
+
+<p>If the user doesn't grant access, the system calls your
+<code>onActivityResult()</code> override with a result code of
+<code>Activity.RESULT_CANCELED</code>, and null intent data.</p>
+
+<p class="note"><b>Note</b>: Getting access to a specific external directory
+also gains access to subdirectories within that directory.</p>
+
+<h2 id="removable">Accessing a Directory on Removable Media</h2>
+
+<p>To use Scoped Directory Access to access directories on removable media,
+first add a {@link android.content.BroadcastReceiver} that listens for the
+{@link android.os.Environment#MEDIA_MOUNTED} notification, for example:</p>
+
+<pre>
+<receiver
+ android:name=".MediaMountedReceiver"
+ android:enabled="true"
+ android:exported="true" >
+ <intent-filter>
+ <action android:name="android.intent.action.MEDIA_MOUNTED" />
+ <data android:scheme="file" />
+ </intent-filter>
+</receiver>
+</pre>
+
+<p>When the user mounts removable media, like an SD card, the system sends a
+{@link android.os.Environment#MEDIA_MOUNTED} notification. This notification
+provides a <code>StorageVolume</code> object in the intent data that you can
+use to access directories on the removable media. The following example
+accesses the <code>Pictures</code> directory on removable media:</p>
+
+<pre>
+// BroadcastReceiver has already cached the MEDIA_MOUNTED
+// notification Intent in mediaMountedIntent
+StorageVolume volume = (StorageVolume)
+ mediaMountedIntent.getParcelableExtra(StorageVolume.EXTRA_STORAGE_VOLUME);
+volume.createAccessIntent(Environment.DIRECTORY_PICTURES);
+startActivityForResult(intent, request_code);
+</pre>
+
+<h2 id="best">Best Practices</h2>
+
+<p>Where possible, persist the external directory access URI so you don't have
+to repeatedly ask the user for access. Once the user has granted access, call
+<code>getContentResolver().takePersistableUriPermssion()</code> with the
+directory access URI. The system will persist the URI and subsequent access
+requests will return <code>RESULT_OK</code> and not show confirmation UI to the
+user.</p>
+
+<p>If the user denies access to an external directory, do not immediately
+request access again. Repeatedly insisting on access results in a poor user
+experience.</p>
diff --git a/docs/html/preview/features/security-config.jd b/docs/html/preview/features/security-config.jd
new file mode 100644
index 0000000..d7aef2d
--- /dev/null
+++ b/docs/html/preview/features/security-config.jd
@@ -0,0 +1,750 @@
+page.title=Network Security Configuration
+page.keywords=preview,security,network
+
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>In this document</h2>
+<ol>
+ <li><a href="#manifest">Adding a Security Configuration File</a></li>
+ <li><a href="#CustomTrust">Customizing Trusted CAs</a>
+ <ol>
+ <li><a href="#ConfigCustom">Configuring a Trusted Custom CA</a></li>
+ <li><a href="#LimitingCas">Limiting the Set of Trusted CAs</a></li>
+ <li><a href="#TrustingAdditionalCas">Trusting Additional CAs</a></li>
+ </ol>
+ </li>
+ <li><a href="#TrustingDebugCa">Debugging-only CAs</a></li>
+ <li><a href="#UsesCleartextTraffic">Opting Out of Cleartext Traffic</a></li>
+ <li><a href="#CertificatePinning">Pinning Certificates</a></li>
+ <li><a href="#ConfigInheritance">Configuration Inheritance Behavior</a></li>
+ <li><a href="#FileFormat">Configuration File Format</a></li>
+</ol>
+</div>
+</div>
+
+
+<p>
+ The Android N Developer Preview includes a Network Security Configuration
+ feature that lets apps customize their network security settings in a safe,
+ declarative configuration file without modifying app code. These settings can
+ be configured for specific domains and for a specific app. The key
+ capabilities of this feature are as follows:
+</p>
+
+<ul>
+ <li>
+ <b>Custom trust anchors:</b> Customize which Certificate Authorities (CA)
+ are trusted for an app's secure connections. For
+ example, trusting particular self-signed certificates or restricting the
+ set of public CAs that the app trusts.
+ </li>
+
+ <li>
+ <b>Debug-only overrides:</b> Safely debug secure connections in an app
+ without added risk to the installed base.
+ </li>
+
+ <li>
+ <b>Cleartext traffic opt-out:</b> Protect apps from from
+ accidental usage of cleartext traffic.
+ </li>
+
+ <li>
+ <b>Certificate pinning:</b> Restrict an app's secure connection to
+ particular certificates.
+ </li>
+</ul>
+
+
+<h2 id="manifest">Adding a Security Configuration File</h2>
+
+<p>
+ The Network Security Configuration feature uses an XML file where you specify
+ the settings for your app. You must include an entry in the manifest of your
+ app to point to this file. The following code excerpt from a manifest
+ demonstrates how to create this entry:
+</p>
+
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+...
+<app ...>
+ <meta-data android:name="android.security.net.config"
+ android:resource="@xml/network_security_config" />
+ ...
+</app>
+</pre>
+
+<h2 id="CustomTrust">Customizing Trusted CAs</h2>
+
+<p>
+ An app may want to trust a custom set of CAs instead of the platform
+ default. The most common reasons of this are:
+</p>
+
+<ul>
+ <li>Connecting to a host with a custom certificate authority(self-signed,
+ issued by an internal corporate CA, etc).
+ </li>
+
+ <li>Limiting the set of CAs to only the CAs you trust instead of every
+ preinstalled CA.
+ </li>
+
+ <li>Trusting additional CAs not included in the system.
+ </li>
+</ul>
+
+<p>
+ By default secure (e.g. TLS, HTTPS) connections from all apps trust
+ the pre-installed system CAs, and apps targeting API level 23
+ (Android M) and below also trust the user-added CA store by default. An
+ app can customize its own connections using {@code base-config} (for
+ app-wide customization) or {@code domain-config} (for per-domain
+ customization).
+</p>
+
+
+<h3 id="ConfigCustom">Configuring a Custom CA</h3>
+
+<p>
+ Assume you want to connect to your host which uses a self-signed SSL
+ certificate or to a host whose SSL certificate is issued by a non-public CA
+ which you trust, such as your company's internal CA.
+</p>
+
+<p>
+ <code>res/xml/network_security_config.xml</code>:
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <domain-config>
+ <domain includeSubdomains="true">example.com</domain>
+ <trust-anchors>
+ <certificates src="@raw/my_ca"/>
+ </trust-anchors>
+ </domain-config>
+</network-security-config>
+</pre>
+</p>
+
+<p>
+ Add the self-signed or non-public CA certificate, in PEM or DER format, to
+ {@code res/raw/my_ca}.
+</p>
+
+
+<h3 id="LimitingCas">Limiting the Set of Trusted CAs</h3>
+
+<p>
+ An app that does not want to trust all CAs trusted by system can
+ instead specify its own reduced set of CAs to trust. This protects the
+ app from fradulent certificates issued by any of the other CAs.
+</p>
+
+<p>
+ The config to limit the set of trusted CAs is similar to <a href=
+ "#TrustingACustomCa">trusting a custom CA</a> for a specific domain except
+ that multiple CAs are provided in the resource.
+</p>
+
+<p>
+<code>res/xml/network_security_config.xml</code>:
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <domain-config>
+ <domain includeSubdomains="true">secure.example.com</domain>
+ <domain includeSubdomains="true">cdn.example.com</domain>
+ <trust-anchors>
+ <certificates src="@raw/trusted_roots"/>
+ </trust-anchors>
+ </domain-config>
+</network-security-config>
+</pre>
+</p>
+
+<p>
+ Add the trusted CAs, in PEM or DER format, to {@code res/raw/trusted_roots}.
+ Note that if using PEM format the file must contain <em>only</em> PEM data
+ and no extra text. You can also provide multiple <a href=
+ "certificates"><code><certificates></code></a> elements instead of one.
+</p>
+
+
+<h3 id="TrustingAdditionalCas">
+ Trusting Additional CAs
+</h3>
+
+<p>
+ An app may want to trust additional CAs not trusted by the system,
+ this could be due to the system not yet including the CA or a CA that does
+ not meet the requirements for inclusion into the Android system. An
+ app can do this by specifying multiple certificate sources for a
+ configuration.
+</p>
+<p>
+<code>res/xml/network_security_config.xml</code>:
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <base-config>
+ <trust-anchors>
+ <certificates src="@raw/extracas"/>
+ <certificates src="system"/>
+ </trust-anchors>
+ </base-config>
+</network-security-config>
+</pre>
+</p>
+
+
+<h2 id="TrustingDebugCa">Configuring CAs for Debugging</h2>
+
+<p>
+ When debugging an app that connects over HTTPS you may want to
+ connect to a local development server, which does not have the SSL
+ certificate for your production server. In order to support this without any
+ modification to your app's code you can specify debug-only CAs that
+ are <i>only</i> trusted when <a href=
+ "{@docRoot}guide/topics/manifest/app-element.html#debug">android:debuggable</a>
+ is {@code true} by using {@code debug-overrides}. Normally IDEs and build
+ tools set this flag automatically for non-release builds.
+</p>
+
+<p>
+ This is safer than the usual conditional code because, as a security
+ precaution, app stores do not accept apps which are marked
+ debuggable.
+</p>
+
+<p>
+<code>res/xml/network_security_config.xml</code>:
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <debug-overrides>
+ <trust-anchors>
+ <certificates src="@raw/debug_cas"/>
+ </trust-anchors>
+ </debug-overrides>
+</network-security-config>
+</pre>
+</p>
+
+
+<h2 id="UsesCleartextTraffic">Opting Out of Cleartext Traffic</h2>
+
+<p>
+ Applications intending to connect to destinations using only secure
+ connections can opt-out of supporting cleartext (using unencrypted HTTP
+ protocol instead of HTTPS) to those destinations. This option helps prevent
+ accidental regressions in apps due to changes in URLs provided by external
+ sources such as backend servers.
+</p>
+
+<p>
+ See the reference documentation for \
+ {@code android.security.NetworkSecurityPolicy} class
+ {@code isCleartextTrafficPermitted()} method for more details.
+</p>
+
+<p>
+ For example, an app may want to ensure that all connections to {@code
+ secure.example.com} are always done over HTTPS to protect sensitive traffic
+ from hostile networks.
+</p>
+
+<p>
+<code>res/xml/network_security_config.xml</code>:
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <domain-config usesCleartextTraffic="false">
+ <domain includeSubdomains="true">secure.example.com</domain>
+ </domain-config>
+</network-security-config>
+</pre>
+</p>
+
+
+<h2 id="CertificatePinning">Pinning Certificates</h2>
+
+<p>
+ Normally an app trusts all preinstalled CAs. If any of these CAs were
+ to issue a fradulent certificate the app would be at risk from a MiTM
+ attack. Some apps choose to limit the set of certificates they accept
+ by either limiting the set of CAs they trust or by certificate pinning.
+</p>
+
+<p>
+ Certificate pinning is done by providing a set of certificates by hash of the
+ public key (SubjectPublicKeyInfo of the X.509 certificate). A certificate
+ chain is then only valid if the certificate chain contains at least one of
+ the pinned public keys.
+</p>
+
+<p>
+ Note that when using certificate pinning you should always include a backup
+ key so that if you are forced to switch to new keys, or change CAs (when
+ pinning to a CA certificate or an intermediate of that CA), your
+ app's connectivity is unaffected. Otherwise you must to push out
+ an update to the app to restore connectivity.
+</p>
+
+<p>
+ Additionally it is possible to set an expiration time for pins after which
+ pinning is not performed. This helps prevent connectivity issues in
+ apps which have not been updated. However, setting an expiration time
+ on pins may enable pinning bypass.
+</p>
+
+<p>
+<code>res/xml/network_security_config.xml</code>:
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <domain-config>
+ <domain includeSubdomains="true">example.com</domain>
+ <pin-set expiration="2018-01-01">
+ <pin digest="SHA-256">7HIpactkIAq2Y49orFOOQKurWxmmSFZhBCoQYcRhJ3Y=</pin>
+ <!-- backup pin -->
+ <pin digest="SHA-256">fwza0LRMXouZHRC8Ei+4PyuldPDcf3UKgO/04cDM1oE=</pin>
+ </domain-config>
+</network-security-config>
+</pre>
+</p>
+
+
+<h2 id="ConfigInheritance">Configuration Inheritance Behavior</h2>
+
+<p>
+ Values not set in a specific config are inherited. This behavior allows more
+ complex configurations while keeping the configuration file readable.
+</p>
+
+<p>
+ If a value is not set in a specific entry then value from the next more
+ general entry is used. Values not set in a {@code domain-config} is
+ taken from the parent {@code domain-config}, if nested, or from the {@code
+ base-config} if not. Values not set in the {@code base-config} uses the
+ platform default values.
+</p>
+
+<p>
+ For example consider, where all connections to subdomains of {@code
+ example.com} must use a custom set of CAs. Additonally cleartext traffic to
+ these domains is permitted <em>except</em> when connecting to {@code
+ secure.example.com}. By nesting the configuration for {@code
+ secure.example.com} inside the configuration for {@code example.com} the
+ {@code trust-anchors} does not need to be duplicated.
+</p>
+
+<p>
+<code>res/xml/network_security_config.xml</code>:
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <domain-config>
+ <domain includeSubdomains="true">example.com</domain>
+ <trust-anchors>
+ <certificates src="@raw/my_ca"/>
+ </trust-anchors>
+ <domain-config cleartextTrafficPermitted="false">
+ <domain includeSubdomains="true">secure.example.com</domain>
+ </domain-config>
+ </domain-config>
+</network-security-config>
+</pre>
+</p>
+
+
+<h2 id="FileFormat">Configuration File Format</h2>
+
+<p>
+ The Network Security Configuration feature uses an XML file format.
+ The overall structure of the file is shown in the following code sample:
+</p>
+
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+ <base-config>
+ <trust-anchors>
+ <certificates src="..."/>
+ ...
+ </trust-anchors>
+ </base-config>
+
+ <domain-config>
+ <domain>android.com</domain>
+ ...
+ <trust-anchors>
+ <certificates src="..."/>
+ ...
+ </trust-anchors>
+ <pin-set>
+ <pin digest="...">...</pin>
+ ...
+ </pin-set>
+ </domain-config>
+ ...
+ <debug-overrides>
+ <trust-anchors>
+ <certificates src="..."/>
+ ...
+ </trust-anchors>
+ </debug-overrides>
+</network-security-config>
+</pre>
+
+<p>
+ The following sections describe the syntax and other details of the file
+ format.
+</p>
+
+<h3 id="network-security-config">
+ <network-security-config>
+</h3>
+
+<dl class="xml">
+ <dt>
+ can contain:
+ </dt>
+
+ <dd>
+ 0 or 1 of <code><a href="#base-config"><base-config></a></code><br>
+ Any number of <code><a href=
+ "#domain-config"><domain-config></a></code><br>
+ 0 or 1 of <code><a href="#debug-overrides"><debug-overrides></a></code>
+ </dd>
+</dl>
+
+<h3 id="base-config">
+ <base-config>
+</h3>
+
+<dl class="xml">
+ <dt>
+ syntax:
+ </dt>
+</dl>
+
+<pre class="stx">
+<base-config <a href=
+"#usesCleartextTraffic">usesCleartextTraffic</a>=["true" | "false"]>
+ ...
+</base-config>
+</pre>
+<dl class="xml">
+ <dt>
+ can contain:
+ </dt>
+
+ <dd>
+ <code><a href="#trust-anchors"><trust-anchors></a></code>
+ </dd>
+
+ <dt>
+ description:
+ </dt>
+
+ <dd>
+ The default configuration used by all connections whose destination is not
+ covered by a <a href="#domain-config"><code>domain-config</code></a>.
+
+<p>
+ Any values that are not set use the platform default values. The default
+ configuration for apps targeting above API level 24 and above:
+</p>
+
+<pre>
+<base-config usesCleartextTraffic="true">
+ <trust-anchors>
+ <certificates src="system" />
+ </trust-anchors>
+</base-config>
+</pre>
+The default configuration for apps targeting API level 23 and below is:
+<pre>
+<base-config usesCleartextTraffic="true">
+ <trust-anchors>
+ <certificates src="system" />
+ <certificates src="user" />
+ </trust-anchors>
+</base-config>
+</pre>
+
+ </dd>
+</dl>
+
+<h3 id="domain-config"><domain-config></h3>
+<dl class="xml">
+<dt>syntax:</dt>
+<dd>
+<pre class="stx"><domain-config <a href="#usesCleartextTraffic">usesCleartextTraffic</a>=["true" | "false"]>
+ ...
+</domain-config></pre>
+</dd>
+
+<dt>Can Contain:</dt>
+
+<dd>
+1 or more <code><a href="#domain"><domain></a></code>
+<br/>0 or 1 <code><a href="#trust-anchors"><trust-anchors></a></code>
+<br/>0 or 1 <code><a href="#pin-set"><pin-set></code></a>
+<br/>Any number of nested <code><domain-config></code></dd>
+
+<dt>Description</dt>
+<dd>Configuration used for connections to specific destinations as the defined by {@code domain} elements.
+
+<p>Note that if multiple {@code domain-config} elements cover a destination the config with the most specific (longest)
+matching domain rule is used.</p></dd>
+</dl>
+
+
+<h3 id="domain"><domain></h3>
+
+<dl class="xml">
+ <dt>
+ syntax:
+ </dt>
+
+ <dd>
+ <pre class="stx">
+<domain includeSubdomains=["true" | "false"]>example.com</domain>
+</pre>
+ </dd>
+
+ <dt>
+ Attributes:
+ </dt>
+
+ <dd>
+ <dl class="attr">
+ <dt>
+ {@code includeSubdomains}
+ </dt>
+
+ <dd>
+ If {@code "true"} then this domain rule matches the domain and all
+ subdomains, including subdomains of subdomains, otherwise the rule only
+ applies to exact matches.
+ </dd>
+ </dl>
+ </dd>
+
+ <dt>
+ Description:
+ </dt>
+</dl>
+
+<h3 id="debug-overrides"><debug-overrides></h3>
+
+<dl class="xml">
+ <dt>
+ syntax:
+ </dt>
+
+ <dd>
+ <pre class="stx">
+<debug-overrides>
+ ...
+</debug-overrides>
+</pre>
+ </dd>
+
+ <dt>
+ Can Contain:
+ </dt>
+
+ <dd>
+ 0 or 1 <code><a href="#trust-anchors"><trust-anchors></a></code>
+ </dd>
+
+ <dt>
+ Description:
+ </dt>
+
+ <dd>
+ Overrides to be applied when <a href=
+ "{@docRoot}guide/topics/manifest/app-element.html#debug">android:debuggable</a>
+ is {@code "true"} which is normally the case for non-release builds
+ generated by IDEs and build tools. Trust anchors specified in {@code
+ debug-overrides} are added to all other configurations and certificate
+ pinning is not performed when the server's certificate chain uses one of
+ these debug-only trust anchors. If <a href=
+ "{@docRoot}guide/topics/manifest/app-element.html#debug">android:debuggable</a>
+ is {@code "false"} then this section is completely ignored.
+ </dd>
+</dl>
+
+<h3 id="trust-anchors"><trust-anchors></h3>
+<dl class="xml">
+ <dt>
+ syntax:
+ </dt>
+
+ <dd>
+ <pre class="stx">
+<trust-anchors>
+...
+</trust-anchors>
+</pre>
+ </dd>
+
+ <dt>
+ Can Contain:
+ </dt>
+
+ <dd>
+ Any number of <code><a href="#certificates"><certificates></a></code>
+ </dd>
+
+ <dt>
+ Description:
+ </dt>
+
+ <dd>
+ Set of trust anchors for secure connections.
+ </dd>
+</dl>
+
+
+<h3 id="certificates"><certificates></h3>
+<dl class="xml">
+<dt>syntax:</dt>
+<dd><pre class="stx"><certificates src=["system" | "user" | "<i>raw resource</i>"]
+ overridePins=["true" | "false"] />
+</pre></dd>
+<dt>description:</dt>
+<dd>Set of X.509 certificates for {@code trust-anchors} elements.</dd>
+
+<dt>attributes:</dt>
+<dd><dl class="attr">
+<dt>{@code src}</dt>
+<dd>
+The source of CA certificates, can be one of
+<ul>
+ <li>a raw resource id pointing to a file containing X.509 certificates.
+ Certificates must be encoded in DER or PEM format. In the case of PEM
+ certificates the file <em>must not</em> contain extra non-PEM data such as
+ comments.
+ </li>
+
+ <li>{@code "system"} for the pre-installed system CA certificates
+ </li>
+
+ <li>{@code "user"} for user-added CA certificates
+ </li>
+</ul>
+</dd>
+
+<dt>{@code overridePins}</dt>
+<dd>
+ <p>
+ Specifies if the CAs from this source bypass certificate pinning. If {@code
+ "true"} then certificate chains which chain through one of the CAs from this
+ source then pinning is not be performed. This can be useful for debug CAs
+ or to support letting the user MiTM your app's secure traffic.
+ </p>
+
+ <p>
+ Default is {@code "false"} unless specified in a {@code debug-overrides}
+ element, in which case the default is {@code "true"}.
+ </p>
+</dd>
+</dl>
+</dd>
+
+
+<h3 id="pin-set"><pin-set></h3>
+
+<dl class="xml">
+ <dt>
+ syntax:
+ </dt>
+
+ <dd>
+<pre class="stx">
+<pin-set expiration="date">
+...
+</pin-set>
+</pre>
+ </dd>
+
+ <dt>
+ Can Contain:
+ </dt>
+
+ <dd>
+ Any number of <code><a href="#pin"><pin></a></code>
+ </dd>
+
+ <dt>
+ Description:
+ </dt>
+
+ <dd>
+ A set of public key pins. For a secure connection to be trusted, one of the
+ public keys in the chain of trust must be in the set of pins. See
+ <code><a href="#pin"><pin></a></code> for the format of pins.
+ </dd>
+
+ <dt>
+ Attributes:
+ </dt>
+
+ <dd>
+ <dl class="attr">
+ <dt>
+ {@code expiration}
+ </dt>
+
+ <dd>
+ The date, in {@code yyyy-MM-dd} format, at and after which the pins
+ expire, thus disabling pinning. If the attribute is not set then the
+ pins do not expire.
+ <p>
+ Expiration helps prevent connectivity issues in apps which do
+ not get updates to their pin set, for example because the user
+ disabled app updates.
+ </p>
+ </dd>
+ </dl>
+ </dd>
+</dl>
+
+<h3 id="pin"><pin></h3>
+<dl class="xml">
+ <dt>
+ syntax:
+ </dt>
+
+ <dd>
+<pre class="stx">
+<pin digest=["SHA-256"]>base64 encoded digest of X.509
+ SubjectPublicKeyInfo (SPKI)</pin>
+</pre>
+ </dd>
+
+ <dt>
+ Attributes:
+ </dt>
+
+ <dd>
+ <dl class="attr">
+ <dt>
+ {@code digest}
+ </dt>
+
+ <dd>
+ The digest algorithm used to generate the pin. Currently only
+ {@code "SHA-256"} is supported.
+ </dd>
+ </dl>
+ </dd>
+</dl>
diff --git a/docs/html/preview/features/tv-recording-api.jd b/docs/html/preview/features/tv-recording-api.jd
new file mode 100644
index 0000000..83baf94
--- /dev/null
+++ b/docs/html/preview/features/tv-recording-api.jd
@@ -0,0 +1,120 @@
+page.title=TV Recording
+page.keywords=preview,sdk,tv,recording
+page.tags=androidn
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#supporting">Indicating Support for Recording</a></li>
+ <li><a href="#recording">Recording a Session</a></li>
+ <li><a href="#errors">Handling Recording Errors</a></li>
+ <li><a href="#sessions">Managing Recorded Sessions</a></li>
+ <li><a href="#best">Best Practices</a></li>
+ </ol>
+</div>
+</div>
+
+<p>TV input services let the user pause and resume channel playback via
+time-shifting APIs. The Android N Developer Preview expands on time-shifting
+by letting the user save multiple recorded sessions.</p>
+
+<p>Users can schedule recordings in advance, or start a recording as they watch
+a program. Once the system has saved a recording, the user can browse, manage,
+and play back the recording using the system TV app.</p>
+
+<p>If you want to provide recording functionality for your TV input service,
+you must indicate to the system that your app supports recording, implement
+the ability to record programs, handle and communicate any errors that occur
+during recording, and manage your recorded sessions.</p>
+
+<h2 id="supporting">Indicating Support for Recording</h2>
+
+<p>To tell the system that your TV input service supports recording, follow
+these steps:</p>
+
+<ol>
+<li>In your <code>TvInputService.onCreate()</code> method, create a new
+<code>TvInputInfo</code> object using the <code>TvInputInfo.Builder</code>
+class.</li>
+<li>When creating the new <code>TvInputInfo</code> object, call
+<code>setCanRecord(true)</code> before calling <code>build()</code> to
+indicate your service supports recording.</li>
+<li>Register your <code>TvInputInfo</code> object with the system by calling
+<code>TvInputService.updateTvInputInfo()</code>.</li>
+</ol>
+
+<h2 id="recording">Recording a Session</h2>
+
+<p>After your TV input service registers that it supports recording
+functionality, the system calls your
+<code>TvInputService.onCreateRecordingSession()</code> when it needs to access
+your app's recording implementation. Implement your own
+<code>TvInputService.RecordingSession</code> subclass and return it
+when the <code>onCreateRecordingSession()</code> callback
+fires. This subclass is responsible for switching to the correct channel data,
+recording the requested data, and communicating recording status and errors to
+the system.</p>
+
+<p>When the system calls <code>RecordingSession.onTune()</code>, passing in a
+channel URI, tune to the channel that the URI specifies. Notify the system that
+your app has tuned to the desired channel by calling <code>notifyTuned()</code>,
+or, if your app could not tune to the proper channel, call
+<code>notifyError()</code>.</p>
+
+<p>The system next invokes the <code>RecordingSession.onStartRecording()</code>
+callback. Your app must start recording immediately. When the system invokes
+this callback, it may provide a URI that contains information about the program
+that is about to be recorded. When the recording is done, you need to copy this
+data to the <code>RecordedPrograms</code> data table.</p>
+
+<p>Finally, the system calls <code>RecordingSession.onStopRecording()</code>.
+At this point, your app must stop recording immediately. You also need to
+create an entry in the <code>RecordedPrograms</code> table. This entry should
+include the recorded session data URI in the
+<code>RecordedPrograms.COLUMN_RECORDING_DATA_URI</code> column, and any program
+information that the system provided in the initial call to
+<code>onStartRecording()</code>.</p>
+
+<p>For more details on how to access the <code>RecordedPrograms</code> table
+see <a href="#sessions">Managing Recorded Sessions</a>.</p>
+
+<h2 id="errors">Handling Recording Errors</h2>
+
+<p>If an error occurs during recording, rendering the recorded data unusable,
+notify the system by calling <code>RecordingSession.notifyError()</code>.
+Similarly, you can call <code>notifyError()</code> after a recording session is
+created to let the system know that your app can no longer record sessions.</p>
+
+<p>If an error occurs during recording, but you'd like to provide a usable
+partial recording to users for playback, call
+<code>RecordingSession.notifyRecordingStopped()</code> to enable the system to
+use the partial session.</p>
+
+<h2 id="sessions">Managing Recorded Sessions</h2>
+
+<p>The system maintains information for all recorded sessions from all
+recording-capable channel apps in the <code>TvContract.RecordedPrograms</code>
+content provider table. This information is accessible via the
+<code>RecordedPrograms.Uri</code> content URI. Use content provider APIs to
+read, add, and delete entries from this table.</p>
+
+<p>For more information on working with content provider data see
+<a href="{@docRoot}guide/topics/providers/content-provider-basics.html">
+Content Provider Basics</a> .</p>
+
+<h2 id="best">Best Practices</h2>
+
+<p>TV devices may have limited storage, so use your best judgment when
+allocating storage to save recorded sessions. Use
+<code>RecordingCallback.onError(RECORDING_ERROR_INSUFFICIENT_SPACE)</code> when
+there isn't enough space to save a recorded session.</p>
+
+<p>When the user initiates recording, you should start recording data as soon
+as possible. To facilitate this, complete any up-front time-consuming tasks,
+like accessing and allocating storage space, when the system invokes the
+<code>onCreateRecordingSession()</code> callback. Doing so lets you start
+recording immediately when the <code>onStartRecording()</code> callback
+fires.</p>
diff --git a/docs/html/preview/guide.jd b/docs/html/preview/guide.jd
new file mode 100644
index 0000000..e768ba0
--- /dev/null
+++ b/docs/html/preview/guide.jd
@@ -0,0 +1,188 @@
+page.title=Testing Guide
+page.image=images/cards/card-n-guide_2x.png
+meta.tags="preview", "testing"
+page.tags="preview", "developer preview"
+
+@jd:body
+
+<div id="qv-wrapper">
+ <div id="qv">
+ <h2>In this document</h2>
+ <ol>
+ <li><a href="#runtime-permissions">Testing Permissions</a></li>
+ <li><a href="#doze-standby">Testing Doze and App Standby</a></li>
+ <li><a href="#ids">Auto Backup and Device Identifiers</a></li>
+ </ol>
+ </div>
+</div>
+
+<p>
+ The Android M Developer Preview gives you an opportunity to ensure your apps work with the next
+ version of the platform. This preview includes a number of APIs and behavior changes that can
+ impact your app, as described in the <a href="{@docRoot}preview/api-overview.html">API
+ Overview</a> and <a href="{@docRoot}preview/behavior-changes.html">Behavior Changes</a>. In testing
+ your app with the preview, there are some specific system changes that you should focus on to
+ ensure that users have a good experience.
+</p>
+
+<p>
+ This guide describes the what and how to test preview features with your app. You should
+ prioritize testing of these specific preview features, due to their high potential impact on your
+ app's behavior:
+</p>
+
+<ul>
+ <li><a href="#runtime-permissions">Permissions</a>
+ </li>
+ <li><a href="#doze-standby">Doze and App Standby</a>
+ </li>
+ <li><a href="#ids">Auto Backup and Device Identifiers</a></li>
+</ul>
+
+<p>
+ For more information about how to set up devices or virtual devices with a preview system image
+ for testing, see <a href="{@docRoot}preview/setup-sdk.html">Set up the Preview SDK</a>.
+</p>
+
+
+<h2 id="runtime-permissions">Testing Permissions</h2>
+
+<p>
+ The new <a href="{@docRoot}preview/features/runtime-permissions.html">Permissions</a> model
+ changes the way that permissions are allocated to your app by the user. Instead of granting all
+ permissions during the install procedure, your app must ask the user for individual permissions
+ at runtime. For users this behavior provides more granular control over each app’s activities, as
+ well as better context for understanding why the app is requesting a specific permission. Users
+ can grant or revoke the permissions granted to an app individually at any time. This feature of
+ the preview is most likely to have an impact on your app's behavior and may prevent some of your
+ app features from working, or they may work in a degraded state.
+</p>
+
+<p class="caution">
+ This change affects all apps running on the new platform, even those not targeting the new
+ platform version. The platform provides a limited compatibility behavior for legacy apps, but you
+ should begin planning your app’s migration to the new permissions model now, with a goal of
+ publishing an updated version of your app at the official platform launch.
+</p>
+
+
+<h3 id="permission-test-tips">Test tips</h3>
+
+<p>
+ Use the following test tips to help you plan and execute testing of your app with the new
+ permissions behavior.
+</p>
+
+<ul>
+ <li>Identify your app’s current permissions and the related code paths.</li>
+ <li>Test user flows across permission-protected services and data.</li>
+ <li>Test with various combinations of granted/revoked permission.</li>
+ <li>Use the {@code adb} tool to manage permssions from the command line:
+ <ul>
+ <li>List permissions and status by group:
+ <pre>adb shell pm list permissions -d -g</pre>
+ </li>
+ <li>Grant or revoke one or more permissions using the following syntax:<br>
+ <pre>adb shell pm [grant|revoke] <permission.name> ...</pre>
+ </li>
+ </ul>
+ </li>
+ <li>Analyze your app for services that use permissions.</li>
+</ul>
+
+<h3 id="permission-test-strategy">Test strategy</h3>
+
+<p>
+ The permissions change affects the structure and design of your app, as well as
+ the user experience and flows you provide to users. You should assess your app’s current
+ permissions use and start planning for the new flows you want to offer. The official release of
+ the platform provides compatibility behavior, but you should plan on updating your app and not
+ rely on these behaviors.
+</p>
+
+<p>
+ Identify the permissions that your app actually needs and uses, and then find the various code
+ paths that use the permission-protected services. You can do this through a combination of
+ testing on the new platform and code analysis. In testing, you should focus on opting in to
+ runtime permissions by changing the app’s {@code targetSdkVersion} to the preview version. For
+ more information, see <a href="{@docRoot}preview/setup-sdk.html#">Set up the Preview SDK</a>.
+</p>
+
+<p>
+ Test with various combinations of permissions revoked and added, to highlight the user flows that
+ depend on permissions. Where a dependency is not obvious or logical you should consider
+ refactoring or compartmentalizing that flow to eliminate the dependency or make it clear why the
+ permission is needed.
+</p>
+
+<p>
+ For more information on the behavior of runtime permissions, testing, and best practices, see the
+ <a href="{@docRoot}preview/features/runtime-permissions.html">Permissions</a> developer
+ preview page.
+</p>
+
+
+<h2 id="doze-standby">Testing Doze and App Standby</h2>
+
+<p>
+ The power saving features of Doze and App Standby limit the amount of background processing that
+ your app can perform when a device is in an idle state or while your app is not in focus. The
+ restrictions the system may impose on apps include limited or no network access,
+ suspended background tasks, suspended Notifications, ignored wake requests, and alarms. To ensure
+ that your app behaves properly with these power saving optimizations, you should test your app by
+ simulating these low power states.
+</p>
+
+<h4 id="doze">Testing your app with Doze</h4>
+
+<p>To test Doze with your app:</p>
+
+<ol>
+<li>Configure a hardware device or virtual device with a M Preview system image.</li>
+<li>Connect the device to your development machine and install your app.</li>
+<li>Run your app and leave it active.</li>
+<li>Simulate the device going into Doze mode by running the following commands:
+
+<pre>
+$ adb shell dumpsys battery unplug
+$ adb shell dumpsys deviceidle step
+$ adb shell dumpsys deviceidle -h
+</pre>
+
+ </li>
+ <li>Observe the behavior of your app when the device is re-activated. Make sure it
+ recovers gracefully when the device exits Doze.</li>
+</ol>
+
+
+<h4 id="standby">Testing apps with App Standby</h4>
+
+<p>To test the App Standby mode with your app:</p>
+
+<ol>
+ <li>Configure a hardware device or virtual device with a M Preview system image.</li>
+ <li>Connect the device to your development machine and install your app.</li>
+ <li>Run your app and leave it active.</li>
+ <li>Simulate the app going into standby mode by running the following commands:
+
+<pre>
+$ adb shell am broadcast -a android.os.action.DISCHARGING
+$ adb shell am set-idle <packageName> true
+</pre>
+
+ </li>
+ <li>Simulate waking your app using the following command:
+ <pre>$ adb shell am set-idle <packageName> false</pre>
+ </li>
+ <li>Observe the behavior of your app when it is woken. Make sure it recovers gracefully
+ from standby mode. In particular, you should check if your app's Notifications and background
+ jobs continue to function as expected.</li>
+</ol>
+
+<h2 id="ids">Auto Backup for Apps and Device-Specific Identifiers</h2>
+
+<p>If your app is persisting any device-specific identifiers, such as Google
+Cloud Messaging registration ID, in internal storage,
+make sure to follow best practices to exclude the storage
+location from auto-backup, as described in <a href="{@docRoot}preview/backup/index.html">Auto
+Backup for Apps</a>. </p>
diff --git a/docs/html/preview/images/bundles.png b/docs/html/preview/images/bundles.png
new file mode 100644
index 0000000..57d6bee
--- /dev/null
+++ b/docs/html/preview/images/bundles.png
Binary files differ
diff --git a/docs/html/preview/images/doze-diagram-1.png b/docs/html/preview/images/doze-diagram-1.png
new file mode 100644
index 0000000..0814447
--- /dev/null
+++ b/docs/html/preview/images/doze-diagram-1.png
Binary files differ
diff --git a/docs/html/preview/images/doze-diagram-2.png b/docs/html/preview/images/doze-diagram-2.png
new file mode 100644
index 0000000..c20c6cb
--- /dev/null
+++ b/docs/html/preview/images/doze-diagram-2.png
Binary files differ
diff --git a/docs/html/preview/images/inline-reply-sent.png b/docs/html/preview/images/inline-reply-sent.png
new file mode 100644
index 0000000..623e89e
--- /dev/null
+++ b/docs/html/preview/images/inline-reply-sent.png
Binary files differ
diff --git a/docs/html/preview/images/inline-reply.png b/docs/html/preview/images/inline-reply.png
new file mode 100644
index 0000000..cdf5d30
--- /dev/null
+++ b/docs/html/preview/images/inline-reply.png
Binary files differ
diff --git a/docs/html/preview/images/inline-type-reply.png b/docs/html/preview/images/inline-type-reply.png
new file mode 100644
index 0000000..6870bc2
--- /dev/null
+++ b/docs/html/preview/images/inline-type-reply.png
Binary files differ
diff --git a/docs/html/preview/images/m-preview-timeline-crop.png b/docs/html/preview/images/m-preview-timeline-crop.png
new file mode 100644
index 0000000..724a6af
--- /dev/null
+++ b/docs/html/preview/images/m-preview-timeline-crop.png
Binary files differ
diff --git a/docs/html/preview/images/m-preview-timeline.png b/docs/html/preview/images/m-preview-timeline.png
new file mode 100644
index 0000000..e9a339e
--- /dev/null
+++ b/docs/html/preview/images/m-preview-timeline.png
Binary files differ
diff --git a/docs/html/preview/images/mw-splitscreen.png b/docs/html/preview/images/mw-splitscreen.png
new file mode 100644
index 0000000..cbbd4a8
--- /dev/null
+++ b/docs/html/preview/images/mw-splitscreen.png
Binary files differ
diff --git a/docs/html/preview/images/pip-active.png b/docs/html/preview/images/pip-active.png
new file mode 100644
index 0000000..1e4bb63
--- /dev/null
+++ b/docs/html/preview/images/pip-active.png
Binary files differ
diff --git a/docs/html/preview/images/pip-button.png b/docs/html/preview/images/pip-button.png
new file mode 100644
index 0000000..b876b12
--- /dev/null
+++ b/docs/html/preview/images/pip-button.png
Binary files differ
diff --git a/docs/html/preview/images/scoped-folder-access-framed.png b/docs/html/preview/images/scoped-folder-access-framed.png
new file mode 100644
index 0000000..0169e41
--- /dev/null
+++ b/docs/html/preview/images/scoped-folder-access-framed.png
Binary files differ
diff --git a/docs/html/preview/images/scoped-folder-access-framed_2x.png b/docs/html/preview/images/scoped-folder-access-framed_2x.png
new file mode 100644
index 0000000..fd59ef1
--- /dev/null
+++ b/docs/html/preview/images/scoped-folder-access-framed_2x.png
Binary files differ
diff --git a/docs/html/preview/images/screen-zoom-1.png b/docs/html/preview/images/screen-zoom-1.png
new file mode 100644
index 0000000..f62d04e
--- /dev/null
+++ b/docs/html/preview/images/screen-zoom-1.png
Binary files differ
diff --git a/docs/html/preview/images/screen-zoom-2.png b/docs/html/preview/images/screen-zoom-2.png
new file mode 100644
index 0000000..172b5b3
--- /dev/null
+++ b/docs/html/preview/images/screen-zoom-2.png
Binary files differ
diff --git a/docs/html/preview/index.jd b/docs/html/preview/index.jd
new file mode 100644
index 0000000..778487d
--- /dev/null
+++ b/docs/html/preview/index.jd
@@ -0,0 +1,121 @@
+page.title=Android N Developer Preview
+page.tags="preview","developer"
+meta.tags="preview", "android"
+fullpage=true
+forcelocalnav=true
+header.hide=1
+footer.hide=1
+@jd:body
+
+<script>
+ $(document).ready(function() {
+ if (useUpdatedTemplates) {
+ $("#useUpdatedTemplates").css("display","block");
+ } else {
+ $("#useOldTemplates").css("display","block");
+ }
+ })
+</script>
+
+<section class="dac-expand dac-hero dac-light" style="background-color:#B2DFDB">
+ <div class="wrap" style="max-width:1100px;margin-top:0">
+ <div class="cols dac-hero-content" style="padding-bottom:1em;">
+
+ <div class="col-7of16 col-push-9of16" style="padding-left:2em">
+ <h1 class="dac-hero-title">Android N Developer Preview</h1>
+ <p class="dac-hero-description">
+ Get ready for Android N!
+ <strong>Test your apps</strong> Nexus and other devices. Support new system
+ behaviors to <strong>save power and memory</strong>.
+ Extend your apps with <strong>multiwindow UI</strong>,
+ <strong>direct reply notifications</strong> and more.
+ </p>
+
+ <a class="dac-hero-cta" href="{@docRoot}preview/overview.html">
+ <span class="dac-sprite dac-auto-chevron"></span>
+ Get started
+ </a><!--<br>
+ <a class="dac-hero-cta" href="{@docRoot}preview/support.html">
+ <span class="dac-sprite dac-auto-chevron"></span>
+ Update to Developer Preview (final SDK)
+ </a><br>-->
+ </div>
+ <div class="col-9of16 col-pull-7of16 dac-hero-figure" style="margin-top:1.5em;padding-right:1.5em;">
+ <img class="dac-hero-image" src="{@docRoot}images/home/n-preview-hero.png"
+ srcset="{@docRoot}images/home/n-preview-hero.png 1x,
+ {@docRoot}images/home/n-preview-hero_2x.png 2x">
+ </div>
+ </div>
+ <div class="dac-section dac-small">
+ <div class="resource-widget resource-flow-layout col-16"
+ data-query="collection:preview/landing/resources"
+ data-cardSizes="6x2"
+ data-maxResults="6"></div>
+ </div>
+ </div>
+</section>
+
+<div id="useUpdatedTemplates" style="display:none" class="dac-section dac-slim dac-gray dac-expand">
+ <div class="wrap dac-offset-parent">
+ <a class="dac-fab dac-scroll-button" data-scroll-button href="#build-apps">
+ <i class="dac-sprite dac-arrow-down-gray"></i>
+ </a>
+ <ul class="dac-actions">
+ <li class="dac-action">
+ <a class="dac-action-link" href="">
+ <i class="dac-action-sprite dac-sprite dac-auto-chevron-large"></i>
+ Report an issue
+ </a>
+ </li>
+ <li class="dac-action">
+ <a class="dac-action-link" href="{@docRoot}preview/support.html">
+ <i class="dac-action-sprite dac-sprite dac-auto-chevron-large"></i>
+ See known issues
+ </a>
+ </li>
+ <li class="dac-action">
+ <a class="dac-action-link" href="{@docRoot}preview/dev-community">
+ <i class="dac-action-sprite dac-sprite dac-auto-chevron-large"></i>
+ Watch stories
+ </a>
+ </li>
+ </ul>
+ </div><!-- end .wrap -->
+</div><!-- end .dac-actions -->
+
+<div id="useOldTemplates" style="display:none;color:black" class="actions-bar dac-expand dac-invert">
+ <div class="wrap dac-offset-parent">
+
+ <div class="actions">
+ <div><a href="">
+ <span class="dac-sprite dac-auto-chevron-large"></span>
+ Report an issue
+ </a></div>
+ <div><a href="{@docRoot}preview/support.html">
+ <span class="dac-sprite dac-auto-chevron-large"></span>
+ See known issues
+ </a></div>
+ <div><a href="{@docRoot}preview/dev-community">
+ <span class="dac-sprite dac-auto-chevron-large"></span>
+ Join Dev Community
+ </a></div>
+ </div><!-- end .actions -->
+ </div><!-- end .wrap -->
+</div>
+
+<section class="dac-section dac-light"><div class="wrap">
+ <h1 class="dac-section-title">Resources</h1>
+ <div class="dac-section-subtitle">
+ Essential information to help you get your apps ready for Android N.
+ </div>
+
+ <div class="resource-widget resource-flow-layout col-16"
+ data-query="collection:preview/landing/more"
+ data-cardSizes="6x6"
+ data-items-per-page="6"
+ data-maxResults="15"
+ data-initial-results="6"></div>
+
+ </div>
+</section>
+
diff --git a/docs/html/preview/license.jd b/docs/html/preview/license.jd
new file mode 100644
index 0000000..e3d1fbb
--- /dev/null
+++ b/docs/html/preview/license.jd
@@ -0,0 +1,145 @@
+page.title=License Agreement
+
+@jd:body
+
+<p>
+To get started with the Android SDK Preview, you must agree to the following terms and conditions.
+As described below, please note that this is a preview version of the Android SDK, subject to change, that you use at your own risk. The Android SDK Preview is not a stable release, and may contain errors and defects that can result in serious damage to your computer systems, devices and data.
+</p>
+
+<p>
+This is the Android SDK Preview License Agreement (the “License Agreement”).
+</p>
+<div class="sdk-terms" style="height:auto;border:0;padding:0;width:700px">
+1. Introduction
+
+1.1 The Android SDK Preview (referred to in the License Agreement as the “Preview” and specifically including the Android system files, packaged APIs, and Preview library files, if and when they are made available) is licensed to you subject to the terms of the License Agreement. The License Agreement forms a legally binding contract between you and Google in relation to your use of the Preview.
+
+1.2 "Android" means the Android software stack for devices, as made available under the Android Open Source Project, which is located at the following URL: http://source.android.com/, as updated from time to time.
+
+1.3 “Android-compatible” means any Android implemation that (i) complies with the Android Compatibility Definition document, which can be found at the Android compatibility website (http://source.android.com/compatibility) and which may be updated from time to time; and (ii) successfully passes the Android Compatibility Test Suite (CTS).
+
+1.4 "Google" means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States.
+
+2. Accepting the License Agreement
+
+2.1 In order to use the Preview, you must first agree to the License Agreement. You may not use the Preview if you do not accept the License Agreement.
+
+2.2 By clicking to accept and/or using the Preview, you hereby agree to the terms of the License Agreement.
+
+2.3 You may not use the Preview and may not accept the License Agreement if you are a person barred from receiving the Preview under the laws of the United States or other countries including the country in which you are resident or from which you use the Preview.
+
+2.4 If you will use the Preview internally within your company or organization you agree to be bound by the License Agreement on behalf of your employer or other entity, and you represent and warrant that you have full legal authority to bind your employer or such entity to the License Agreement. If you do not have the requisite authority, you may not accept the License Agreement or use the Preview on behalf of your employer or other entity.
+
+3. Preview License from Google
+
+3.1 Subject to the terms of this License Agreement, Google grants you a limited, worldwide, royalty-free, non-assignable, non-exclusive, and non-sublicensable license to use the Preview solely to develop applications for compatible implementations of Android.
+
+3.2 You may not use this Preview to develop applications for other platforms (including non-compatible implementations of Android) or to develop another SDK. You are of course free to develop applications for other platforms, including non-compatible implementations of Android, provided that this Preview is not used for that purpose.
+
+3.3 You agree that Google or third parties owns all legal right, title and interest in and to the Preview, including any Intellectual Property Rights that subsist in the Preview. "Intellectual Property Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you.
+
+3.4 You may not use the Preview for any purpose not expressly permitted by the License Agreement. Except to the extent required by applicable third party licenses, you may not: (a) copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the Preview or any part of the Preview; or (b) load any part of the Preview onto a mobile handset or any other hardware device except a personal computer, combine any part of the Preview with other software, or distribute any software or device incorporating a part of the Preview.
+
+3.5 Use, reproduction and distribution of components of the Preview licensed under an open source software license are governed solely by the terms of that open source software license and not the License Agreement. You agree to remain a licensee in good standing in regard to such open source software licenses under all the rights granted and to refrain from any actions that may terminate, suspend, or breach such rights.
+
+3.6 You agree that the form and nature of the Preview that Google provides may change without prior notice to you and that future versions of the Preview may be incompatible with applications developed on previous versions of the Preview. You agree that Google may stop (permanently or temporarily) providing the Preview (or any features within the Preview) to you or to users generally at Google's sole discretion, without prior notice to you.
+
+3.7 Nothing in the License Agreement gives you a right to use any of Google's trade names, trademarks, service marks, logos, domain names, or other distinctive brand features.
+
+3.9 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the Preview.
+
+4. Use of the Preview by You
+
+4.1 Google agrees that nothing in the License Agreement gives Google any right, title or interest from you (or your licensors) under the License Agreement in or to any software applications that you develop using the Preview, including any intellectual property rights that subsist in those applications.
+
+4.2 You agree to use the Preview and write applications only for purposes that are permitted by (a) the License Agreement, and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries).
+
+4.3 You agree that if you use the Preview to develop applications, you will protect the privacy and legal rights of users. If users provide you with user names, passwords, or other login information or personal information, you must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If users provide you with Google Account information, your application may only use that information to access the user's Google Account when, and for the limited purposes for which, each user has given you permission to do so.
+
+4.4 You agree that you will not engage in any activity with the Preview, including the development or distribution of an application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the servers, networks, or other properties or services of Google or any third party.
+
+4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through Android and/or applications for Android, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so.
+
+4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any breach of your obligations under the License Agreement, any applicable third party contract or Terms of Service, or any applicable law or regulation, and for the consequences (including any loss or damage which Google or any third party may suffer) of any such breach.
+
+4.7 The Preview is in development, and your testing and feedback are an important part of the development process. By using the Preview, you acknowledge that implementation of some features are still under development and that you should not rely on the Preview having the full functionality of a stable release. You agree not to publicly distribute or ship any application using this Preview as this Preview will no longer be supported after the official Android SDK is released.
+
+5. Your Developer Credentials
+
+5.1 You agree that you are responsible for maintaining the confidentiality of any developer credentials that may be issued to you by Google or which you may choose yourself and that you will be solely responsible for all applications that are developed under your developer credentials.
+
+6. Privacy and Information
+
+6.1 In order to continually innovate and improve the Preview, Google may collect certain usage statistics from the software including but not limited to a unique identifier, associated IP address, version number of the software, and information on which tools and/or services in the Preview are being used and how they are being used. Before any of this information is collected, the Preview will notify you and seek your consent. If you withhold consent, the information will not be collected.
+
+6.2 The data collected is examined in the aggregate to improve the Preview and is maintained in accordance with Google's Privacy Policy located at http://www.google.com/policies/privacy/.
+
+7. Third Party Applications
+
+7.1 If you use the Preview to run applications developed by a third party or that access data, content or resources provided by a third party, you agree that Google is not responsible for those applications, data, content, or resources. You understand that all data, content or resources which you may access through such third party applications are the sole responsibility of the person from which they originated and that Google is not liable for any loss or damage that you may experience as a result of the use or access of any of those third party applications, data, content, or resources.
+
+7.2 You should be aware the data, content, and resources presented to you through such a third party application may be protected by intellectual property rights which are owned by the providers (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on these data, content, or resources (either in whole or in part) unless you have been specifically given permission to do so by the relevant owners.
+
+7.3 You acknowledge that your use of such third party applications, data, content, or resources may be subject to separate terms between you and the relevant third party.
+
+8. Using Google APIs
+
+8.1 Google APIs
+
+8.1.1 If you use any API to retrieve data from Google, you acknowledge that the data may be protected by intellectual property rights which are owned by Google or those parties that provide the data (or by other persons or companies on their behalf). Your use of any such API may be subject to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this data (either in whole or in part) unless allowed by the relevant Terms of Service.
+
+8.1.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree that you shall retrieve data only with the user's explicit consent and only when, and for the limited purposes for which, the user has given you permission to do so.
+
+9. Terminating the License Agreement
+
+9.1 the License Agreement will continue to apply until terminated by either you or Google as set out below.
+
+9.2 If you want to terminate the License Agreement, you may do so by ceasing your use of the Preview and any relevant developer credentials.
+
+9.3 Google may at any time, terminate the License Agreement, with or without cause, upon notice to you.
+
+9.4 The License Agreement will automatically terminate without notice or other action upon the earlier of:
+(A) when Google ceases to provide the Preview or certain parts of the Preview to users in the country in which you are resident or from which you use the service; and
+(B) Google issues a final release version of the Android SDK.
+
+9.5 When the License Agreement is terminated, the license granted to you in the License Agreement will terminate, you will immediately cease all use of the Preview, and the provisions of paragraphs 10, 11, 12 and 14 shall survive indefinitely.
+
+10. DISCLAIMERS
+
+10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE PREVIEW IS AT YOUR SOLE RISK AND THAT THE PREVIEW IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE.
+
+10.2 YOUR USE OF THE PREVIEW AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE PREVIEW IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE. WITHOUT LIMITING THE FOREGOING, YOU UNDERSTAND THAT THE PREVIEW IS NOT A STABLE RELEASE AND MAY CONTAIN ERRORS, DEFECTS AND SECURITY VULNERABILITIES THAT CAN RESULT IN SIGNIFICANT DAMAGE, INCLUDING THE COMPLETE, IRRECOVERABLE LOSS OF USE OF YOUR COMPUTER SYSTEM OR OTHER DEVICE.
+
+10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+
+11. LIMITATION OF LIABILITY
+
+11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING.
+
+12. Indemnification
+
+12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Google, its affiliates and their respective directors, officers, employees and agents from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys’ fees) arising out of or accruing from (a) your use of the Preview, (b) any application you develop on the Preview that infringes any Intellectual Property Rights of any person or defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you of the License Agreement.
+
+13. Changes to the License Agreement
+
+13.1 Google may make changes to the License Agreement as it distributes new versions of the Preview. When these changes are made, Google will make a new version of the License Agreement available on the website where the Preview is made available.
+
+14. General Legal Terms
+
+14.1 the License Agreement constitutes the whole legal agreement between you and Google and governs your use of the Preview (excluding any services which Google may provide to you under a separate written agreement), and completely replaces any prior agreements between you and Google in relation to the Preview.
+
+14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is contained in the License Agreement (or which Google has the benefit of under any applicable law), this will not be taken to be a formal waiver of Google's rights and that those rights or remedies will still be available to Google.
+
+14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any provision of the License Agreement is invalid, then that provision will be removed from the License Agreement without affecting the rest of the License Agreement. The remaining provisions of the License Agreement will continue to be valid and enforceable.
+
+14.4 You acknowledge and agree that each member of the group of companies of which Google is the parent shall be third party beneficiaries to the License Agreement and that such other companies shall be entitled to directly enforce, and rely upon, any provision of the License Agreement that confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall be third party beneficiaries to the License Agreement.
+
+14.5 EXPORT RESTRICTIONS. THE PREVIEW IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE PREVIEW. THESE LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE.
+
+14.6 The License Agreement may not be assigned or transferred by you without the prior written approval of Google, and any attempted assignment without such approval will be void. You shall not delegate your responsibilities or obligations under the License Agreement without the prior written approval of Google.
+
+14.7 The License Agreement, and your relationship with Google under the License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from the License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction.
+
+
+</div>
\ No newline at end of file
diff --git a/docs/html/preview/overview.jd b/docs/html/preview/overview.jd
new file mode 100644
index 0000000..bb056f7
--- /dev/null
+++ b/docs/html/preview/overview.jd
@@ -0,0 +1,462 @@
+page.title=Program Overview
+page.metaDescription=Get your apps ready for the next version of Android.
+page.image=images/cards/card-n-overview_2x.png
+meta.tags="preview", "developer", "android"
+page.tags="preview", "developer", "android"
+
+@jd:body
+<!--
+<div class="cols" style=
+"background-color:#f2daf5; padding: 5px 0;margin-bottom:1em; text-align:center;">
+<h3>
+ Developer Preview 3 is now available
+ </h3>
+ <p>Includes final SDK and near-final system images</p>
+ <div style="margin:auto 1em">
+ <ul class="dac-section-links">
+ <li class="dac-section-link">
+ <a href="{@docRoot}preview/support.html#preview3-notes">
+ <span class="dac-sprite dac-auto-chevron"></span>
+ Read the Notes</a>
+ </li>
+
+ <li class="dac-section-link">
+ <a href="{@docRoot}preview/support.html#preview3-get">
+ <span class="dac-sprite dac-auto-chevron"></span>
+ Get the Update</a>
+ </li>
+
+ <li class="dac-section-link">
+ <a href="https://code.google.com/p/android-developer-preview/">
+ <span class="dac-sprite dac-auto-chevron"></span>
+ Report Issues</a>
+ </li>
+ </ul>
+ </div>
+</div>
+-->
+
+<p>
+ Welcome to the <strong>Android N Developer Preview</strong>, a program that
+ gives you everything you need to test and optimize your apps for the next
+ version of Android. It's free, and you can get started right away just by
+ downloading the N Developer Preview tools.
+</p>
+
+
+
+
+
+
+
+<div style="background-color:#eceff1;padding:1em;">
+<div class="wrap">
+ <div class="cols">
+ <div class="col-4of12">
+ <h5>
+ Hardware and emulator images
+ </h5>
+
+ <p>
+ Run and test your apps on Nexus 5X, 6, 6P, 9,
+ Pixel C, and Player, as well as other hardware
+ devices and emulator.
+
+ </p>
+ </div>
+
+ <div class="col-4of12">
+ <h5>
+ Latest platform code
+ </h5>
+
+ <p>
+ We’ll provide monthly updates during the Preview, so you’ll be testing against the latest platform changes.
+ </p>
+ </div>
+
+ <div class="col-4of12">
+ <h5>
+ Priority for developer issues
+ </h5>
+
+ <p>
+ During the first several weeks we’ll give priority to developer-reported
+ issues, so test and give feedback as soon as possible.
+ </p>
+ </div>
+
+ </div>
+
+ <div class="cols">
+
+
+ <div class="col-4of12">
+ <h5>
+ New behaviors and capabilities
+ </h5>
+
+ <p>
+ Start work early to support new platform behaviors and develop with new features.
+ </p>
+ </div>
+
+ <div class="col-4of12">
+ <h5>
+ Updates delivered by OTA
+ </h5>
+
+ <p>
+ Seamless over-the-air updates for any supported device through the Android Beta Program. No flashing is needed.
+ </p>
+ </div>
+
+ <div class="col-4of12">
+ <h5>
+ Feedback and support
+ </h5>
+
+ <p>
+ Report issues and give us feedback using our <a href="https://code.google.com/p/android-developer-preview/">issue tracker</a>.
+ Connect with other developers in the <a href="http://developer.android.com/preview/dev-community">N Developer Community</a>.
+ </p>
+ </div>
+ </div>
+</div>
+</div>
+
+<!--
+<p>New in the Android N Developer Preview: </p>
+
+<ul>
+ <li> Accompanying Android Beta Program for consumers, starting later in the preview</li>
+ <li> More supported devices, including devices from OEM partners</li>
+ <li> Seamless OTAs for your devices, from initial release to final N release without flashing</li>
+</ul>
+-->
+
+<h2 id="timeline">Timeline and updates</h2>
+<img src="{@docRoot}images/n-preview-updates_2x.png">
+
+<p>
+ The N Developer Preview runs from 9 March 2016 until the final Android N
+ public release to AOSP and OEMs, planned for Q3 2016.
+</p>
+
+<p>
+ At key development milestones, we’ll deliver updates for your development and
+ testing environment. In general you can expect an update each month (4 to 6
+ week interval). The milestones are listed below.
+</p>
+
+<ul>
+ <li><strong><a href="{@docRoot}preview/support.html">Preview 1</a></strong> (initial release, alpha)</li>
+ <li><strong>Preview 2</strong> (incremental update, beta)</li>
+ <li><strong>Preview 3</strong> (incremental update, beta)</li>
+ <li><strong>Preview 4</strong> (final APIs and official SDK, Play publishing)</li>
+ <li><strong>Preview 5</strong> (near-final system images for final testing)</li>
+ <li><strong>Final release</strong> to AOSP and ecosystem</li>
+</ul>
+
+<p>
+ Each update includes SDK tools, preview system images, emulators, reference
+ documentation, and API diffs.
+</p>
+
+<p>
+ The <strong>first three preview milestones</strong> provide an <strong>early
+ test and development environment</strong> that help you identify
+ compatibility issues in your current apps and plan migration or feature work
+ needed to target the new platform. This is the priority period in which to
+ give us your feedback on features and APIs and file compatibility issues
+ — for all of these, please use the issue tracker [link]. You can expect
+ some API changes across these updates.
+</p>
+
+<p>
+ At <strong>previews 4 and 5</strong> you’ll have access to the <strong>final
+ N APIs and SDK</strong> to develop with, as well as near-final system images
+ to test system behaviors and features. Android N will provide a standard API
+ level at this time. You can begin final compatibility testing of your legacy
+ apps and refine any new code that is using the N APIs or features.
+</p>
+
+<p>
+ Also starting in preview 4, you’ll be able to <strong>publish apps to
+ devices</strong> running Android N at the official API level, such as
+ consumer devices that have opted into the Android Beta program. You can
+ publish into the Google Play alpha and beta channels first, so you can test
+ your apps with Android Beta consumers before distributing broadly on the
+ store.
+</p>
+
+<p>
+ As you test and develop on Android N, we strongly recommend <strong>keeping
+ your development environment up-to-date</strong> as preview updates are
+ released. To make the process easier, you can enroll your test devices in the
+ Android Beta program and get <strong>updates over-the-air (OTA)</strong> at
+ each milestone. Alternatively, updated preview images are available that you
+ download and flash manually.
+</p>
+
+<p>
+ We’ll notify you when preview updates are available via the <a href=
+ "http://android-developers.blogspot.com/">Android Developers Blog</a>, as
+ well as this site and the <a href="https://developer.android.com/preview/dev-community">Android
+ N Developer Community</a>.
+</p>
+
+
+<h2 id="preview_tools">What's in the N Developer Preview?</h2>
+
+<p>
+ The N Developer Preview includes everything you need to test your existing
+ apps on a variety of screen sizes, network technologies, CPU/GPU chipsets,
+ and hardware architectures.
+</p>
+
+<h3 id="sdk_tools">SDK tools</h3>
+
+<p>You can download these components through the SDK Manager in <a href="{@docRoot}sdk/installing/adding-packages.html">Android Studio</a>:</p>
+
+<ul>
+ <li> N Developer Preview <strong>SDK and tools</strong>
+ <li> N Developer Preview <strong>emulator system image</strong> (32-bit & 64-bit)
+ <li> N Developer Preview <strong>emulator system Image for Android TV</strong> (32-bit)
+ <li> N Developer Preview support libraries (for new app templates)
+</ul>
+
+<p>
+ We’ll provide updates to these development tools at each milestone as needed.
+</p>
+
+<h3 id="hardware_system_images">Hardware system images</h3>
+
+<p>
+ The N Developer Preview includes hardware system images that you can use when
+ testing and developing on physical devices.
+</p>
+
+<p>
+ You can download these Nexus hardware system images from the <a href=
+ "{@docRoot}preview/download.html">Downloads page</a>:
+</p>
+
+<ul>
+ <li> <strong>Nexus 5X</strong> (GSM/LTE) "bullhead" device system image</li>
+ <li> <strong>Nexus 6 (GSM/LTE)</strong> "shamu" device system image</li>
+ <li> <strong>Nexus 6P (GSM/LTE)</strong> "angler" device system image</li>
+ <li> <strong>Nexus 9</strong> (Wi-Fi) "volantis" device system image</li>
+ <li> <strong>Nexus Player</strong> (Android TV) "fugu" device system image</li>
+ <li> <strong>Pixel C</strong> "ryu" device system image</li>
+</ul>
+
+<p>In addition, you can download these hardware system images from our Developer
+Preview partners:</p>
+
+<ul>
+ <li><strong>General Mobile 4G Dual (Android One)</strong> "seed" device system image</li>
+</ul>
+
+<p>
+ We’ll deliver updated system images for these devices at each milestone. You
+ can download and flash the updated system images to your test devices
+ manually, as frequently as you need. This is especially useful for automated
+ testing environments where you might need to reflash your device multiple
+ times.
+</p>
+
+<p class="note"><strong>Note</strong>:
+ <strong>Devices flashed manually will not get OTA updates</strong> like in
+ last year’s preview. This year, you can get OTAs by enrolling devices in the
+ Android Beta Program — see details in the next section.
+</p>
+
+<h3 id="android_beta">OTA Updates through Android Beta Program</h3>
+
+<p>
+ New for Android N is an Over-the-Air (OTA) update program that automatically
+ delivers the latest preview updates of Android N directly to devices enrolled
+ in the program. The program is free, and it’s open to anyone who has a
+ supported device that’s registered to their Google account.
+</p>
+
+<p>
+ To enroll in the program visit the Android Beta Program site [LINK]. You’ll
+ see all of the devices registered to your account that are eligible to enroll
+ in Android Beta.
+</p>
+
+<ol>
+ <li> Choose the devices you want to receive the Android N updates
+ <li> Click Enroll, read and agree to the terms of service, and then click OK
+</ol>
+
+<p>
+ Once you’ve enrolled, your device will soon receive an update. In most cases,
+ you will not need to do a full reset of your data to move to Android N, but
+ it’s recommended that you back up any data you don’t want to lose before
+ enrolling the device.
+</p>
+
+<p>
+ As updates are delivered to your device, we recommend downloading and
+ installing them as soon as possible. You’ll want to stay current with the
+ latest changes in system UI, behavior, APIs, and features.
+</p>
+
+<p>
+ At the conclusion of the Developer Preview, your enrolled devices will
+ receive an update to the official Android N release.
+</p>
+
+<p>
+ You can un-enroll your devices from the Android Beta program at any time from
+ the Android Beta site. Before un-enrolling, make sure to back-up your data on
+ the device.
+</p>
+
+ <p class="note"><strong>Note</strong>:
+ When you un-enroll, <strong>your device will be factory reset</strong>
+ to the latest version
+ of Android 6.0 Marshmallow (not necessarily the version that you had
+ installed prior to enrolling the device). To ensure a clean installation,
+ your data will be erased from the device, including contacts, messages,
+ photos, and so on.
+</p>
+
+<h3 id="documentation_and_sample_code">Documentation and sample code</h3>
+
+<p>
+ These documentation resources are available on the Developer Preview site to
+ help you learn about the Android N:
+</p>
+
+<ul>
+ <li> <a href="{@docRoot}preview/setup-sdk.html">Setting Up the SDK</a> has
+ step-by-step instructions for getting started.</li>
+ <li> <a href="{@docRoot}preview/testing/guide.html">Testing Guide</a>
+ and <a href="{@docRoot}preview/behavior-changes.html">Behavior
+ Changes</a> point you to key areas to test.</li>
+ <li> Documentation of new APIs, including an <a
+ href="{@docRoot}preview/api-overview.html">API Overview</a>, downloadable
+ <a href="{@docRoot}preview/download.html#docs">API
+ Reference</a>, and detailed developer guides on key features such as add
+ here, and others.
+ <li> <a href="{@docRoot}preview/samples.html">Sample code</a> that
+ demonstrates how to support permissions and other new features.
+ <li> <a href="{@docRoot}preview/support.html#release-notes">Release notes</a>
+ for the current version of the N Developer Preview, including change notes and
+ diff reports.
+</ul>
+
+<h4 id="reference">Downloadable API Reference</h4>
+
+<p>
+ During the early preview updates, you can download the latest API reference
+ for the Android N platform as a separate zip archive. [LINK] The reference
+ download also includes a diff report that helps you identify API changes from
+ API 23 and the previous update.
+</p>
+
+<p>
+ When the Android N APIs are final and an official API level is assigned,
+ we’ll provide the API reference to you online at <a href=
+ "https://developer.android.com">https://developer.android.com</a>.
+</p>
+
+<h3 id="support_resources">
+ Support resources
+</h3>
+
+<p>
+ As you test and develop on the N Developer Preview, please use these channels
+ to report issues and give feedback.
+</p>
+
+<ul>
+ <li> <a href="https://code.google.com/p/android-developer-preview/">N Developer Preview Issue
+ Tracker</a> is your <strong>primary feedback channel.</strong> You can report bugs, performance
+ issues, and general feedback through the issue tracker. You can also check for <a
+ href="https://code.google.com/p/android-developer-preview/wiki/KnownIssues">known issues</a> and
+ find workaround steps. We’ll keep you updated on your issue as it’s triaged and sent to
+ the Android engineering team for review. </li>
+ <li> The <a href="https://developer.android.com/preview/dev-community">Android N Developer Community</a> is
+ a Google+ community where you can <strong>connect with other developers</strong>working with
+ Android N. You can share observations or ideas or find answers to
+ questions about Android N. We’ll moderate the community and provide answers and
+ guidance as needed.</li>
+</ul>
+
+<h3 id="targeting">Targeting, preview APIs, and publishing</h3>
+
+<p>
+ The N Developer Preview provides a development-only system and Android
+ library that <strong>does not have a standard API level</strong>. If you want
+ to opt out of compatibility behaviors to test your app (which is strongly
+ recommended), you can target the preview version of Android N by setting your
+ app's <code><a href=
+ "{@docRoot}guide/topics/manifest/uses-sdk-element.html">targetSdkVersion</a></code>
+ to <code>“N”</code>.
+</p>
+
+<p>
+ The Android N Developer Preview delivers <strong>preview APIs</strong>
+ — the APIs will not be official until the final SDK is released,
+ currently planned for the third quarter of 2016. This means that you can
+ <strong>expect minor API changes</strong> over time, especially during
+ initial weeks of the program. We’ll provide a summary of changes to you with
+ each update of the Android N Developer Preview.
+</p>
+
+<p class="note">
+ <strong>Note</strong>: Although preview APIs may change, underlying
+ system behaviors are stable and ready for testing against
+ right away.
+</p>
+
+<p>
+ Google Play <strong>prevents publishing of apps targeting the N Developer
+ Preview</strong>. When the Android N final SDK is available, you’ll be able
+ to target the official Android N API level and publish your app to Google
+ Play via the alpha and beta release channels. Meanwhile, if you want to
+ distribute an app targeting Android M to testers, you can do so via email or
+ by direct download from your site.
+</p>
+
+<p>
+ At the full release of Android N to AOSP and OEMs, planned for Q3 2016,
+ you’ll be able to publish your apps targeting Android N to the public release
+ channel in Google Play.
+</p>
+
+
+<h2 id="how_to_get_started">How to get started</h2>
+
+<p>
+ To get started testing your app with Android N:
+</p>
+
+<ol>
+ <li> Review the <a href="{@docRoot}preview/api-overview.html">API Overview</a>
+ and <a href="{@docRoot}preview/behavior-changes.html">Behavior Changes</a> to
+ get an idea of what's new and how it affects your apps. In particular,
+ learn about the new <a href="{@docRoot}preview/features/runtime-permissions.html">runtime
+ permissions</a> model, power-saving features, and auto backup.</li>
+ <li> Set up your environment by following the instructions for <a
+ href="{@docRoot}preview/setup-sdk.html">Setting up the Preview SDK</a>
+ and configuring test devices.</li>
+ <li> Follow the <a href="https://developers.google.com/android/nexus/images">flashing
+ instructions</a> to flash the latest N Developer Preview system image for Nexus 5X,
+ 6, 6P, 9, Pixel C, and Player. </li>
+ <li> Review the <a href="{@docRoot}reference/packages.html">API Reference</a>
+ and <a href="{@docRoot}preview/samples.html">M Preview samples</a> to gain more
+ insight into new API features and how to use them in your app.
+ <li> Join the <a href="https://developer.android.com/preview/dev-community">Android N
+ Developer Community</a> to get the latest news and connect with other
+ developers working with the new platform.</li>
+</ol>
+
+<p>
+ Thank you for your participation in the Android N Developer Preview program!
+</p>
\ No newline at end of file
diff --git a/docs/html/preview/preview_toc.cs b/docs/html/preview/preview_toc.cs
new file mode 100644
index 0000000..406774f
--- /dev/null
+++ b/docs/html/preview/preview_toc.cs
@@ -0,0 +1,134 @@
+<ul id="nav">
+
+ <li class="nav-section">
+ <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/overview.html"
+ es-lang="Información general del programa"
+ ja-lang="プログラム概要"
+ ko-lang="프로그램 개요"
+ pt-br-lang="Visão geral do programa"
+ ru-lang="Обзор программы"
+ zh-cn-lang="计划概览"
+ zh-tw-lang="程式總覽">
+ Program Overview</a></div>
+ </li>
+ <li class="nav-section">
+ <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/setup-sdk.html"
+ es-lang="Configurar el SDK de la versión preliminar"
+ ja-lang="Preview SDK のセットアップ"
+ ko-lang="미리 보기 SDK 설정하기"
+ pt-br-lang="Configuração do Preview SDK"
+ ru-lang="Настройка пакета SDK Preview"
+ zh-cn-lang="设置预览版 SDK"
+ zh-tw-lang="設定預覽版 SDK">
+ SDK Setup</a></div>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>preview/behavior-changes.html"
+ es-lang="Cambios en los comportamientos"
+ ja-lang="動作の変更点"
+ ko-lang="동작 변경"
+ pt-br-lang="Mudanças de comportamento"
+ ru-lang="Изменения в работе"
+ zh-cn-lang="行为变更"
+ zh-tw-lang="行為變更">Behavior Changes
+ </a></div>
+ <ul>
+ <li><a href="<?cs var:toroot ?>preview/features/background-optimization.html"
+ >Background Optimizations</a></li>
+ <li><a href="<?cs var:toroot ?>preview/features/notification-updates.html"
+ >Notifications</a></li>
+ <li><a href="<?cs var:toroot ?>preview/features/multilingual-support.html"
+ >Language and Locale</a></li>
+ </ul>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header"><a href="<?cs var:toroot ?>preview/api-overview.html"
+ es-lang="Información general de la API"
+ ja-lang="API の概要"
+ ko-lang="API 개요"
+ pt-br-lang="Visão geral da API"
+ ru-lang="Обзор API-интерфейсов"
+ zh-cn-lang="API 概览"
+ zh-tw-lang="API 總覽">API Overview
+ </a></div>
+ <ul>
+
+ <li><a href="<?cs var:toroot ?>preview/features/multi-window.html"
+ >Multi-Window Support</a></li>
+
+ <li><a href="<?cs var:toroot ?>preview/features/data-saver.html"
+ >Data Saver</a></li>
+
+ <li><a href="<?cs var:toroot ?>preview/features/tv-recording-api.html"
+ >TV Recording</a></li>
+
+ <li><a href="<?cs var:toroot ?>preview/features/security-config.html"
+ >Network Security Configuration</a></li>
+
+ <li><a href="<?cs var:toroot ?>preview/features/icu4j-framework.html"
+ >ICU4J Support</a></li>
+ </ul>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="nav-section">
+ <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/samples.html"
+ es-lang="Ejemplos"
+ ja-lang="サンプル"
+ ko-lang="샘플"
+ pt-br-lang="Exemplos"
+ ru-lang="Примеры"
+ zh-cn-lang="示例"
+ zh-tw-lang="範例">
+ Samples</a></div>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/download.html"
+ >Getting System Updates</a></div>
+ </li>
+
+
+ <li class="nav-section">
+ <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/support.html">
+ Support and Release Notes</a></div>
+ </li>
+
+ <li class="nav-section">
+ <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/license.html"
+ es-lang="Contrato de licencia"
+ ja-lang="使用許諾契約"
+ ko-lang="라이선스 계약"
+ pt-br-lang="Contrato de licença"
+ ru-lang="Лицензионное соглашение"
+ zh-cn-lang="许可协议"
+ zh-tw-lang="授權協議">
+ License Agreement</a></div>
+ </li>
+
+</ul>
diff --git a/docs/html/preview/samples.jd b/docs/html/preview/samples.jd
new file mode 100644
index 0000000..bdcbc89
--- /dev/null
+++ b/docs/html/preview/samples.jd
@@ -0,0 +1,82 @@
+page.title=Samples
+page.tags="preview", "samples", "android"
+page.image=images/cards/card-n-samples_2x.png
+@jd:body
+
+<p>
+ The following code samples are provided for the N Developer Preview. To
+ download the samples in Android Studio, select the <b>File > Import
+ Samples</b> menu option.
+</p>
+
+<p class="note">
+ <strong>Note:</strong> These downloadable projects are designed
+ for use with Gradle and Android Studio.
+</p>
+
+
+<h3 id="mw">Multi-Window Playground</h3>
+<p>
+ This sample demonstrates how to take advantage of multiple window
+ user interfaces with your app.
+</p>
+<p>
+ <a href="https://github.com/googlesamples/android-MultiwindowPlayground">
+ Get it on GitHub</a>
+</p>
+
+
+<h3 id="notifications">Notifications</h3>
+<p>
+ This sample is updated to demonstrates how to take advantage of new
+ notifications features available in the N Developer Preview.
+</p>
+<p>
+ <a href="https://github.com/googlesamples/android-Notifications">
+ Get it on GitHub</a>
+</p>
+
+
+<h3 id="jobsched">JobScheduler</h3>
+<p>
+ This sample demonstrates how to use the JobScheduler API to schedule
+ background tasks when certain conditions apply, such as network or charging
+ state.
+</p>
+<p>
+ <a href="https://github.com/googlesamples/android-JobScheduler">
+ Get it on GitHub</a>
+</p>
+
+
+<h3 id="fbe">File Based Encryption</h3>
+<p>
+ This sample demonstrates how to store and access data in a device encrypted
+ storage which is always available while the device is booted.
+</p>
+<p>
+ <a href="https://github.com/googlesamples/android-FileBasedEncryption">
+ Get it on GitHub</a>
+</p>
+
+
+<h3 id="sda">Scoped Directory Access</h3>
+<p>
+ This sample demonstrates how to read and write data from specific
+ directories, while requiring fewer permissions.
+</p>
+<p>
+ <a href="https://github.com/googlesamples/android-ScopedDirectoryAccess">
+ Get it on GitHub</a>
+</p>
+
+
+<h3 id="AutomaticBackup">Drag and Drop</h3>
+<p>
+ This sample demonstrates how to use drag and drop user interface feature
+ between windows, when using a multi-window view.
+</p>
+<p>
+ <a href="https://github.com/googlesamples/android-DragAndDrop">
+ Get it on GitHub</a>
+</p>
\ No newline at end of file
diff --git a/docs/html/preview/setup-sdk.jd b/docs/html/preview/setup-sdk.jd
new file mode 100644
index 0000000..ea5eaf6
--- /dev/null
+++ b/docs/html/preview/setup-sdk.jd
@@ -0,0 +1,268 @@
+page.title=Set Up the SDK
+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">
+ <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>
+ </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.
+</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>
+
+
+<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>
+
+<ol>
+ <li>Download, install, and launch the current version of
+ <a href="{@docRoot}tools/studio/index.html">Android Studio</a>.
+ </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</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>
+</ol>
+
+
+<h2 id="java8">Get the Java 8 JDK</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.
+</p>
+
+<p>To set the JDK version in Android Studio:</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 >
+ 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>.
+ </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>
+
+<p>
+ In order to use the preview APIs, you must create or update a development
+ project to use the preview components.
+</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
+ follows:
+</p>
+
+<pre>
+android {
+ compileSdkVersion <strong>'android-N'</strong>
+ ...
+
+ defaultConfig {
+ ...
+ minSdkVersion <strong>'N'</strong>
+ targetSdkVersion <strong>'N'</strong>
+ ...
+ }
+ ...
+}</pre>
+
+
+
+<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>
+
+<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>
+</ol>
+
+<p>
+ For more information about creating virtual devices for testing, see <a href=
+ "{@docRoot}tools/devices/index.html">Managing Virtual Devices</a>.
+</p>
diff --git a/docs/html/preview/support.jd b/docs/html/preview/support.jd
new file mode 100644
index 0000000..66d3877
--- /dev/null
+++ b/docs/html/preview/support.jd
@@ -0,0 +1,137 @@
+page.title=Support and Release Notes
+meta.keywords="preview", "android"
+page.tags="preview", "developer preview"
+page.image=images/cards/card-n-support_2x.png
+
+@jd:body
+
+
+<p>
+ Two primary support channels are available to you when developing and testing
+ with the Android N Developer Preview. If you've encountered bugs or have
+ feedback about the N Developer Preview, you can <a href=
+ "https://code.google.com/p/android-developer-preview/">create an issue</a>
+ <strong>***NEED LINK***</strong> on
+ our issue tracker. We'll triage the issue for further review and provide
+ updates as needed.
+</p>
+
+<p>
+ To discuss issues or ideas with other developers working with the N Developer
+ Preview, join the <a href="http://example.com">N Developer
+ Preview Google+ community</a>. <strong>***NEED LINK***</strong>
+</p>
+
+
+
+<h2 id="preview1-notes">
+ Developer Preview 1
+</h2>
+
+<div class="wrap">
+ <div class="cols">
+ <div class="col-6of12">
+ <p>
+ <em>
+ Date: March 2016<br>
+ Build: <strong>TBA</strong><br>
+ Hardware support: <strong>TBA</strong><br>
+ Emulator support: <strong>TBA</strong><br>
+ Google Play services: <strong>TBA</strong><br>
+ </em>
+ </p>
+ </div>
+ </div>
+</div>
+
+<p>
+ Initial release.
+</p>
+
+<h3 id="ki-p1">
+ Known issues
+</h3>
+
+<h4 id="ki-g-p1">General issues:</h4>
+
+<ul>
+ <li>Dialer does not currently support Direct Boot.
+ </li>
+
+ <li>Some new or modified strings in the system UI are not translated to all
+ languages.
+ </li>
+
+ <li>
+ <strong>Settings</strong> controls and toggles may be slow or appear to be
+ unresponsive.
+ </li>
+
+ <li>Android for Work:
+ <ul>
+ <li>After migrating to (or creation on) N Developer Preview, work
+ profiles can't create keys in keystore until the pattern/PIN/password is
+ changed or a Work Challenge is set up.
+ </li>
+
+ <li>In Direct Boot mode, when passcode restrictions are applied to the
+ device, the work profile may be unlocked even though the device is
+ locked.
+ </li>
+ </ul>
+ </li>
+</ul>
+
+<!--
+
+<h4 id="">[Platform Name] issues:</h4>
+
+<ul>
+ <li>TBA: Issues for that platform</li>
+ </li>
+</ul>
+
+<h4 id="">[Platform Name] issues:</h4>
+
+<ul>
+ <li>TBA: Issues for that platform</li>
+ </li>
+</ul>
+
+<h4 id="">[Platform Name] issues:</h4>
+
+<ul>
+ <li>TBA: Issues for that platform</li>
+ </li>
+</ul>
+
+-->
+
+<p>
+ For a complete list of reported issues, please refer to the <a href=
+ "https://code.google.com/p/android/issues/list">open issues list</a> on the
+ Developer Preview <a href=
+ "https://code.google.com/p/android-developer-preview/">issue tracker</a>.
+ <strong>***NEED LINKS***</strong>
+</p>
+
+<h3 id="preview1-get">
+ Get the N Developer Preview
+</h3>
+
+<p>
+ You can download the N Developer Preview platform and emulator images from
+ the SDK Manager. <strong>***Is this true?***</strong>
+</p>
+
+<p>
+ For instructions on how to download and flash your device to the Developer
+ Preview, see the links and instructions on the <a href=
+ "{@docRoot}preview/download.html">Downloads</a> page.
+</p>
+
+<p>
+ For instructions on how to start developing and testing with the N
+ Developer Preview, read
+ <a href="{@docRoot}preview/setup-sdk.html">Set up the SDK</a>.
+</p>