Merge "docs: fix blog post link, add arm image, fix ecosystem text" into klp-modular-dev
diff --git a/docs/html/auto/images/assets/do_02_music_night.png b/docs/html/auto/images/assets/do_02_music_night.png
new file mode 100644
index 0000000..7faccfb
--- /dev/null
+++ b/docs/html/auto/images/assets/do_02_music_night.png
Binary files differ
diff --git a/docs/html/auto/images/assets/do_05_template.png b/docs/html/auto/images/assets/do_05_template.png
index 379253d..63a07d8 100644
--- a/docs/html/auto/images/assets/do_05_template.png
+++ b/docs/html/auto/images/assets/do_05_template.png
Binary files differ
diff --git a/docs/html/auto/images/assets/do_05_template_night.png b/docs/html/auto/images/assets/do_05_template_night.png
new file mode 100644
index 0000000..6acd259
--- /dev/null
+++ b/docs/html/auto/images/assets/do_05_template_night.png
Binary files differ
diff --git a/docs/html/auto/index.jd b/docs/html/auto/index.jd
index 2c0334e..ad59210 100644
--- a/docs/html/auto/index.jd
+++ b/docs/html/auto/index.jd
@@ -53,6 +53,21 @@
left:7px;
z-index:1;
}
+.sdk-link {
+ font-size:16px;
+ padding-left:5px;
+ padding-right:15px;
+}
+.sdk-link-title {
+ font-size:18px;
+ padding-left:5px;
+ padding-right:15px;
+}
+.sdk-link-desc {
+ font-size:14px;
+ padding-left:5px;
+ padding-right:15px;
+}
</style>
@@ -201,9 +216,6 @@
<div class="landing-section-header">
<div class="landing-pre-h1">Coming soon</div>
<div class="landing-h1">Android Auto SDK</div>
- <div style="text-align:center;margin-top:20px;font-size:14pt;margin-bottom:-5px">
- <a href="https://docs.google.com/a/google.com/forms/d/1ANgYOoYLkfyZ2JRPSU34Nep5yNaU-Ha2syXJ9b4xLrA/viewform">Sign up for updates</a>
- </div>
</div>
<div class="landing-body">
@@ -211,19 +223,30 @@
and tools to make your existing apps compatible with Android Auto. The first version
of the SDK will provide templates and APIs for music, podcast, live radio, and audio
news apps, as well as limited voice actions.</p>
- <p style="margin-bottom:40px">
- Future versions of the Android Auto SDK will include support for a selection of
- Android notifications, additional voice actions, and templates and APIs for
- messaging, communication, local search, and more.</p>
- <a target="_blank" href="http://g.co/androidautodev">
- <img class="landing-social-image" src="//www.google.com/images/icons/product/gplus-128.png" alt="+Android Auto Developers">
- </a>
- <p>
- Join the Android Auto developer community on Google+ to stay involved, get the
- latest updates, and exchange experiences with other developers.
- <a target="_blank" href="http://g.co/androidautodev">+Android Auto Developers</a>
- </p>
+ <div class="cols" style="margin-top:40px">
+ <div class="col-3-wide">
+ <p class="sdk-link-title">Updates</p>
+ <p class="sdk-link-desc">
+ Register to receive more information and be notified when the SDK is available.
+ </p>
+ <a class="sdk-link" href="https://docs.google.com/a/google.com/forms/d/1ANgYOoYLkfyZ2JRPSU34Nep5yNaU-Ha2syXJ9b4xLrA/viewform">Sign up for updates</a>
+ </div>
+ <div class="col-3-wide">
+ <p class="sdk-link-title">Google+ Community</p>
+ <p class="sdk-link-desc">
+ Stay involved, get updates, and exchange experiences with other developers.
+ </p>
+ <a class="sdk-link" href="http://g.co/androidautodev">Discuss on Google+</a>
+ </div>
+ <div class="col-3-wide">
+ <p class="sdk-link-title">Developer Overview</p>
+ <p class="sdk-link-desc">
+ Learn more about developing apps for Android Auto when the SDK is available.
+ </p>
+ <a class="sdk-link" href="{@docRoot}auto/overview.html">Learn about the platform</a>
+ </div>
+ </div>
</div>
</div> <!-- end .wrap -->
diff --git a/docs/html/auto/overview.jd b/docs/html/auto/overview.jd
index 6c02641..8f05d4f 100644
--- a/docs/html/auto/overview.jd
+++ b/docs/html/auto/overview.jd
@@ -306,6 +306,24 @@
<p>All the templates support different color schemes for day and night.
The platform provides the state (day or night) and makes adjustments automatically.</p>
+<div class="cols">
+<div class="auto-col-2">
+ <div class="auto-img-container-cols">
+ <img class="auto-img-frame-cols" src="{@docRoot}auto/images/assets/00_frame.png" />
+ <img class="auto-img-shot-cols" src="{@docRoot}auto/images/assets/do_02_music.png" />
+ </div>
+</div>
+<div class="auto-col-2">
+ <div class="auto-img-container-cols">
+ <img class="auto-img-frame-cols" src="{@docRoot}auto/images/assets/00_frame.png" />
+ <img class="auto-img-shot-cols" src="{@docRoot}auto/images/assets/do_02_music_night.png" />
+ </div>
+</div>
+</div>
+<p class="img-caption">
+ <strong>Figure 6.</strong> Day and night modes.
+</p>
+
<h3 id="customizetemplates">Customizing Templates</h3>
<p>To customize the templates, provide the following app-specific resources and actions
diff --git a/docs/html/google/gcm/ccs.jd b/docs/html/google/gcm/ccs.jd
index 03addfd..4389e3d 100644
--- a/docs/html/google/gcm/ccs.jd
+++ b/docs/html/google/gcm/ccs.jd
@@ -19,7 +19,11 @@
<li><a href="#response">Response format</a></li>
</ol>
</li>
- <li><a href="#upstream">Upstream Messages</a> </li>
+ <li><a href="#upstream">Upstream Messages</a>
+ <ol>
+ <li><a href="#receipts">Receive return receipts</a></li>
+ </ol>
+ </li>
<li><a href="#flow">Flow Control</a> </li>
<li><a href="#implement">Implementing an XMPP-based App Server</a>
<ol class="toc">
@@ -43,9 +47,6 @@
</div>
</div>
-<p class="note"><strong>Note:</strong> To try out this feature, sign up using
-<a href="https://services.google.com/fb/forms/gcm/">this form</a>.</p>
-
<p>The GCM Cloud Connection Server (CCS) is an XMPP endpoint that provides a
persistent, asynchronous, bidirectional connection to Google servers. The
connection can be used to send and receive messages between your server and
@@ -149,8 +150,8 @@
<li>CCS adds the field {@code message_id}, which is required. This ID uniquely
identifies the message in an XMPP connection. The ACK or NACK from CCS uses the
{@code message_id} to identify a message sent from 3rd-party app servers to CCS.
-Therefore, it's important that this {@code message_id} not only be unique, but
-always present.</li>
+Therefore, it's important that this {@code message_id} not only be unique (per
+sender ID), but always present.</li>
</ul>
<p>In addition to regular GCM messages, control messages are sent, indicated by
@@ -188,7 +189,8 @@
"hello":"world",
}
"time_to_live":"600",
- "delay_while_idle": true/false
+ "delay_while_idle": true/false,
+ "delivery_receipt_requested": true/false
}
</gcm>
</message>
@@ -227,42 +229,48 @@
<p>Below are some examples.</p>
<p>Bad registration:</p>
+
<pre><message>
- <data:gcm xmlns:data="google:mobile:data">
+ <gcm xmlns="google:mobile:data">
{
- "error":"BAD_REGISTRATION", // error code
+ "message_type":"nack",
"message_id":"msgId1",
- "from":"PA91bHFOtaQGSwupt5l1og",
- "message_type":"nack"
+ "from":"SomeInvalidRegistrationId",
+ "error":"BAD_REGISTRATION",
+ "error_description":"Invalid token on 'to' field: SomeInvalidRegistrationId"
}
- </data:gcm>
+ </gcm>
</message></pre>
-<p>Invalid "time to live":</p>
+<p>Invalid JSON:</p>
<pre><message>
- <data:gcm xmlns:data="google:mobile:data">
- {
- "error":"InvalidJson : INVALID_TTL : Invalid value (-1) for \"time_to_live\": must be between 0 and \"2419200\"\n",
- "message_id":"msgId1",
- "from":"APA91bHFOtaQGSwupt5l1og",
- "message_type":"nack"
- }
- </data:gcm>
-</message></pre>
+ <gcm xmlns="google:mobile:data">
+ {
+ "message_type":"nack",
+ "message_id":"msgId1",
+ "from":"APA91bHFOtaQGSwupt5l1og",
+ "error":"INVALID_JSON",
+ "error_description":"InvalidJson: JSON_TYPE_ERROR : Field \"time_to_live\" must be a JSON java.lang.Number: abc"
+ }
+ </gcm>
+</message>
+</pre>
-<p>JSON type error:</p>
+<p>Quota exceeded:</p>
<pre><message>
- <data:gcm xmlns:data="google:mobile:data">
- {
- "error":"InvalidJson : JSON_TYPE_ERROR : Field \"delay_while_idle\" must be a JSON java.lang.Boolean: not-boolean-user-supplied-value\n",
- "message_id":"msgId1",
- "from":"APA91bHFOtaQGSwupt5l1og",
- "message_type":"nack"
- }
- </data:gcm>
-</message></pre>
+ <gcm xmlns="google:mobile:data">
+ {
+ "message_type":"nack",
+ "message_id":"msgId1",
+ "from":"APA91bHFOtaQGSwupt5l1og",
+ "error":"QUOTA_EXCEEDED",
+ "error_description":"Short-term downstream quota exceeded for this registration id"
+ }
+ </gcm>
+</message>
+</pre>
<p>The following table lists NACK error codes. Unless otherwise
@@ -300,7 +308,7 @@
</tr>
<tr>
<td>{@code INVALID_JSON}</td>
-<td>The JSON message payload was not valid.</td>
+<td>The JSON message payload is not valid.</td>
</tr>
<tr>
<td>{@code QUOTA_EXCEEDED}</td>
@@ -309,10 +317,10 @@
rate.</td>
</tr>
<tr>
-<td>{@code SERVICE_UNAVAILABLE}</td>
-<td>CCS is not currently able to process the message. The
-message should be retried over the same connection using exponential backoff
-with an initial delay of 1 second.</td>
+ <td>{@code SERVICE_UNAVAILABLE}</td>
+ <td>CCS is not currently able to process the message. The
+ message should be retried over the same connection using exponential backoff
+ with an initial delay of 1 second.</td>
</tr>
</table>
@@ -382,8 +390,8 @@
// Bundle data consists of a key-value pair
data.putString("hello", "world");
// "time to live" parameter
-// This is optional. It specifies a value in seconds up to 4 weeks.
-int ttl = [0 seconds, 4 weeks]
+// This is optional. It specifies a value in seconds up to 24 hours.
+int ttl = [0 seconds, 24 hours]
gcm.send(GCM_SENDER_ID + "@gcm.googleapis.com", id, ttl, data);
</pre>
@@ -419,6 +427,69 @@
</gcm>
</message></pre>
+<h3 id="receipts">Receive return receipts</h3>
+
+<p>You can use upstream messaging to get receipt notifications, confirming
+that a given message was sent to a device. Your 3rd-party app server receives the receipt
+notification from CCS once the message has been sent to the device.</p>
+
+<p>To enable this feature, the message your 3rd-party app server sends to CCS must include
+a field called <code>"delivery_receipt_requested"</code>. When this field is set to
+<code>true</code>, CCS sends a return receipt. Here is an XMPP stanza containing a JSON
+message with <code>"delivery_receipt_requested"</code> set to <code>true</code>:</p>
+
+<pre><message id="">
+ <gcm xmlns="google:mobile:data">
+ {
+ "to":"REGISTRATION_ID",
+ "message_id":"m-1366082849205"
+ "data":
+ {
+ "hello":"world",
+ }
+ "time_to_live":"600",
+ "delay_while_idle": true,
+ <strong>"delivery_receipt_requested": true</strong>
+ }
+ </gcm>
+</message>
+</pre>
+
+<p>Here is an example of a receipt notification message that CCS sends back to your 3rd-party
+app server:</p>
+
+</p>
+<pre><message id="">
+ <gcm xmlns="google:mobile:data">
+ {
+ "category":"com.example.yourapp", // to know which app sent it
+ "data":
+ {
+ “message_status":"MESSAGE_SENT_TO_DEVICE",
+ “original_message_id”:”m-1366082849205”
+ “device_registration_id”: “REGISTRATION_ID”
+ },
+ "message_id":"dr2:m-1366082849205",
+ "message_type":"receipt",
+ "from":"gcm.googleapis.com"
+ }
+ </gcm>
+</message></pre>
+
+<p>Note the following:</p>
+
+<ul>
+ <li>The {@code "message_type"} is set to {@code "receipt"}.
+ <li>The {@code "message_status"} is set to {@code "MESSAGE_SENT_TO_DEVICE"},
+ indicating that the message was delivered. Notice that in this case,
+{@code "message_status"} is not a field but rather part of the data payload.</li>
+ <li>The receipt message ID consists of the original message ID, but with a
+<code>dr:</code> prefix. Your 3rd-party app server must send an ACK back with this ID,
+which in this example is {@code dr2:m-1366082849205}.</li>
+ <li>The original message ID and status are inside the
+{@code "data"} field.</li>
+</ul>
+
<h2 id="flow">Flow Control</h2>
<p>Every message sent to CCS receives either an ACK or a NACK response. Messages
diff --git a/docs/html/google/gcm/client.jd b/docs/html/google/gcm/client.jd
index 42cebfc..ec7e748 100644
--- a/docs/html/google/gcm/client.jd
+++ b/docs/html/google/gcm/client.jd
@@ -246,7 +246,8 @@
<h3 id="sample-register">Register for GCM</h3>
<p>An Android application needs to register with GCM servers before it can receive
messages. When an app registers, it receives a registration ID, which it can then
-store for future use. In the following snippet the {@code onCreate()} method in the sample app's
+store for future use (note that registration IDs must be kept secret). In the
+following snippet the {@code onCreate()} method in the sample app's
main activity checks to see if the app is already registered with GCM and with
the server:</p>
diff --git a/docs/html/google/gcm/gcm.jd b/docs/html/google/gcm/gcm.jd
index 88bf659..19151b9 100644
--- a/docs/html/google/gcm/gcm.jd
+++ b/docs/html/google/gcm/gcm.jd
@@ -123,7 +123,7 @@
it to the 3rd-party application server, which uses it to identify each device
that has registered to receive messages for a given Android application. In other words,
a registration ID is tied to a particular Android application running on a particular
-device.
+device. Note that registration IDs must be kept secret.
<br/>
<br/>
<strong>Note:</strong> If you use
diff --git a/docs/html/google/gcm/index.jd b/docs/html/google/gcm/index.jd
index 8f325b8..1f05a71 100644
--- a/docs/html/google/gcm/index.jd
+++ b/docs/html/google/gcm/index.jd
@@ -14,7 +14,10 @@
<h1 itemprop="name" style="margin-bottom:0;">Google Cloud Messaging for Android</h1>
<p itemprop="description">
Google Cloud Messaging for Android (GCM) is a service that allows you to send data
-from your server to your users' Android-powered device, and also to receive messages from devices on the same connection. The GCM service handles all aspects of queueing of messages and delivery to the target Android application running on the target device. GCM is completely free no matter how big your messaging needs are, and there are no quotas.
+from your server to your users' Android-powered device, and also to receive messages from
+devices on the same connection. The GCM service handles all aspects of queueing of messages
+and delivery to the target Android application running on the target device. GCM is
+completely free no matter how big your messaging needs are, and there are no quotas.
</p>
</div>
@@ -27,31 +30,39 @@
<p>This could be a lightweight
message telling your app there is new data to be fetched from the
server (for instance, a movie uploaded by a friend), or it could be a message containing
-up to 4kb of payload data (so apps like instant messaging can consume the message directly). <a href="{@docRoot}google/gcm/gcm.html">GCM Architectural Overview.</a></p>
+up to 4kb of payload data (so apps like instant messaging can consume the message directly).
+<a href="{@docRoot}google/gcm/gcm.html">GCM Architectural Overview.</a></p>
<h4>Send "send-to-sync" messages</h4>
- <p>A send-to-sync (collapsible) message is often a "tickle" that tells a mobile application to sync data from the server. For example, suppose you have an email application. When a user receives new email on the server, the server pings the mobile application with a "New mail" message. This tells the application to sync to the server to pick up the new email.
- <a href="{@docRoot}google/gcm/adv.html#s2s">Send-to-sync messages</a>.</p>
- </a>
+ <p>A send-to-sync (collapsible) message is often a "tickle" that tells a mobile
+ application to sync data from the server. For example, suppose you have an email
+ application. When a user receives new email on the server, the server pings the mobile
+ application with a "New mail" message. This tells the application to sync to the server
+ to pick up the new email.
+ <a href="{@docRoot}google/gcm/adv.html#s2s">Learn more »</a></p>
<h4>Send messages with payload</h4>
- <p>Unlike a send-to-sync message, every "message with payload" (non-collapsible message) is delivered. The payload the message contains can be up to 4kb.
- <a href="{@docRoot}google/gcm/adv.html#payload">Messages with payload</a>.</p>
+ <p>Unlike a send-to-sync message, every "message with payload" (non-collapsible message)
+ is delivered. The payload the message contains can be up to 4kb.
+ <a href="{@docRoot}google/gcm/adv.html#payload">Learn more »</a></p>
</div>
<div class="col-6 normal-links">
<h3 style="clear:left">New Features</h3>
- <h4>Faster, easier GCM setup</h4>
- <p>Streamlined registration makes it simple and fast to add GCM support to your Android app. <a href="{@docRoot}google/gcm/gs.html">Learn more »</a></p>
- <h4>Upstream messaging over XMPP</h4>
- <p>GCM's Cloud Connection Service (CCS) lets you communicate with Android devices over a persistent XMPP connection. The primary advantages of CCS are speed, and the ability to receive upstream messages (that is, messages from a device to the cloud). You can use the service in tandem with existing GCM APIs. Use <a href="https://services.google.com/fb/forms/gcm/">this form</a> to sign up for CCS. <a href="{@docRoot}google/gcm/ccs.html">Learn more »</a></p>
- <h4>Seamless multi-device messaging</h4>
- <p>Maps a single user to a notification key, which you can then use to send a single message to multiple devices owned by the user. Use <a href="https://services.google.com/fb/forms/gcm/">this form</a> to sign up for User Notifications. <a href="{@docRoot}google/gcm/notifications.html">Learn more »</a></p>
+
+
+ <h4>Return Receipts</h4>
+ <p>You can use upstream messaging to get receipt notifications, confirming that a given
+ message was sent to a device. Your 3rd-party app server receives the receipt notification
+ from CCS once the message has been sent to the device.
+ <a href="{@docRoot}google/gcm/ccs.html#receipts">Learn more »</a></p>
+
<h4>Get Started</h4>
- <p>Get started using the new features with a tutorial that walks you through creating a GCM app. <a href="{@docRoot}google/gcm/gs.html">Learn more »</a></p>
+ <p>Get started with a tutorial that walks you through creating a GCM app.
+ <a href="{@docRoot}google/gcm/gs.html">Learn more »</a></p>
</div>
</div>
diff --git a/docs/html/google/gcm/notifications.jd b/docs/html/google/gcm/notifications.jd
index 43a7368..2815f3d 100644
--- a/docs/html/google/gcm/notifications.jd
+++ b/docs/html/google/gcm/notifications.jd
@@ -14,8 +14,8 @@
<h2>In this document</h2>
<ol class="toc">
- <li><a href="#request">Request Format</a></li>
- <li><a href="#create">Generate a Notification Key</a></li>
+ <li><a href="#gen-server">Generate a Notification Key on the Server</a></li>
+ <li><a href="#gen-client">Generate a Notification Key on the Client</a></li>
<li><a href="#add">Add Registration IDs</a></li>
<li><a href="#remove">Remove Registration IDs</a></li>
<li><a href="#upstream">Send Upstream Messages</a></li>
@@ -31,15 +31,11 @@
<ol class="toc">
<li><a href="{@docRoot}google/gcm/gs.html">Getting Started</a></li>
-<li><a href="https://services.google.com/fb/forms/gcm/" class="external-link" target="_android">CCS and User Notifications Signup Form</a></li>
</ol>
</div>
</div>
-<p class="note"><strong>Note:</strong> To try out this feature, sign up using <a href="https://services.google.com/fb/forms/gcm/">this form</a>.</p>
-
-
<p>With user notifications, 3rd-party app servers can send a single message to
multiple instance of an app running on devices owned by a single user. This feature
is called <em>user notifications</em>. User notifications make it possible for every
@@ -76,27 +72,23 @@
<p>You can use this feature with either the <a href="ccs.html">XMPP</a> (CCS) or
<a href="http.html">HTTP</a> connection server.</p>
+<p>You can generate notification keys in two different ways: on the server, and on
+the client, if the user has a Google account. All of the associated registration IDs
+can be mapped to a single user.</p>
<p>The examples below show you how to perform generate/add/remove operations,
and how to send upstream messages. For generate/add/remove operations, the
message body is JSON.</p>
-<h2 id="request">Request Format</h2>
-<p>To send a message, the application server issues a POST request to
-<code>https://android.googleapis.com/gcm/notification</code>.</p>
+<h2 id="gen-server">Generate a Notification Key on the Server</h2>
-<p>Here is the HTTP request header you should use for all create/add/remove operations:</p>
-
-<pre>content-type: "application/json"
-Header : "project_id": <projectID>
-Header: "Authorization", "key=API_KEY"
-</pre>
-
-<h2 id="create">Generate a Notification Key</h2>
+<p>To generate a notification key on the server, you create a new
+create a new <code>notification_key</code> and map it to a
+<code>notification_key_name</code>.</p>
<p>This example shows how to create a new <code>notification_key</code> for a
<code>notification_key_name</code> called <code>appUser-Chris</code>.
-The {@code notification_key_name} is a name or identifier (can be a username for
+The {@code notification_key_name} is a name or identifier (it can be a username for
a 3rd-party app) that is unique to a given user. It is used by third parties to
group together registration IDs for a single user. Note that <code>notification_key_name</code>
and <code>notification_key</code> are unique to a group of registration IDs. It is also
@@ -116,10 +108,109 @@
"registration_ids": ["4", "8", "15", "16", "23", "42"]
}</pre>
+<h3 id="request-server">Request format</h3>
+
+<p>To send a message in cases where your notification key is generated on the server,
+the application server issues a POST request to
+<code>https://android.googleapis.com/gcm/notification</code>.</p>
+
+<p>Here is the HTTP request header you should use for all server side create/add/remove operations:</p>
+
+<pre>content-type: "application/json"
+Header : "project_id": <projectID>
+Header: "Authorization", "key=API_KEY"
+</pre>
+
+
+<h2 id="gen-client">Generate a Notification Key on the Client</h2>
+
+<p>Generating a notification key on the client is useful for cases where a server is unavailable.
+To generate a notification key on the client, the device must have at least one
+Google account. Note that the process for generating a notification key on the client is significantly
+different from the server process described above.</p>
+
+<p>To generate a notification key on the client:</p>
+
+<ol>
+ <li>Open your project in the <a href="https://cloud.google.com/console">Google Developers Console</a>.</li>
+ <li>Click <strong>APIS & AUTH > Credentials</strong>.</li>
+ <li>Under OAuth, click <strong>Create new Client ID</strong>.</li>
+ <li>In the <strong>Create Client ID</strong> dialog, select <strong>Web Application</strong> as
+the application type, and click <strong>Create Client ID</strong>.</li>
+ <li>Copy the value from <strong>Client ID for web application > Client ID</strong>.
+This client ID represents a Google account "scope" that you will use to generate an {@code id_token}.</li>
+</ol>
+
+<p>Once you've followed the above steps and gotten a client ID from Google Developers Console,
+ you're ready to add this feature to your app. First check the device for the presence of a Google
+account. For example:</p>
+
+<pre>// This snippet takes the simple approach of using the first returned Google account,
+// but you can pick any Google account on the device.
+public String getAccount() {
+ Account[] accounts = AccountManager.get(getActivity()).
+ getAccountsByType("com.google");
+ if (accounts.length == 0) {
+ return null;
+ }
+ return accounts[0].name;
+}</pre>
+
+<p>Next, get an authentication token ({@code id_token}) by using the <code><a href=
+"http://developer.android.com/reference/com/google/android/gms/auth/GoogleAuthUtil.html">GoogleAuthUtil</a></code>
+class. For example:</p>
+
+<pre>String accountName = getAccount();
+
+// Initialize the scope using the client ID you got from the Console.
+final String scope = "audience:server:client_id:"
+ + "1262xxx48712-9qs6n32447mcj9dirtnkyrejt82saa52.apps.googleusercontent.com";
+String id_token = null;
+try {
+ id_token = GoogleAuthUtil.getToken(context, accountName, scope);
+} catch (Exception e) {
+ log("exception while getting id_token: " + e);
+}
+...</pre>
+
+<p>Now use <code>id_token</code> to authenticate your request.
+This add operation returns a {@code notification_key}.
+Third parties must save this {@code notification_key} (as well as its mapping to the
+<code>notification_key_name</code>)
+to use in subsequent operations. Note that a client request only takes a single regID.
+The only operations supported on the client side are add/remove.</p>
+
+<pre>request:
+{
+ "operation": "add",
+ "notification_key_name": "appUser-Chris",
+ "registration_ids": ["4"]
+ "id_token": "id_token"
+}</pre>
+
+<h3 id="request-client">Request format</h3>
+
+<p>To send a message in cases where your notification key is generated on the client,
+the application server issues a POST request to
+<code>https://android.googleapis.com/gcm/googlenotification</code>.</p>
+
+<p>Here is the HTTP request header you should use for all add/remove operations. The
+client side doesn't support the create operation;
+the add operation has the effect of creating the notification key if it doesn't already
+exist:</p>
+
+<pre>content-type: "application/json"
+Header : "project_id": <projectID>
+</pre>
+
+<p>Note that the authentication token is passed in the JSON body as shown above, not the header.
+This is different from the server case.</p>
+
+
<h2 id="add">Add Registration IDs</h2>
<p>This example shows how to add registration IDs for a given notification key.
-The maximum number of members allowed for a {@code notification_key} is 10.</p>
+The maximum number of members allowed for a {@code notification_key} is 20.</p>
<p>Note that the <code>notification_key_name</code> is not strictly required for
adding/removing regIDs. But including it protects you against accidentally using
diff --git a/docs/html/google/gcm/server.jd b/docs/html/google/gcm/server.jd
index ccd1267..e3a6b25 100644
--- a/docs/html/google/gcm/server.jd
+++ b/docs/html/google/gcm/server.jd
@@ -120,7 +120,8 @@
<li>Able to store the API key and client registration IDs. The
API key is included in the header of POST requests that send
messages.</li>
- <li>Able to generate message IDs to uniquely identify each message it sends.</li>
+ <li>Able to generate message IDs to uniquely identify each message it sends. Message IDs
+should be unique per sender ID.</li>
</ul>
<h2 id="send-msg">Sending Messages</h2>
diff --git a/docs/html/google/gcs/gcs-signup.jd b/docs/html/google/gcs/gcs-signup.jd
new file mode 100644
index 0000000..7334cec
--- /dev/null
+++ b/docs/html/google/gcs/gcs-signup.jd
@@ -0,0 +1,10 @@
+page.title=Sign Up for Google Cloud Save
+
+@jd:body
+
+<p>Sign up to be a trial partner for Google Cloud Save.</p>
+
+
+<iframe src="https://docs.google.com/a/google.com/forms/d/1_V67YIXzLDLb-UzxOOpSjUDuJFfeYg3hEUT0oliK2ck/viewform?embedded=true" width="100%" height="930" frameborder="0" marginheight="0" marginwidth="0" id="signupform">Loading...</iframe>
+</body>
+</html>
diff --git a/docs/html/google/gcs/index.jd b/docs/html/google/gcs/index.jd
new file mode 100644
index 0000000..e5f4776
--- /dev/null
+++ b/docs/html/google/gcs/index.jd
@@ -0,0 +1,30 @@
+page.title=Google Cloud Save
+page.tags="gcs"
+header.hide=1
+@jd:body
+
+
+<div class="landing-banner">
+
+<div class="col-5" style="min-height:100px">
+ <img src="{@docRoot}images/google/gcs.png" />
+</div>
+<div class="col-7">
+
+ <h1 itemprop="name" style="margin-bottom:0;">Google Cloud Save</h1>
+ <p itemprop="description">
+ Google Cloud Save is a service that enables per-user data storage
+and sync in your apps with no backend programming required. Google Cloud Save
+stores its data
+in <a href="http://developers.google.com/datastore/">Google Cloud Datastore</a>,
+ a fully managed, schemaless database for storing non-relational data. Cloud
+Datastore automatically scales with your users.
+Google Cloud Save works even when your device is offline, and it
+provides an easy transition to server-side coding because
+the same database is accessible via App Engine and Compute Engine.
+Finally, Google Cloud Save provides a generous initial per-user free quota that
+expands as your user base grows.
+</p>
+<a href="{@docRoot}google/gcs/gcs-signup.html" class="button">Sign Up</a>
+</div>
+</div>
diff --git a/docs/html/google/index.jd b/docs/html/google/index.jd
index 2e97d62..4778a85 100644
--- a/docs/html/google/index.jd
+++ b/docs/html/google/index.jd
@@ -89,6 +89,16 @@
to use Google Cloud Messaging.</p>
</div>
+<div class="landing-cell">
+ <div class="cell-icon">
+ <img src="{@docRoot}images/google/gcs-small.png" width="40" >
+ </div>
+ <h4><a href="{@docRoot}google/gcs/index.html"
+ >Google Cloud Save</a></h4>
+ <p>Enable per-user data storage and sync in your apps with no backend programming
+ required.</p>
+</div>
+
</div><!-- col-6 -->
diff --git a/docs/html/images/google/datastore-logo.png b/docs/html/images/google/datastore-logo.png
new file mode 100644
index 0000000..a0fc0a0
--- /dev/null
+++ b/docs/html/images/google/datastore-logo.png
Binary files differ
diff --git a/docs/html/images/google/gcs-small.png b/docs/html/images/google/gcs-small.png
new file mode 100644
index 0000000..b8dbe0d
--- /dev/null
+++ b/docs/html/images/google/gcs-small.png
Binary files differ
diff --git a/docs/html/images/google/gcs.png b/docs/html/images/google/gcs.png
new file mode 100644
index 0000000..7355d64
--- /dev/null
+++ b/docs/html/images/google/gcs.png
Binary files differ
diff --git a/docs/html/preview/api-overview.jd b/docs/html/preview/api-overview.jd
index d9cac48..20764be 100644
--- a/docs/html/preview/api-overview.jd
+++ b/docs/html/preview/api-overview.jd
@@ -24,7 +24,6 @@
<li><a href="#UI">User Interface</a>
<ol>
<li><a href="#MaterialDesign">Material design support</a></li>
- <li><a href="#DoNotDisturb">Do Not Disturb mode</a></li>
<li><a href="#LockscreenNotifications">Lockscreen notifications</a></li>
<li><a href="#NotificationsMetadata">Notifications metadata</a></li>
<li><a href="#Recents">Concurrent documents and activities in the Recents screen</a></li>
@@ -39,11 +38,12 @@
<li><a href="#Animations">Animation & Graphics</a>
<ol>
<li><a href="#OpenGLES-3-1">Support for OpenGL ES 3.1</a></li>
+ <li><a href="#AndroidExtensionPack">Android Extension Pack</a></li>
</ol>
</li>
<li><a href="#Multimedia">Multimedia</a>
<ol>
- <li><a href="#Camera-v2">Camera v2 API</a></li>
+ <li><a href="#Camera-v2">Camera API for advanced camera capabilities</a></li>
<li><a href="#AudioPlayback">Audio playback</a></li>
<li><a href="#MediaPlaybackControl">Media playback control</a></li>
</ol>
@@ -55,7 +55,7 @@
</li>
<li><a href="#Wireless">Wireless and Connectivity</a>
<ol>
- <li><a href="#Multinetwork">Dynamic network selection and seamless handoff</a></li>
+ <li><a href="#Multinetwork">Multiple network connections</a></li>
<li><a href="#BluetoothBroadcasting">Bluetooth broadcasting</a></li>
<li><a href="#NFCEnhancements">NFC enhancements</a></li>
</ol>
@@ -85,17 +85,10 @@
<li><a href="#Manifest">Manifest Declarations</a>
<ol>
<li><a href="#ManifestFeatures">Declarable required features</a></li>
- <li><a href="#ManifestPermissions">User permissions</a></li>
</ol>
</li>
</ol>
-<h2>See also</h2>
-<ol>
-<li><a href="{@docRoot}sdk/api_diff/20/changes.html">API
-Differences Report »</a> </li>
-</ol>
-
</div>
</div>
@@ -188,8 +181,8 @@
<p>If you are currently adding sounds and vibrations to your notifications by
using the {@link android.media.Ringtone}, {@link android.media.MediaPlayer},
or {@link android.os.Vibrator} classes, remove this code so that
-the system can present notifications correctly in <a href="#DoNotDisturb">Do
-Not Disturb</a> mode. Instead, use the {@link android.app.Notification.Builder}
+the system can present notifications correctly in Do
+not Disturb mode. Instead, use the {@link android.app.Notification.Builder}
methods instead to add sounds and vibration.</p>
<p>Notifications now appear in a small floating window
@@ -302,31 +295,6 @@
notification object, attach the replacement notification to it through the
{@code Notification.Builder.setPublicVersion()} method.</p>
-<h3 id="DoNotDisturb">Do Not Disturb mode</h3>
-
-<p>The L Developer Preview introduces a new <em>Do Not Disturb</em> mode. When
-the user puts the device in <em>Do Not Disturb</em> mode, the device limits
-the frequency of the notifications it shows the user (when the user
-wants to avoid distractions). The user can
-customize the feature in a number of ways, such as:</p>
-
-<ul>
- <li>Specifying important people, whose calls should go through even when
- the device is in <em>Do Not Disturb</em> mode.</li>
- <li>Setting custom categories to allow notifications when the device is in
- <em>Do Not Disturb</em> mode. Examples of such categories include phone
- calls and direct communications (like Hangouts and Skype calls).</li>
- <li>Setting rules so <em>Do Not Disturb</em> automatically goes into effect in
- certain conditions (like at particular times of day).</li>
-</ul>
-
-<p>You should add the appropriate metadata to your app notifications to help
-make sure <em>Do Not Disturb</em> mode handles them properly. For example, if
-your app is an alarm clock,
-you can tag the notification as an alarm so it will wake the user up even if the
-device is in <em>Do Not Disturb</em> mode. For more information, see <a
-href="#NotificationsMetadata">Notifications metadata</a>.</p>
-
<h3 id="NotificationsMetadata">Notifications metadata</h3>
<p>The L Developer Preview uses metadata associated with your app notifications
to sort the notifications more intelligently. The metadata you set also
@@ -338,7 +306,7 @@
<ul>
<li>{@code setCategory()}. Depending on the message category, this tells
the system how to handle your app notifications when the device is
-in <em>Do Not Disturb</em> mode (for example, if your notification represents an
+in <em>Do not Disturb</em> mode (for example, if your notification represents an
incoming call, instant message, or alarm).
<li>{@code setPriority()}. Notifications with the priority field set to
{@code PRIORITY_MAX} or {@code PRIORITY_HIGH} will appear in a small floating
@@ -432,13 +400,13 @@
<li>Compute shaders
<li>Separate shader objects
<li>Indirect draw commands
-<li>Enhanced texturing functionality
+<li>Multisample and stencil textures
<li>Shading language improvements
-<li>Optional extensions for per-sample shading, advanced blending modes, and more
+<li>Extensions for advanced blend modes and debugging
<li>Backward compatibility with OpenGL ES 2.0 and 3.0
</ul>
-<p>The Java interface for OpenGL ES 3.1 on Android is provided with GLES31. When
+<p>The Java interface for OpenGL ES 3.1 on Android is provided with {@code GLES31}. When
using OpenGL ES 3.1, be sure that you declare it in your manifest file with the
<a href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a>
tag and the {@code android:glEsVversion} attribute. For example:</p>
@@ -454,9 +422,32 @@
device’s supported OpenGL ES version at runtime, see the
<a href="{@docRoot}guide/topics/graphics/opengl.html">OpenGL ES API guide</a>.</p>
+<h3 id="AndroidExtensionPack">Android Extension Pack</h3>
+
+<p>In addition to OpenGL ES 3.1, this release provides an extension pack with Java interfaces and
+native support for advanced graphics functionality. These extensions are treated as a single
+package by Android. (If the {@code ANDROID_extension_pack_es31} extension is present, your app can
+assume all extensions in the package are present and enable the shading language features with
+a single {@code #extension} statement.</p>
+<p>The extension pack supports:</p>
+<ul>
+<li>Guaranteed fragment shader support for shader storage buffers, images, and
+ atomics (fragment shader support is optional in OpenGL ES 3.1.)</li>
+<li>Tessellation and geometry shaders</li>
+<li>ASTC (LDR) texture compression format</li>
+<li>Per-sample interpolation and shading</li>
+<li>Different blend modes for each color attachment in a frame buffer</li>
+</ul>
+
+<p>The Java interface for the extension pack is provided with {@code GLES31Ext}.
+In your app manifest, you can declare that support for the extension pack is
+required, with the
+<a href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a>
+tag, but the precise syntax is not finalized in the L Developer Preview.</p>
+
<h2 id="Multimedia">Multimedia</h2>
-<h3 id="Camera-v2">Camera v2 API</h3>
+<h3 id="Camera-v2">Camera API for advanced camera capabilities</h3>
<p>The L Developer Preview introduces the new {@code android.hardware.camera2}
API to facilitate fine-grain photo capture and image processing. You can now
@@ -474,6 +465,9 @@
{@code onCaptureCompleted()}, providing you with the image capture metadata in a
{@code CaptureResult}.</p>
+<p>To see an example of how to use the updated Camera API, refer to the {@code Camera2Basic}
+and {@code Camera2Video} implementation samples in this release.</p>
+
<h3 id="AudioPlayback">Audio playback</h3>
<p>This release includes the following changes to
{@link android.media.AudioTrack}:</p>
@@ -557,7 +551,7 @@
<h2 id="Wireless">Wireless & Connectivity</h2>
-<h3 id="Multinetwork">Dynamic network selection and seamless handoff</h3>
+<h3 id="Multinetwork">Multiple network connections</h3>
<p>The L Developer Preview provides new multi-networking APIs. These let your app
dynamically scan for available networks with specific capabilities, and
establish a connection to them. This is useful when your app requires a
@@ -680,6 +674,9 @@
jobScheduler.schedule(uploadTask);
</pre>
+<p>To see an example of how to use the {@code JobScheduler} API, refer to the
+{@code JobSchedulerSample} implementation sample in this release.</p>
+
<h3 id="PowerMeasurementTools">Developer tools for power measurement</h3>
<p>The L Developer Preview provides several new developer tools and APIs to help
you better measure and understand your app's power usage.</p>
@@ -762,31 +759,32 @@
</div>
<p>The L Developer Preview provides new functionality for running apps within
-an enterprise environment. A device administrator can
-initiate a managed provisioning process to add a co-present but separate <em>managed
-profile</em> to a device with an existing personal account. The administrator has
-control over the managed profile.</p>
+an enterprise environment. A
+<a href="{@docRoot}guide/topics/admin/device-admin.html">device administrator</a> can
+initiate a managed provisioning process to add a co-present but separate <em>Android
+work profile</em> to a device, if the user has an existing personal account.
+Apps that are associated with Android work profiles will appear alongside
+non-managed apps in the user’s Launcher, Recent apps screen, and notifications.</p>
<p>To start the managed provisioning process, send {@code
ACTION_PROVISION_MANAGED_PROFILE} in an {@link android.content.Intent}. If the
call is successful, the system triggers the {@code
android.app.admin.DeviceAdminReceiver. onProfileProvisioningComplete()} callback.
You can then call {@code app.admin.DevicePolicyManager. setProfileEnabled()} to
-set this profile to the enabled state.</p>
+enable this Android work profile.</p>
-<p>A user may be associated with more than one managed profile. To get a list of
-the managed profiles associated with the user, call
-{@code android.os.UserManager. getUserProfiles()}.</p>
-
-<p>Once a managed profile is created for a user, apps that are managed by the
-device administrator will appear alongside non-managed apps in the user’s
-Launcher, Recent apps screen, and notifications.</p>
+<p>A device administrator can associate a user with more than one Android
+work profile. To get a list of the Android work profiles associated with the
+user, call {@code android.os.UserManager. getUserProfiles()}.</p>
<p>If you are developing a Launcher app, you can use the new {@code
android.content.pm.LauncherApps} class to get a list of launchable activities
-for the current user and any associated managed profiles. Your Launcher can make
+for the current user and any associated Android work profiles. Your Launcher can make
the managed apps visually prominent by appending a “work” badge to the icon
-drawable with {@code android.os.UserManager.getBadgeDrawableForUser()}.</p>
+drawable with {@code android.os.UserManager. getBadgeDrawableForUser()}.</p>
+
+<p>To see an example of how to use the new functionality, refer to the
+{@code BasicManagedProfile} implementation sample in this release.</p>
<h3 id="TaskLocking">Task locking</h3>
<p>The L Developer Preview introduces a new task locking API that
@@ -897,7 +895,7 @@
<ul>
<li>{@code FEATURE_LEANBACK}. Declares that your app must be installed only on
devices that support the
-<a href="{@docRoot}training/tv/index.html}">Android TV</a> user interface.
+<a href="{@docRoot}training/tv/index.html">Android TV</a> user interface.
Example:
<pre>
<uses-feature android:name="android.software.leanback"
@@ -912,13 +910,5 @@
</pre>
</ul>
-<h3 id="ManifestPermissions">User permissions</h3>
-<p>The following values are now supported in the
-<a href="{@docRoot}guide/topics/manifest/uses-permission-element.html">{@code
- <uses-permission>}</a> to declare the
-permissions your app requires in order to access certain APIs.
-
-<ul>
-<li>{@code SIM_COMMUNICATION}. Required to communicate with a SIM card using
- logical channels.
-</ul>
+<p class="note">For a detailed view of all API changes in the L Developer Preview, see the
+<a href="{@docRoot}preview/reference.html">API Differences Report</a>.</p>
diff --git a/docs/html/preview/support.jd b/docs/html/preview/support.jd
index 9ab25dd..8efc4bc 100644
--- a/docs/html/preview/support.jd
+++ b/docs/html/preview/support.jd
@@ -34,7 +34,7 @@
<li>On very tall or wide views, view shadows may appear with additional rough
visual artifacts around the view edges. To minimize this, avoid using view
shadows with very narrow views.</li>
-<li>The {@code android.graphics.drawable.RippableDrawable} class does not
+<li>The {@code android.graphics.drawable.RippleDrawable} class does not
respond to pointer location changes, except when the drawable is set as a
{@link android.view.View} background.</li>
</ul>
@@ -54,11 +54,12 @@
stillCaptureRequest.set(CaptureRequest.STATISTICS_LENS_SHADING_MAP_MODE,
CaptureRequest.STATISTICS_LENS_SHADING_MAP_MODE_ON);
</pre></li>
-<li>Portions of the internal audio pipeline do not support floating-point format.</li>
<li>The {@code android.media.AudioTrack.write(float[], int, int, int)} method
currently does not work. Use the
{@link android.media.AudioTrack#write(short[], int, int)
AudioTrack.write(short[], int, int)} method instead.</li>
+<li>Lockscreen security is currently not enforced when users start a Android
+mirroring session from the Quick Settings shade.</li>
</ul>
<h3 id="UserInput">User input</h3>
@@ -66,21 +67,42 @@
the locale is set to {@code fr} (FRENCH).</li></ul>
<h3 id="Wireless">Wireless and Connectivity</h3>
-<ul><li>The {@code android.bluetooth.le} APIs are supported only on Nexus 5
-devices.</li></ul>
+<ul>
+<li>The {@code android.bluetooth.le} APIs are supported only on Nexus 5
+devices.</li>
+<li>You might encounter these issues while using Bluetooth LE scanning:
+ <ul>
+ <li><em>Settings</em> does not show all Bluetooth LE devices when a scan
+ filter is set.</li>
+ <li>System returns non-intuitive error messages during a Bluetooth LE scan,
+ when Bluetooth is off.</li>
+ <li>The {@code BluetoothLeScanner.startScan()} method starts failing after
+ six concurrent scans with different callbacks.</li>
+ </ul>
+</li>
+<li>You might encounter these issues while using Bluetooth LE advertising:
+ <ul>
+ <li>The device MAC address does not change for multiple advertising
+ when the application processor is asleep.</li>
+ <li>The TX Power Level is always 0 in advertising packets.</li>
+ </ul>
+</li>
+</ul>
<h3 id="Enterprise">Enterprise</h3>
<ul>
<li>The device may crash unexpectedly in these situations when using
-Android for Work functionality:
+Android work functionality:
<ul>
-<li>The user attempts to share a webpage (via <strong>Menu > Share</strong>)
-from a non-managed Chrome app to a managed Gmail app.</li>
-<li>The user attempts to share a webpage via Bluetooth from a managed Chrome app.</li>
-<li>The user attempts to share a webpage via Android Beam from a managed Chrome app.</li>
+<li>The user attempts to share a web page (via <strong>Menu > Share</strong>)
+from a non-Android work Chrome app to a Android work profile Gmail app.</li>
+<li>The user attempts to share a web page via Bluetooth from a
+Android work profile
+Chrome app.</li>
+<li>The user attempts to share a web page via Android Beam from a
+Android work profile Chrome app.</li>
</ul>
</li>
-<li>Deleting the managed work profile (profile owner) may take several minutes
-to complete. You cannot create a new managed profile until the deletion
-operation is over.</li>
+<li>Deleting a Android work profile may take several minutes to complete. You
+cannot create a new Android work profile until the deletion operation is over.</li>
</ul>
diff --git a/preloaded-classes b/preloaded-classes
index 5bdd6593..fef1ed6 100644
--- a/preloaded-classes
+++ b/preloaded-classes
@@ -1378,6 +1378,7 @@
java.util.zip.ZipFile$1
java.util.zip.ZipFile$RAFStream
java.util.zip.ZipFile$ZipInflaterInputStream
+javax.crypto.spec.GCMParameterSpec
javax.microedition.khronos.egl.EGL
javax.microedition.khronos.egl.EGL10
javax.microedition.khronos.egl.EGLConfig