Merge "cherrypick from klp-modular-dev docs: Added note on disabling debugging for WebView apps. Bug: 16232761 Change-Id: I6cdc2ef7da87e78ec42a456d232a8e46a26c7365" into klp-modular-docs
diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java
index ff88dd7..119ecb0 100644
--- a/core/java/android/content/pm/PackageManager.java
+++ b/core/java/android/content/pm/PackageManager.java
@@ -1460,21 +1460,19 @@
     public abstract String[] canonicalToCurrentPackageNames(String[] names);
 
     /**
-     * Return a "good" intent to launch a front-door activity in a package,
-     * for use for example to implement an "open" button when browsing through
-     * packages.  The current implementation will look first for a main
-     * activity in the category {@link Intent#CATEGORY_INFO}, next for a
-     * main activity in the category {@link Intent#CATEGORY_LAUNCHER}, or return
-     * null if neither are found.
-     *
-     * <p>Throws {@link NameNotFoundException} if a package with the given
-     * name cannot be found on the system.
+     * Returns a "good" intent to launch a front-door activity in a package.
+     * This is used, for example, to implement an "open" button when browsing
+     * through packages.  The current implementation looks first for a main
+     * activity in the category {@link Intent#CATEGORY_INFO}, and next for a
+     * main activity in the category {@link Intent#CATEGORY_LAUNCHER}. Returns
+     * <code>null</code> if neither are found.
      *
      * @param packageName The name of the package to inspect.
      *
-     * @return Returns either a fully-qualified Intent that can be used to
-     * launch the main activity in the package, or null if the package does
-     * not contain such an activity.
+     * @return A fully-qualified {@link Intent} that can be used to launch the
+     * main activity in the package. Returns <code>null</code> if the package
+     * does not contain such an activity, or if <em>packageName</em> is not
+     * recognized. 
      */
     public abstract Intent getLaunchIntentForPackage(String packageName);
 
diff --git a/core/java/android/hardware/Sensor.java b/core/java/android/hardware/Sensor.java
index d95bcb5..4de486b 100644
--- a/core/java/android/hardware/Sensor.java
+++ b/core/java/android/hardware/Sensor.java
@@ -345,7 +345,7 @@
      * A sensor of this type returns the number of steps taken by the user since the last reboot
      * while activated. The value is returned as a float (with the fractional part set to zero) and
      * is reset to zero only on a system reboot. The timestamp of the event is set to the time when
-     * the first step for that event was taken. This sensor is implemented in hardware and is
+     * the last step for that event was taken. This sensor is implemented in hardware and is
      * expected to be low power.
      * <p>
      * See {@link android.hardware.SensorEvent#values SensorEvent.values} for more details.
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index d53bb74..d307256 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -87,7 +87,7 @@
  * </pre>
  * <p>See {@link android.content.Intent} for more information.</p>
  *
- * <p>To provide a WebView in your own Activity, include a {@code <WebView>} in your layout,
+ * <p>To provide a WebView in your own Activity, include a {@code &lt;WebView&gt;} in your layout,
  * or set the entire Activity window as a WebView during {@link
  * android.app.Activity#onCreate(Bundle) onCreate()}:</p>
  * <pre class="prettyprint">
@@ -1637,9 +1637,12 @@
      * <ul>
      * <li> This method can be used to allow JavaScript to control the host
      * application. This is a powerful feature, but also presents a security
-     * risk for applications targeted to API level
-     * {@link android.os.Build.VERSION_CODES#JELLY_BEAN} or below, because
-     * JavaScript could use reflection to access an
+     * risk for apps targeting {@link android.os.Build.VERSION_CODES#JELLY_BEAN} or earlier.
+     * Apps that target a version later than {@link android.os.Build.VERSION_CODES#JELLY_BEAN}
+     * are still vulnerable if the app runs on a device running Android earlier than 4.2.
+     * The most secure way to use this method is to target {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1}
+     * and to ensure the method is called only when running on Android 4.2 or later.
+     * With these older versions, JavaScript could use reflection to access an
      * injected object's public fields. Use of this method in a WebView
      * containing untrusted content could allow an attacker to manipulate the
      * host application in unintended ways, executing Java code with the
@@ -1647,7 +1650,8 @@
      * method in a WebView which could contain untrusted content.</li>
      * <li> JavaScript interacts with Java object on a private, background
      * thread of this WebView. Care is therefore required to maintain thread
-     * safety.</li>
+     * safety.
+     * </li>
      * <li> The Java object's fields are not accessible.</li>
      * </ul>
      *
diff --git a/docs/html/_redirects.yaml b/docs/html/_redirects.yaml
index c5b6c24..1e32d43 100644
--- a/docs/html/_redirects.yaml
+++ b/docs/html/_redirects.yaml
@@ -1,3 +1,10 @@
+# WARNING: THIS FILE IS NOT USED IN PRODUCTION
+# CHANGES MADE HERE **DO NOT EFFECT** developer.android.com
+
+# Instead, update the following file in the current docs release branch:
+# <docs-release-branch>/vendor/google/docs/app-engine-server/v3/redirects.yaml
+
+#=============================================================================
 # Redirects file.
 # This file contains the list of rewrite rules that are applied when serving
 # pages. Add "pattern: True" to use python regex in to or from.
@@ -59,6 +66,9 @@
 - from: /guide/google/gcm/server-javadoc/...
   to: /reference/com/google/android/gcm/server/package-summary.html
 
+- from: /google/play-services/auth.html
+  to: /google/auth/http-auth.html
+
 - from: /guide/google/play/services.html
   to: /google/play-services/index.html
 
diff --git a/docs/html/about/dashboards/index.jd b/docs/html/about/dashboards/index.jd
index 2a2417a..808f04a 100644
--- a/docs/html/about/dashboards/index.jd
+++ b/docs/html/about/dashboards/index.jd
@@ -64,7 +64,7 @@
 </div>
 
 
-<p style="clear:both"><em>Data collected during a 7-day period ending on July 7, 2014.
+<p style="clear:both"><em>Data collected during a 7-day period ending on September 9, 2014.
 <br/>Any versions with less than 0.1% distribution are not shown.</em>
 </p>
 
@@ -95,7 +95,8 @@
 </div>
 
 
-<p style="clear:both"><em>Data collected during a 7-day period ending on July 7, 2014.
+<p style="clear:both"><em>Data collected during a 7-day period ending on September 9, 2014.
+
 <br/>Any screen configurations with less than 0.1% distribution are not shown.</em></p>
 
 
@@ -114,7 +115,7 @@
 
 
 <img alt="" style="float:right"
-src="//chart.googleapis.com/chart?chs=400x250&cht=p&chd=t%3A0.1%2C81.7%2C18.2&chf=bg%2Cs%2C00000000&chl=GL%201.1%20only%7CGL%202.0%7CGL%203.0&chco=c4df9b%2C6fad0c" />
+src="//chart.googleapis.com/chart?chs=400x250&cht=p&chd=t%3A77.5%2C22.5&chf=bg%2Cs%2C00000000&chl=GL%202.0%7CGL%203.0&chco=c4df9b%2C6fad0c" />
 
 <p>To declare which version of OpenGL ES your application requires, you should use the {@code
 android:glEsVersion} attribute of the <a
@@ -131,22 +132,18 @@
 <th scope="col">Distribution</th>
 </tr>
 <tr>
-<td>1.1 only</th>
-<td>0.1%</td>
+<td>2.0</td>
+<td>77.5%</td>
 </tr>
 <tr>
-<td>2.0</th>
-<td>81.7%</td>
-</tr>
-<tr>
-<td>3.0</th>
-<td>18.2%</td>
+<td>3.0</td>
+<td>22.5%</td>
 </tr>
 </table>
 
 
 
-<p style="clear:both"><em>Data collected during a 7-day period ending on July 7, 2014</em></p>
+<p style="clear:both"><em>Data collected during a 7-day period ending on September 9, 2014</em></p>
 
 
 
@@ -164,7 +161,7 @@
 var VERSION_DATA =
 [
   {
-    "chart": "//chart.googleapis.com/chart?cht=p&chs=500x250&chf=bg%2Cs%2C00000000&chd=t%3A0.7%2C13.5%2C11.4%2C56.5%2C17.9&chco=c4df9b%2C6fad0c&chl=Froyo%7CGingerbread%7CIce%20Cream%20Sandwich%7CJelly%20Bean%7CKitKat",
+    "chart": "//chart.googleapis.com/chart?chco=c4df9b%2C6fad0c&cht=p&chs=500x250&chl=Froyo%7CGingerbread%7CIce%20Cream%20Sandwich%7CJelly%20Bean%7CKitKat&chd=t%3A0.7%2C11.4%2C9.6%2C53.8%2C24.5&chf=bg%2Cs%2C00000000",
     "data": [
       {
         "api": 8,
@@ -174,69 +171,66 @@
       {
         "api": 10,
         "name": "Gingerbread",
-        "perc": "13.5"
+        "perc": "11.4"
       },
       {
         "api": 15,
         "name": "Ice Cream Sandwich",
-        "perc": "11.4"
+        "perc": "9.6"
       },
       {
         "api": 16,
         "name": "Jelly Bean",
-        "perc": "27.8"
+        "perc": "25.1"
       },
       {
         "api": 17,
         "name": "Jelly Bean",
-        "perc": "19.7"
+        "perc": "20.7"
       },
       {
         "api": 18,
         "name": "Jelly Bean",
-        "perc": "9.0"
+        "perc": "8.0"
       },
       {
         "api": 19,
         "name": "KitKat",
-        "perc": "17.9"
+        "perc": "24.5"
       }
     ]
   }
 ];
 
 
-
-
-
 var SCREEN_DATA =
 [
   {
     "data": {
       "Large": {
         "hdpi": "0.6",
-        "ldpi": "0.6",
-        "mdpi": "4.5",
+        "ldpi": "0.5",
+        "mdpi": "4.3",
         "tvdpi": "1.7",
         "xhdpi": "0.6"
       },
       "Normal": {
-        "hdpi": "34.5",
-        "mdpi": "11.4",
-        "xhdpi": "19.4",
-        "xxhdpi": "15.3"
+        "hdpi": "35.7",
+        "mdpi": "10.6",
+        "xhdpi": "19.2",
+        "xxhdpi": "16.2"
       },
       "Small": {
-        "ldpi": "6.8"
+        "ldpi": "6.2"
       },
       "Xlarge": {
         "hdpi": "0.3",
-        "mdpi": "3.9",
+        "mdpi": "3.7",
         "xhdpi": "0.4"
       }
     },
-    "densitychart": "//chart.googleapis.com/chart?cht=p&chs=400x250&chf=bg%2Cs%2C00000000&chd=t%3A7.4%2C19.8%2C1.7%2C35.4%2C20.4%2C15.3&chco=c4df9b%2C6fad0c&chl=ldpi%7Cmdpi%7Ctvdpi%7Chdpi%7Cxhdpi%7Cxxhdpi",
-    "layoutchart": "//chart.googleapis.com/chart?cht=p&chs=400x250&chf=bg%2Cs%2C00000000&chd=t%3A4.6%2C8.0%2C80.6%2C6.8&chco=c4df9b%2C6fad0c&chl=Xlarge%7CLarge%7CNormal%7CSmall"
+    "densitychart": "//chart.googleapis.com/chart?chco=c4df9b%2C6fad0c&cht=p&chs=400x250&chl=ldpi%7Cmdpi%7Ctvdpi%7Chdpi%7Cxhdpi%7Cxxhdpi&chd=t%3A6.7%2C18.6%2C1.7%2C36.6%2C20.2%2C16.2&chf=bg%2Cs%2C00000000",
+    "layoutchart": "//chart.googleapis.com/chart?chco=c4df9b%2C6fad0c&cht=p&chs=400x250&chl=Xlarge%7CLarge%7CNormal%7CSmall&chd=t%3A4.4%2C7.7%2C81.7%2C6.2&chf=bg%2Cs%2C00000000"
   }
 ];
 
diff --git a/docs/html/about/versions/android-4.2.jd b/docs/html/about/versions/android-4.2.jd
index 73d51c5..76acb8a 100644
--- a/docs/html/about/versions/android-4.2.jd
+++ b/docs/html/about/versions/android-4.2.jd
@@ -361,8 +361,7 @@
 href="{@docRoot}google/gcm/index.html">Google Cloud Messaging</a>.</p>
 
 <p>Beware that if your app requests one of the hardware device identifiers (such as the WiFi MAC
-address, the {@link android.os.Build#SERIAL} number, or the {@link
-android.provider.Settings.Secure#ANDROID_ID} number), they will provide the same value for each
+address or the {@link android.os.Build#SERIAL} number), they will provide the same value for each
 user because these identifiers are tied to the hardware and not the user. Not to mention the other
 problems these identifiers introduce as discussed in the <a
 href="http://android-developers.blogspot.com/2011/03/identifying-app-installations.html">Identifying
diff --git a/docs/html/design/downloads/index.jd b/docs/html/design/downloads/index.jd
index 0452fab..b83a2b0 100644
--- a/docs/html/design/downloads/index.jd
+++ b/docs/html/design/downloads/index.jd
@@ -90,10 +90,10 @@
   </div>
   <div class="layout-content-col span-4">
   <a class="download-button"  onClick="_gaq.push(['_trackEvent', 'Design', 'Download', 'Wear Toolkit AI']);"
-    href="{@docRoot}downloads/design/Android_Wear_Toolkit_20140626.ai">Adobe&reg; Illustrator&reg; Toolkit</a>
+    href="{@docRoot}downloads/design/Android_Wear_Toolkit_20140722.ai">Adobe&reg; Illustrator&reg; Toolkit</a>
 
   <a class="download-button"  onClick="_gaq.push(['_trackEvent', 'Design', 'Download', 'Wear Toolkit PDF']);"
-    href="{@docRoot}downloads/design/Android_Wear_Toolkit_20140626.pdf">PDF Toolkit</a>
+    href="{@docRoot}downloads/design/Android_Wear_Toolkit_20140722.pdf">PDF Toolkit</a>
   </div>
 </div>
 
@@ -111,9 +111,9 @@
   </div>
   <div class="layout-content-col span-4">
   <a class="download-button"  onClick="_gaq.push(['_trackEvent', 'Design', 'Download', 'Wear App Patterns AI']);"
-    href="{@docRoot}downloads/design/Android_Wear_Patterns_20140626.ai">Adobe&reg; Illustrator&reg; App Patterns</a>
+    href="{@docRoot}downloads/design/Android_Wear_Patterns_20140722.ai">Adobe&reg; Illustrator&reg; App Patterns</a>
   <a class="download-button"  onClick="_gaq.push(['_trackEvent', 'Design', 'Download', 'Wear App Patterns PDF']);"
-    href="{@docRoot}downloads/design/Android_Wear_Patterns_20140626.pdf">PDF App Patterns</a>
+    href="{@docRoot}downloads/design/Android_Wear_Patterns_20140722.pdf">PDF App Patterns</a>
   </div>
 </div>
 
diff --git a/docs/html/design/style/iconography.jd b/docs/html/design/style/iconography.jd
index 4559f00..ec7638d 100644
--- a/docs/html/design/style/iconography.jd
+++ b/docs/html/design/style/iconography.jd
@@ -29,7 +29,7 @@
 scaling ratio</strong> between the five primary densities (medium, high, x-high, xx-high, and
 xxx-high respectively). For example, consider that the size for a launcher icon is specified to be
 48x48 dp. This means the baseline (MDPI) asset is 48x48 px, and the
-high density (HDPI) asset should be 1.5x the baseline at 72x72 px, and the x-high
+high-density(HDPI) asset should be 1.5x the baseline at 72x72 px, and the x-high
 density (XHDPI) asset should be 2x the baseline at 96x96 px, and so on.</p>
 
 <p class="note"><strong>Note:</strong> Android also supports low-density (LDPI) screens,
@@ -489,11 +489,12 @@
     xhdpi/...
         _pre_production/...
             <em>working_file</em>.psd
-        <em>finished_asset</em>.png</pre>
+        <em>finished_asset</em>.png
     xxhdpi/...
         _pre_production/...
             <em>working_file</em>.psd
-        <em>finished_asset</em>.png</pre>
+        <em>finished_asset</em>.png
+</pre>
 
 <p>Because the structure in your working space is similar to that of the application, you
 can quickly determine which assets should be copied to each
@@ -513,6 +514,8 @@
         <em>finished_asset</em>.png
     drawable-xhdpi/...
         <em>finished_asset</em>.png
+    drawable-xxhdpi/...
+        <em>finished_asset</em>.png
 </pre>
 
 <p>For more information about how to save resources in the application project,
@@ -520,6 +523,21 @@
 </p>
 
 
+<h3 id="xxxhdpi-launcher">Provide an xxx-high-density launcher icon</h3>
+
+<p>Some devices scale-up the launcher icon by as much as 25%. For example, if your highest density 
+launcher icon image is already extra-extra-high density, the scaling process will make it appear
+less crisp. So you should provide a higher density launcher icon in the <code>drawable-xxxhdpi
+</code> directory, which the system uses instead of scaling up a smaller version of the icon.</p>
+
+<p class="note"><strong>Note:</strong> the <code>drawable-xxxhdpi</code> qualifier is necessary only
+to provide a launcher icon that can appear larger than usual on an xxhdpi device. You do not need to
+provide xxxhdpi assets for all your app's images.</p>
+
+<p>See <a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a> for
+more information.</p>
+
+
 <h3>Remove unnecessary metadata from final assets</h3>
 
 <p>Although the Android SDK tools will automatically compress PNGs when packaging
diff --git a/docs/html/google/auth/http-auth.jd b/docs/html/google/auth/http-auth.jd
index 3b2a83f..804ba12 100644
--- a/docs/html/google/auth/http-auth.jd
+++ b/docs/html/google/auth/http-auth.jd
@@ -342,9 +342,9 @@
 "{@docRoot}reference/com/google/android/gms/auth/GoogleAuthUtil.html#getToken(android.content.Context,%20java.lang.String,%20java.lang.String)">
 {@code GoogleAuthUtil.getToken()}</a>, you must provide the app {@link android.content.Context},
 the account name retrieved from the account picker, and the scope for your auth
-token request. The above sample code (and the attached sample) defines these arguments with
-class members that the host activity passes to
-the {@link android.os.AsyncTask} class constructor.</p>
+token request. The above sample code (and the attached sample) defines these
+arguments with class members that the host activity passes to the {@link android.os.AsyncTask} class constructor. For more information about setting the scope, see
+the <a href="#SpecifyingScopes">Specifying Scopes</a> section below. </p>
 
 <p class="note"><strong>Note:</strong>
 As shown by the {@code fetchToken()} method above, you must handle
@@ -397,8 +397,32 @@
 "{@docRoot}reference/com/google/android/gms/auth/GoogleAuthUtil.html#getToken(android.content.Context,%20java.lang.String,%20java.lang.String)">
 {@code GoogleAuthUtil.getToken()}</a>.</p>
 
-
-
+<h3 id="SpecifyingScopes">Specifying scopes</h3>
+<p>The scope string is used to specify which Google services can be accessed by
+  an app using the requested auth token. An auth token can be associated with
+  multiple scopes.</p>
+<p>When specifying the scopes in your auth token request, prefix the
+  scope string with {@code "oauth2:"} followed by a list of one or more OAuth scope
+  values. Use a space to separate each scope value in the list. To see a list of
+  valid OAuth scope values for Google services, browse
+  the <a href="https://developers.google.com/oauthplayground/"
+  class="external-link">OAuth 2.0 Playground</a>.</p>
+<p class="note"><strong>Tip:</strong> Specify {@code "oauth2:&lt;scope&gt;"}
+  for a single scope. Specify
+  {@code "oauth2:&lt;scope1&gt; &lt;scope2&gt; &lt;scopeN&gt;"} for multiple
+  scopes (using a space to separate each scope).</p>
+<p>For example, to access the Google Books API, the scope is
+  {@code "oauth2:https://www.googleapis.com/auth/books"}. To add an additional
+  scope, say for Google+ login, your code might look like this:</p>
+<pre>
+private final static String BOOKS_API_SCOPE
+        = "https://www.googleapis.com/auth/books";
+private fina; static String GPLUS_SCOPE
+        = "https://www.googleapis.com/auth/plus.login";
+private final static String mScopes
+        = "oauth2:" + BOOKS_API_SCOPE + " " + GPLUS_SCOPE;
+String token = GoogleAuthUtil.getToken(mActivity, mEmail, mScopes);
+</pre>
 
 <h2 id="HandleExceptions">Handle Exceptions</h2>
 
diff --git a/docs/html/google/gcm/ccs.jd b/docs/html/google/gcm/ccs.jd
index 4389e3d..1c7c802 100644
--- a/docs/html/google/gcm/ccs.jd
+++ b/docs/html/google/gcm/ccs.jd
@@ -40,8 +40,6 @@
 <li><a href="{@docRoot}google/gcm/gs.html">Getting Started</a></li>
 <li><a href="{@docRoot}google/gcm/server.html">Implementing GCM Server</a></li>
 <li><a href="{@docRoot}google/gcm/client.html">Implementing GCM Client</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>
@@ -535,6 +533,8 @@
 import org.jivesoftware.smack.ConnectionListener;
 import org.jivesoftware.smack.PacketInterceptor;
 import org.jivesoftware.smack.PacketListener;
+import org.jivesoftware.smack.SmackException;
+import org.jivesoftware.smack.SmackException.NotConnectedException;
 import org.jivesoftware.smack.XMPPConnection;
 import org.jivesoftware.smack.XMPPException;
 import org.jivesoftware.smack.filter.PacketTypeFilter;
@@ -544,352 +544,378 @@
 import org.jivesoftware.smack.packet.PacketExtension;
 import org.jivesoftware.smack.provider.PacketExtensionProvider;
 import org.jivesoftware.smack.provider.ProviderManager;
+import org.jivesoftware.smack.tcp.XMPPTCPConnection;
 import org.jivesoftware.smack.util.StringUtils;
 import org.json.simple.JSONValue;
 import org.json.simple.parser.ParseException;
 import org.xmlpull.v1.XmlPullParser;
 
+import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Random;
+import java.util.UUID;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.net.ssl.SSLSocketFactory;
+
 /**
- * Sample Smack implementation of a client for GCM Cloud Connection Server.
+ * Sample Smack implementation of a client for GCM Cloud Connection Server. This
+ * code can be run as a standalone CCS client.
  *
  * &lt;p&gt;For illustration purposes only.
  */
 public class SmackCcsClient {
 
-  Logger logger = Logger.getLogger(&quot;SmackCcsClient&quot;);
+    private static final Logger logger = Logger.getLogger(&quot;SmackCcsClient&quot;);
 
-  public static final String GCM_SERVER = &quot;gcm.googleapis.com&quot;;
-  public static final int GCM_PORT = 5235;
+    private static final String GCM_SERVER = &quot;gcm.googleapis.com&quot;;
+    private static final int GCM_PORT = 5235;
 
-  public static final String GCM_ELEMENT_NAME = &quot;gcm&quot;;
-  public static final String GCM_NAMESPACE = &quot;google:mobile:data&quot;;
+    private static final String GCM_ELEMENT_NAME = &quot;gcm&quot;;
+    private static final String GCM_NAMESPACE = &quot;google:mobile:data&quot;;
 
-  static Random random = new Random();
-  XMPPConnection connection;
-  ConnectionConfiguration config;
+    static {
 
-  /**
-   * XMPP Packet Extension for GCM Cloud Connection Server.
-   */
-  class GcmPacketExtension extends DefaultPacketExtension {
-    String json;
-
-    public GcmPacketExtension(String json) {
-      super(GCM_ELEMENT_NAME, GCM_NAMESPACE);
-      this.json = json;
+        ProviderManager.addExtensionProvider(GCM_ELEMENT_NAME, GCM_NAMESPACE,
+            new PacketExtensionProvider() {
+                &#64;Override
+                public PacketExtension parseExtension(XmlPullParser parser) throws
+                        Exception {
+                    String json = parser.nextText();
+                    return new GcmPacketExtension(json);
+                }
+            });
     }
 
-    public String getJson() {
-      return json;
+    private XMPPConnection connection;
+
+    /**
+     * Indicates whether the connection is in draining state, which means that it
+     * will not accept any new downstream messages.
+     */
+    protected volatile boolean connectionDraining = false;
+
+    /**
+     * Sends a downstream message to GCM.
+     *
+     * &#64;return true if the message has been successfully sent.
+     */
+    public boolean sendDownstreamMessage(String jsonRequest) throws
+            NotConnectedException {
+        if (!connectionDraining) {
+            send(jsonRequest);
+            return true;
+        }
+        logger.info(&quot;Dropping downstream message since the connection is draining&quot;);
+        return false;
     }
 
-    &#64;Override
-    public String toXML() {
-      return String.format(&quot;&lt;%s xmlns=\&quot;%s\&quot;&gt;%s&lt;/%s&gt;&quot;, GCM_ELEMENT_NAME,
-          GCM_NAMESPACE, json, GCM_ELEMENT_NAME);
+    /**
+     * Returns a random message id to uniquely identify a message.
+     *
+     * &lt;p&gt;Note: This is generated by a pseudo random number generator for
+     * illustration purpose, and is not guaranteed to be unique.
+     */
+    public String nextMessageId() {
+        return &quot;m-&quot; + UUID.randomUUID().toString();
     }
 
-    &#64;SuppressWarnings(&quot;unused&quot;)
-    public Packet toPacket() {
-      return new Message() {
-        // Must override toXML() because it includes a &lt;body&gt;
+    /**
+     * Sends a packet with contents provided.
+     */
+    protected void send(String jsonRequest) throws NotConnectedException {
+        Packet request = new GcmPacketExtension(jsonRequest).toPacket();
+        connection.sendPacket(request);
+    }
+
+    /**
+     * Handles an upstream data message from a device application.
+     *
+     * &lt;p&gt;This sample echo server sends an echo message back to the device.
+     * Subclasses should override this method to properly process upstream messages.
+     */
+    protected void handleUpstreamMessage(Map&lt;String, Object&gt; jsonObject) {
+        // PackageName of the application that sent this message.
+        String category = (String) jsonObject.get(&quot;category&quot;);
+        String from = (String) jsonObject.get(&quot;from&quot;);
+        &#64;SuppressWarnings(&quot;unchecked&quot;)
+        Map&lt;String, String&gt; payload = (Map&lt;String, String&gt;) jsonObject.get(&quot;data&quot;);
+        payload.put(&quot;ECHO&quot;, &quot;Application: &quot; + category);
+
+        // Send an ECHO response back
+        String echo = createJsonMessage(from, nextMessageId(), payload,
+                &quot;echo:CollapseKey&quot;, null, false);
+
+        try {
+            sendDownstreamMessage(echo);
+        } catch (NotConnectedException e) {
+            logger.log(Level.WARNING, &quot;Not connected anymore, echo message is
+                    not sent&quot;, e);
+        }
+    }
+
+    /**
+     * Handles an ACK.
+     *
+     * &lt;p&gt;Logs a {@code INFO} message, but subclasses could override it to
+     * properly handle ACKs.
+     */
+    protected void handleAckReceipt(Map&lt;String, Object&gt; jsonObject) {
+        String messageId = (String) jsonObject.get(&quot;message_id&quot;);
+        String from = (String) jsonObject.get(&quot;from&quot;);
+        logger.log(Level.INFO, &quot;handleAckReceipt() from: &quot; + from + &quot;,
+                messageId: &quot; + messageId);
+    }
+
+    /**
+     * Handles a NACK.
+     *
+     * &lt;p&gt;Logs a {@code INFO} message, but subclasses could override it to
+     * properly handle NACKs.
+     */
+    protected void handleNackReceipt(Map&lt;String, Object&gt; jsonObject) {
+        String messageId = (String) jsonObject.get(&quot;message_id&quot;);
+        String from = (String) jsonObject.get(&quot;from&quot;);
+        logger.log(Level.INFO, &quot;handleNackReceipt() from: &quot; + from + &quot;,
+                messageId: &quot; + messageId);
+    }
+
+    protected void handleControlMessage(Map&lt;String, Object&gt; jsonObject) {
+        logger.log(Level.INFO, &quot;handleControlMessage(): &quot; + jsonObject);
+        String controlType = (String) jsonObject.get(&quot;control_type&quot;);
+        if (&quot;CONNECTION_DRAINING&quot;.equals(controlType)) {
+            connectionDraining = true;
+        } else {
+            logger.log(Level.INFO, &quot;Unrecognized control type: %s. This could
+                    happen if new features are &quot; + &quot;added to the CCS protocol.&quot;,
+                    controlType);
+        }
+    }
+
+    /**
+     * Creates a JSON encoded GCM message.
+     *
+     * &#64;param to RegistrationId of the target device (Required).
+     * &#64;param messageId Unique messageId for which CCS will send an
+     *         &quot;ack/nack&quot; (Required).
+     * &#64;param payload Message content intended for the application. (Optional).
+     * &#64;param collapseKey GCM collapse_key parameter (Optional).
+     * &#64;param timeToLive GCM time_to_live parameter (Optional).
+     * &#64;param delayWhileIdle GCM delay_while_idle parameter (Optional).
+     * &#64;return JSON encoded GCM message.
+     */
+    public static String createJsonMessage(String to, String messageId,
+            Map&lt;String, String&gt; payload, String collapseKey, Long timeToLive,
+            Boolean delayWhileIdle) {
+        Map&lt;String, Object&gt; message = new HashMap&lt;String, Object&gt;();
+        message.put(&quot;to&quot;, to);
+        if (collapseKey != null) {
+            message.put(&quot;collapse_key&quot;, collapseKey);
+        }
+        if (timeToLive != null) {
+            message.put(&quot;time_to_live&quot;, timeToLive);
+        }
+        if (delayWhileIdle != null &amp;&amp; delayWhileIdle) {
+            message.put(&quot;delay_while_idle&quot;, true);
+        }
+      message.put(&quot;message_id&quot;, messageId);
+      message.put(&quot;data&quot;, payload);
+      return JSONValue.toJSONString(message);
+    }
+
+    /**
+     * Creates a JSON encoded ACK message for an upstream message received
+     * from an application.
+     *
+     * &#64;param to RegistrationId of the device who sent the upstream message.
+     * &#64;param messageId messageId of the upstream message to be acknowledged to CCS.
+     * &#64;return JSON encoded ack.
+     */
+        protected static String createJsonAck(String to, String messageId) {
+        Map&lt;String, Object&gt; message = new HashMap&lt;String, Object&gt;();
+        message.put(&quot;message_type&quot;, &quot;ack&quot;);
+        message.put(&quot;to&quot;, to);
+        message.put(&quot;message_id&quot;, messageId);
+        return JSONValue.toJSONString(message);
+    }
+
+    /**
+     * Connects to GCM Cloud Connection Server using the supplied credentials.
+     *
+     * &#64;param senderId Your GCM project number
+     * &#64;param apiKey API Key of your project
+     */
+    public void connect(long senderId, String apiKey)
+            throws XMPPException, IOException, SmackException {
+        ConnectionConfiguration config =
+                new ConnectionConfiguration(GCM_SERVER, GCM_PORT);
+        config.setSecurityMode(SecurityMode.enabled);
+        config.setReconnectionAllowed(true);
+        config.setRosterLoadedAtLogin(false);
+        config.setSendPresence(false);
+        config.setSocketFactory(SSLSocketFactory.getDefault());
+
+        connection = new XMPPTCPConnection(config);
+        connection.connect();
+
+        connection.addConnectionListener(new LoggingConnectionListener());
+
+        // Handle incoming packets
+        connection.addPacketListener(new PacketListener() {
+
+            &#64;Override
+            public void processPacket(Packet packet) {
+                logger.log(Level.INFO, &quot;Received: &quot; + packet.toXML());
+                Message incomingMessage = (Message) packet;
+                GcmPacketExtension gcmPacket =
+                        (GcmPacketExtension) incomingMessage.
+                        getExtension(GCM_NAMESPACE);
+                String json = gcmPacket.getJson();
+                try {
+                    &#64;SuppressWarnings(&quot;unchecked&quot;)
+                    Map&lt;String, Object&gt; jsonObject =
+                            (Map&lt;String, Object&gt;) JSONValue.
+                            parseWithException(json);
+
+                    // present for &quot;ack&quot;/&quot;nack&quot;, null otherwise
+                    Object messageType = jsonObject.get(&quot;message_type&quot;);
+
+                    if (messageType == null) {
+                        // Normal upstream data message
+                        handleUpstreamMessage(jsonObject);
+
+                        // Send ACK to CCS
+                        String messageId = (String) jsonObject.get(&quot;message_id&quot;);
+                        String from = (String) jsonObject.get(&quot;from&quot;);
+                        String ack = createJsonAck(from, messageId);
+                        send(ack);
+                    } else if (&quot;ack&quot;.equals(messageType.toString())) {
+                          // Process Ack
+                          handleAckReceipt(jsonObject);
+                    } else if (&quot;nack&quot;.equals(messageType.toString())) {
+                          // Process Nack
+                          handleNackReceipt(jsonObject);
+                    } else if (&quot;control&quot;.equals(messageType.toString())) {
+                          // Process control message
+                          handleControlMessage(jsonObject);
+                    } else {
+                          logger.log(Level.WARNING,
+                                  &quot;Unrecognized message type (%s)&quot;,
+                                  messageType.toString());
+                    }
+                } catch (ParseException e) {
+                    logger.log(Level.SEVERE, &quot;Error parsing JSON &quot; + json, e);
+                } catch (Exception e) {
+                    logger.log(Level.SEVERE, &quot;Failed to process packet&quot;, e);
+                }
+            }
+        }, new PacketTypeFilter(Message.class));
+
+        // Log all outgoing packets
+        connection.addPacketInterceptor(new PacketInterceptor() {
+            &#64;Override
+                public void interceptPacket(Packet packet) {
+                    logger.log(Level.INFO, &quot;Sent: {0}&quot;, packet.toXML());
+                }
+            }, new PacketTypeFilter(Message.class));
+
+        connection.login(senderId + &quot;&#64;gcm.googleapis.com&quot;, apiKey);
+    }
+
+    public static void main(String[] args) throws Exception {
+        final long senderId = 1234567890L; // your GCM sender id
+        final String password = &quot;Your API key&quot;;
+
+        SmackCcsClient ccsClient = new SmackCcsClient();
+
+        ccsClient.connect(senderId, password);
+
+        // Send a sample hello downstream message to a device.
+        String toRegId = &quot;RegistrationIdOfTheTargetDevice&quot;;
+        String messageId = ccsClient.nextMessageId();
+        Map&lt;String, String&gt; payload = new HashMap&lt;String, String&gt;();
+        payload.put(&quot;Hello&quot;, &quot;World&quot;);
+        payload.put(&quot;CCS&quot;, &quot;Dummy Message&quot;);
+        payload.put(&quot;EmbeddedMessageId&quot;, messageId);
+        String collapseKey = &quot;sample&quot;;
+        Long timeToLive = 10000L;
+        String message = createJsonMessage(toRegId, messageId, payload,
+                collapseKey, timeToLive, true);
+
+        ccsClient.sendDownstreamMessage(message);
+    }
+
+    /**
+     * XMPP Packet Extension for GCM Cloud Connection Server.
+     */
+    private static final class GcmPacketExtension extends DefaultPacketExtension {
+
+        private final String json;
+
+        public GcmPacketExtension(String json) {
+            super(GCM_ELEMENT_NAME, GCM_NAMESPACE);
+            this.json = json;
+        }
+
+        public String getJson() {
+            return json;
+        }
+
         &#64;Override
         public String toXML() {
-
-          StringBuilder buf = new StringBuilder();
-          buf.append(&quot;&lt;message&quot;);
-          if (getXmlns() != null) {
-            buf.append(&quot; xmlns=\&quot;&quot;).append(getXmlns()).append(&quot;\&quot;&quot;);
-          }
-          if (getLanguage() != null) {
-            buf.append(&quot; xml:lang=\&quot;&quot;).append(getLanguage()).append(&quot;\&quot;&quot;);
-          }
-          if (getPacketID() != null) {
-            buf.append(&quot; id=\&quot;&quot;).append(getPacketID()).append(&quot;\&quot;&quot;);
-          }
-          if (getTo() != null) {
-            buf.append(&quot; to=\&quot;&quot;).append(StringUtils.escapeForXML(getTo())).append(&quot;\&quot;&quot;);
-          }
-          if (getFrom() != null) {
-            buf.append(&quot; from=\&quot;&quot;).append(StringUtils.escapeForXML(getFrom())).append(&quot;\&quot;&quot;);
-          }
-          buf.append(&quot;&gt;&quot;);
-          buf.append(GcmPacketExtension.this.toXML());
-          buf.append(&quot;&lt;/message&gt;&quot;);
-          return buf.toString();
+            return String.format(&quot;&lt;%s xmlns=\&quot;%s\&quot;&gt;%s&lt;/%s&gt;&quot;,
+                    GCM_ELEMENT_NAME, GCM_NAMESPACE,
+                    StringUtils.escapeForXML(json), GCM_ELEMENT_NAME);
         }
-      };
-    }
-  }
 
-  public SmackCcsClient() {
-    // Add GcmPacketExtension
-    ProviderManager.getInstance().addExtensionProvider(GCM_ELEMENT_NAME,
-        GCM_NAMESPACE, new PacketExtensionProvider() {
-
-      &#64;Override
-      public PacketExtension parseExtension(XmlPullParser parser)
-          throws Exception {
-        String json = parser.nextText();
-        GcmPacketExtension packet = new GcmPacketExtension(json);
-        return packet;
-      }
-    });
-  }
-
-  /**
-   * Returns a random message id to uniquely identify a message.
-   *
-   * &lt;p&gt;Note:
-   * This is generated by a pseudo random number generator for illustration purpose,
-   * and is not guaranteed to be unique.
-   *
-   */
-  public String getRandomMessageId() {
-    return &quot;m-&quot; + Long.toString(random.nextLong());
-  }
-
-  /**
-   * Sends a downstream GCM message.
-   */
-  public void send(String jsonRequest) {
-    Packet request = new GcmPacketExtension(jsonRequest).toPacket();
-    connection.sendPacket(request);
-  }
-
-  /**
-   * Handles an upstream data message from a device application.
-   *
-   * &lt;p&gt;This sample echo server sends an echo message back to the device.
-   * Subclasses should override this method to process an upstream message.
-   */
-  public void handleIncomingDataMessage(Map&lt;String, Object&gt; jsonObject) {
-    String from = jsonObject.get(&quot;from&quot;).toString();
-
-    // PackageName of the application that sent this message.
-    String category = jsonObject.get(&quot;category&quot;).toString();
-
-    // Use the packageName as the collapseKey in the echo packet
-    String collapseKey = &quot;echo:CollapseKey&quot;;
-    &#64;SuppressWarnings(&quot;unchecked&quot;)
-    Map&lt;String, String&gt; payload = (Map&lt;String, String&gt;) jsonObject.get(&quot;data&quot;);
-    payload.put(&quot;ECHO&quot;, &quot;Application: &quot; + category);
-
-    // Send an ECHO response back
-    String echo = createJsonMessage(from, getRandomMessageId(), payload, collapseKey, null, false);
-    send(echo);
-  }
-
-  /**
-   * Handles an ACK.
-   *
-   * &lt;p&gt;By default, it only logs a {@code INFO} message, but subclasses could override it to
-   * properly handle ACKS.
-   */
-  public void handleAckReceipt(Map&lt;String, Object&gt; jsonObject) {
-    String messageId = jsonObject.get(&quot;message_id&quot;).toString();
-    String from = jsonObject.get(&quot;from&quot;).toString();
-    logger.log(Level.INFO, &quot;handleAckReceipt() from: &quot; + from + &quot;, messageId: &quot; + messageId);
-  }
-
-  /**
-   * Handles a NACK.
-   *
-   * &lt;p&gt;By default, it only logs a {@code INFO} message, but subclasses could override it to
-   * properly handle NACKS.
-   */
-  public void handleNackReceipt(Map&lt;String, Object&gt; jsonObject) {
-    String messageId = jsonObject.get(&quot;message_id&quot;).toString();
-    String from = jsonObject.get(&quot;from&quot;).toString();
-    logger.log(Level.INFO, &quot;handleNackReceipt() from: &quot; + from + &quot;, messageId: &quot; + messageId);
-  }
-
-  /**
-   * Creates a JSON encoded GCM message.
-   *
-   * &#64;param to RegistrationId of the target device (Required).
-   * &#64;param messageId Unique messageId for which CCS will send an &quot;ack/nack&quot; (Required).
-   * &#64;param payload Message content intended for the application. (Optional).
-   * &#64;param collapseKey GCM collapse_key parameter (Optional).
-   * &#64;param timeToLive GCM time_to_live parameter (Optional).
-   * &#64;param delayWhileIdle GCM delay_while_idle parameter (Optional).
-   * &#64;return JSON encoded GCM message.
-   */
-  public static String createJsonMessage(String to, String messageId, Map&lt;String, String&gt; payload,
-      String collapseKey, Long timeToLive, Boolean delayWhileIdle) {
-    Map&lt;String, Object&gt; message = new HashMap&lt;String, Object&gt;();
-    message.put(&quot;to&quot;, to);
-    if (collapseKey != null) {
-      message.put(&quot;collapse_key&quot;, collapseKey);
-    }
-    if (timeToLive != null) {
-      message.put(&quot;time_to_live&quot;, timeToLive);
-    }
-    if (delayWhileIdle != null &amp;&amp; delayWhileIdle) {
-      message.put(&quot;delay_while_idle&quot;, true);
-    }
-    message.put(&quot;message_id&quot;, messageId);
-    message.put(&quot;data&quot;, payload);
-    return JSONValue.toJSONString(message);
-  }
-
-  /**
-   * Creates a JSON encoded ACK message for an upstream message received from an application.
-   *
-   * &#64;param to RegistrationId of the device who sent the upstream message.
-   * &#64;param messageId messageId of the upstream message to be acknowledged to CCS.
-   * &#64;return JSON encoded ack.
-   */
-  public static String createJsonAck(String to, String messageId) {
-    Map&lt;String, Object&gt; message = new HashMap&lt;String, Object&gt;();
-    message.put(&quot;message_type&quot;, &quot;ack&quot;);
-    message.put(&quot;to&quot;, to);
-    message.put(&quot;message_id&quot;, messageId);
-    return JSONValue.toJSONString(message);
-  }
-
-  /**
-   * Connects to GCM Cloud Connection Server using the supplied credentials.
-   *
-   * &#64;param username GCM_SENDER_ID&#64;gcm.googleapis.com
-   * &#64;param password API Key
-   * &#64;throws XMPPException
-   */
-  public void connect(String username, String password) throws XMPPException {
-    config = new ConnectionConfiguration(GCM_SERVER, GCM_PORT);
-    config.setSecurityMode(SecurityMode.enabled);
-    config.setReconnectionAllowed(true);
-    config.setRosterLoadedAtLogin(false);
-    config.setSendPresence(false);
-    config.setSocketFactory(SSLSocketFactory.getDefault());
-
-    // NOTE: Set to true to launch a window with information about packets sent and received
-    config.setDebuggerEnabled(true);
-
-    // -Dsmack.debugEnabled=true
-    XMPPConnection.DEBUG_ENABLED = true;
-
-    connection = new XMPPConnection(config);
-    connection.connect();
-
-    connection.addConnectionListener(new ConnectionListener() {
-
-      &#64;Override
-      public void reconnectionSuccessful() {
-        logger.info(&quot;Reconnecting..&quot;);
-      }
-
-      &#64;Override
-      public void reconnectionFailed(Exception e) {
-        logger.log(Level.INFO, &quot;Reconnection failed.. &quot;, e);
-      }
-
-      &#64;Override
-      public void reconnectingIn(int seconds) {
-        logger.log(Level.INFO, &quot;Reconnecting in %d secs&quot;, seconds);
-      }
-
-      &#64;Override
-      public void connectionClosedOnError(Exception e) {
-        logger.log(Level.INFO, &quot;Connection closed on error.&quot;);
-      }
-
-      &#64;Override
-      public void connectionClosed() {
-        logger.info(&quot;Connection closed.&quot;);
-      }
-    });
-
-    // Handle incoming packets
-    connection.addPacketListener(new PacketListener() {
-
-      &#64;Override
-      public void processPacket(Packet packet) {
-        logger.log(Level.INFO, &quot;Received: &quot; + packet.toXML());
-        Message incomingMessage = (Message) packet;
-        GcmPacketExtension gcmPacket =
-            (GcmPacketExtension) incomingMessage.getExtension(GCM_NAMESPACE);
-        String json = gcmPacket.getJson();
-        try {
-          &#64;SuppressWarnings(&quot;unchecked&quot;)
-          Map&lt;String, Object&gt; jsonObject =
-              (Map&lt;String, Object&gt;) JSONValue.parseWithException(json);
-
-          // present for &quot;ack&quot;/&quot;nack&quot;, null otherwise
-          Object messageType = jsonObject.get(&quot;message_type&quot;);
-
-          if (messageType == null) {
-            // Normal upstream data message
-            handleIncomingDataMessage(jsonObject);
-
-            // Send ACK to CCS
-            String messageId = jsonObject.get(&quot;message_id&quot;).toString();
-            String from = jsonObject.get(&quot;from&quot;).toString();
-            String ack = createJsonAck(from, messageId);
-            send(ack);
-          } else if (&quot;ack&quot;.equals(messageType.toString())) {
-            // Process Ack
-            handleAckReceipt(jsonObject);
-          } else if (&quot;nack&quot;.equals(messageType.toString())) {
-            // Process Nack
-            handleNackReceipt(jsonObject);
-          } else {
-            logger.log(Level.WARNING, &quot;Unrecognized message type (%s)&quot;,
-                messageType.toString());
-          }
-        } catch (ParseException e) {
-          logger.log(Level.SEVERE, &quot;Error parsing JSON &quot; + json, e);
-        } catch (Exception e) {
-          logger.log(Level.SEVERE, &quot;Couldn't send echo.&quot;, e);
+        public Packet toPacket() {
+            Message message = new Message();
+            message.addExtension(this);
+            return message;
         }
-      }
-    }, new PacketTypeFilter(Message.class));
-
-
-    // Log all outgoing packets
-    connection.addPacketInterceptor(new PacketInterceptor() {
-      &#64;Override
-      public void interceptPacket(Packet packet) {
-        logger.log(Level.INFO, &quot;Sent: {0}&quot;,  packet.toXML());
-      }
-    }, new PacketTypeFilter(Message.class));
-
-    connection.login(username, password);
-  }
-
-  public static void main(String [] args) {
-    final String userName = &quot;Your GCM Sender Id&quot; + &quot;&#64;gcm.googleapis.com&quot;;
-    final String password = &quot;API Key&quot;;
-
-    SmackCcsClient ccsClient = new SmackCcsClient();
-
-    try {
-      ccsClient.connect(userName, password);
-    } catch (XMPPException e) {
-      e.printStackTrace();
     }
 
-    // Send a sample hello downstream message to a device.
-    String toRegId = &quot;RegistrationIdOfTheTargetDevice&quot;;
-    String messageId = ccsClient.getRandomMessageId();
-    Map&lt;String, String&gt; payload = new HashMap&lt;String, String&gt;();
-    payload.put(&quot;Hello&quot;, &quot;World&quot;);
-    payload.put(&quot;CCS&quot;, &quot;Dummy Message&quot;);
-    payload.put(&quot;EmbeddedMessageId&quot;, messageId);
-    String collapseKey = &quot;sample&quot;;
-    Long timeToLive = 10000L;
-    Boolean delayWhileIdle = true;
-    ccsClient.send(createJsonMessage(toRegId, messageId, payload, collapseKey,
-        timeToLive, delayWhileIdle));
-  }
+    private static final class LoggingConnectionListener
+            implements ConnectionListener {
+
+        &#64;Override
+        public void connected(XMPPConnection xmppConnection) {
+            logger.info(&quot;Connected.&quot;);
+        }
+
+        &#64;Override
+        public void authenticated(XMPPConnection xmppConnection) {
+            logger.info(&quot;Authenticated.&quot;);
+        }
+
+        &#64;Override
+        public void reconnectionSuccessful() {
+            logger.info(&quot;Reconnecting..&quot;);
+        }
+
+        &#64;Override
+        public void reconnectionFailed(Exception e) {
+            logger.log(Level.INFO, &quot;Reconnection failed.. &quot;, e);
+        }
+
+        &#64;Override
+        public void reconnectingIn(int seconds) {
+            logger.log(Level.INFO, &quot;Reconnecting in %d secs&quot;, seconds);
+        }
+
+        &#64;Override
+        public void connectionClosedOnError(Exception e) {
+            logger.info(&quot;Connection closed on error.&quot;);
+        }
+
+        &#64;Override
+        public void connectionClosed() {
+            logger.info(&quot;Connection closed.&quot;);
+        }
+    }
 }</pre>
+
 <h3 id="python">Python sample</h3>
 
 <p>Here is an example of a CCS app server written in Python. This sample echo
diff --git a/docs/html/google/gcm/gs.jd b/docs/html/google/gcm/gs.jd
index d937955..d357401 100644
--- a/docs/html/google/gcm/gs.jd
+++ b/docs/html/google/gcm/gs.jd
@@ -20,7 +20,6 @@
 <ol class="toc">
 <li><a href="https://cloud.google.com/console">Google Cloud Console</a></li>
 <li><a href="https://developers.google.com/console/help/new/">Google Cloud Console Help</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>
diff --git a/docs/html/google/google_toc.cs b/docs/html/google/google_toc.cs
index b770135..7cce86b 100644
--- a/docs/html/google/google_toc.cs
+++ b/docs/html/google/google_toc.cs
@@ -138,9 +138,6 @@
       <li><a href="<?cs var:toroot?>google/play/billing/billing_admin.html">
               <span class="en">Administering In-app Billing</span></a>
       </li>
-      <li><a href="<?cs var:toroot?>google/play/billing/gp-purchase-status-api.html">
-              <span class="en">Purchase Status API</span></a>
-      </li>
       <li><a href="<?cs var:toroot?>google/play/billing/versions.html">
               <span class="en">Version Notes</span></a>
       </li>
@@ -205,7 +202,9 @@
       <li><a href="<?cs var:toroot ?>google/play/filters.html">
           <span class="en">Filters on Google Play</span></a>
       </li>
-
+      <li><a href="<?cs var:toroot?>google/play/billing/gp-purchase-status-api.html">
+              <span class="en">Google Play Developer API</span></a>
+      </li>
       <li><a href="<?cs var:toroot ?>google/play/publishing/multiple-apks.html">
           <span class="en">Multiple APK Support</span></a>
       </li>
diff --git a/docs/html/google/play-services/ads.jd b/docs/html/google/play-services/ads.jd
index 18579c7..0c7b2ec 100644
--- a/docs/html/google/play-services/ads.jd
+++ b/docs/html/google/play-services/ads.jd
@@ -31,6 +31,25 @@
 </div>
 </div>
 
+<div style=
+"background-color:#fffdeb;width:100%;margin-bottom:1em;padding:.5em;" class=
+"caution">
+  <p><strong>Upgrade to the new AdMob</strong></p>
+  <p>Legacy AdMob will be shutting down on August 31, 2014. Beginning August 31,
+    you will no longer be able to use legacy AdMob to promote and monetize your
+    apps. Specifically, please be aware of the following:</p>
+  <ol style="margin-bottom:0;">
+    <li>Ads will stop serving to legacy ad units that are not updated with new
+    ad unit IDs.</li>
+    <li>Legacy house ad campaigns will stop serving.</li>
+    <li>You will not be able to access the legacy AdMob UI after August 31,
+    2014.</li>
+  </ol>
+  <p>If you are still using legacy AdMob, please upgrade your account to the new
+    AdMob as soon as possible. Upgrading takes only 5 minutes. <a href=
+    "https://apps.admob.com/admob/signup?">Start here</a>.</p>
+</div>
+
 <div class="landing-docs">
   <div class="col-6 normal-links">
     <h3 style="clear:left">Key Developer Features</h3>
@@ -59,6 +78,11 @@
       <h4>Flexible and powerful tools </h4>
       <p>Filters and controls help you manage your ads. If you want to use multiple ad
       networks, you can do that too, with free ad network mediation.</p>
+
+      <h4>Ad Policy Compliant</h4>
+      <p>The Google Mobile Ads SDK available in Google Play services is compliant with
+      Google Play Ad Poilcy regarding the usage of
+      <a href="{@docRoot}google/play-services/id.html">advertising ID</a>.</p>
   </div>
 
   <div class="col-6 normal-links">
diff --git a/docs/html/google/play-services/id.jd b/docs/html/google/play-services/id.jd
index 466dfef..d5acf76 100644
--- a/docs/html/google/play-services/id.jd
+++ b/docs/html/google/play-services/id.jd
@@ -55,6 +55,19 @@
   </div>
 </div>
 
+<p class="caution" style=
+"background-color:#fffdeb;width:100%;margin-bottom:1em;padding:.5em;">
+  As a reminder, please note that starting <strong>1 August 2014</strong>, new
+  apps and app updates distributed through Google Play must use the advertising
+  ID in lieu of any other persistent identifiers for any advertising purposes,
+  on devices that support the advertising ID.<br>
+  <br>
+  To learn how to check your app's compliance through the Developer Console, or
+  for details on the associated developer policy changes, please see the
+  <a href=
+  "https://support.google.com/googleplay/android-developer/answer/6048248">Advertising
+  ID topic</a> in the Google Play developer help center.
+</p>
 
 <h2 id="get_started">Using the Advertising ID</h2>
 
diff --git a/docs/html/google/play-services/setup.jd b/docs/html/google/play-services/setup.jd
index cc2047e..d7e449b 100644
--- a/docs/html/google/play-services/setup.jd
+++ b/docs/html/google/play-services/setup.jd
@@ -66,8 +66,8 @@
 ...
 
 dependencies {
-    compile 'com.android.support:appcompat-v7:+'
-    <strong>compile 'com.google.android.gms:play-services:5.0.77'</strong>
+    compile 'com.android.support:appcompat-v7:20.+'
+    <strong>compile 'com.google.android.gms:play-services:5.+'</strong>
 }
 </pre>
 <p>Be sure you update this version number each time Google Play services is updated.</p>
@@ -129,7 +129,7 @@
 <ol>
   <li>Copy the library project at <code>&lt;android-sdk&gt;/extras/google/google_play_services/libproject/google-play-services_lib/</code> to the location where you maintain your Android app projects.</li>
 
-  <li>In your app project, reference Google Play services library project. See
+  <li>In your app project, reference the Google Play services library project. See
     <a href="{@docRoot}tools/projects/projects-cmdline.html#ReferencingLibraryProject">Referencing
     a Library Project on the Command Line</a> for more information on how to do this.
     <p class="note"><strong>Note:</strong>
diff --git a/docs/html/google/play/billing/api.jd b/docs/html/google/play/billing/api.jd
index 3d46715..bc710f9 100644
--- a/docs/html/google/play/billing/api.jd
+++ b/docs/html/google/play/billing/api.jd
@@ -1,6 +1,7 @@
-page.title=In-app Billing Version 3
+page.title=In-app Billing API
 parent.title=In-app Billing
 parent.link=index.html
+page.tags="billing, inapp, iap"
 @jd:body
 
 <div id="qv-wrapper">
diff --git a/docs/html/google/play/billing/billing_integrate.jd b/docs/html/google/play/billing/billing_integrate.jd
index dba43cd..052cf75 100644
--- a/docs/html/google/play/billing/billing_integrate.jd
+++ b/docs/html/google/play/billing/billing_integrate.jd
@@ -1,6 +1,7 @@
-page.title=Implementing In-app Billing <span style="font-size:16px;">(IAB Version 3)</span>
+page.title=Implementing In-app Billing
 parent.title=In-app Billing
 parent.link=index.html
+page.tags="inapp, billing, iap"
 @jd:body
 
 <div id="qv-wrapper">
@@ -141,15 +142,17 @@
 };
 </pre>
 
-<p>In your activity’s {@link android.app.Activity#onCreate onCreate} method, perform the binding by calling the {@link android.content.Context#bindService bindService} method. Pass the method an {@link android.content.Intent} that references the In-app Billing service and an instance of the {@link android.content.ServiceConnection} that you created.</p>
-<pre>
-&#64;Override
-public void onCreate(Bundle savedInstanceState) {    
-    super.onCreate(savedInstanceState);
-    setContentView(R.layout.activity_main);        
-    bindService(new 
-        Intent("com.android.vending.billing.InAppBillingService.BIND"),
-                mServiceConn, Context.BIND_AUTO_CREATE);
+<p>In your activity’s {@link android.app.Activity#onCreate onCreate} method, perform the binding by calling the {@link android.content.Context#bindService bindService} method. Pass the method an {@link android.content.Intent} that references the In-app Billing service and an instance of the {@link android.content.ServiceConnection} that you created, and explicitly set the Intent's target package name to <code>com.android.vending</code> &mdash; the package name of Google Play app.</p>
+
+<p class="caution"><strong>Caution:</strong> To protect the security of billing transactions, always make sure to explicitly set the intent's target package name to <code>com.android.vending</code>, using {@link android.content.Intent#setPackage(java.lang.String) setPackage()} as shown in the example below. Setting the package name explicitly ensures that <em>only</em> the Google Play app can handle billing requests from your app, preventing other apps from intercepting those requests.</p>
+
+<pre>&#64;Override
+public void onCreate(Bundle savedInstanceState) {
+  super.onCreate(savedInstanceState);
+  setContentView(R.layout.activity_main);
+  Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND");
+  serviceIntent.setPackage("com.android.vending");
+  bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE);
 </pre>
 <p>You can now use the mService reference to communicate with the Google Play service.</p>
 <p class="note"><strong>Important:</strong> Remember to unbind from the In-app Billing service when you are done with your {@link android.app.Activity}. If you don’t unbind, the open service connection could cause your device’s performance to degrade. This example shows how to perform the unbind operation on a service connection to In-app Billing called {@code mServiceConn} by overriding the activity’s {@link android.app.Activity#onDestroy onDestroy} method.</p>
@@ -269,7 +272,7 @@
    }
 }
 </pre>
-<p class="note"><strong>Security Recommendation:</strong> When you send a purchase request, create a String token that uniquely identifies this purchase request and include this token in the {@code developerPayload}.You can use a randomly generated string as the token. When you receive the purchase response from Google Play, make sure to check the returned data signature, the {@code orderId}, and the {@code developerPayload} String. For added security, you should perform the checking on your own secure server. Make sure to verify that the {@code orderId} is a unique value that you have not previously processed, and the {@code developerPayload} String matches the token that you sent previously with the purchase request.</p>
+<p class="note"><strong>Security Recommendation:</strong>  When you send a purchase request, create a String token that uniquely identifies this purchase request and include this token in the {@code developerPayload}.You can use a randomly generated string as the token. When you receive the purchase response from Google Play, make sure to check the returned data signature, the {@code orderId}, and the {@code developerPayload} String. For added security, you should perform the checking on your own secure server. Make sure to verify that the {@code orderId} is a unique value that you have not previously processed, and the {@code developerPayload} String matches the token that you sent previously with the purchase request.</p>
 
 <h3 id="QueryPurchases">Querying for Purchased Items</h3>
 <p>To retrieve information about purchases made by a user from your app, call the {@code getPurchases} method on the In-app Billing Version 3 service. Pass in to the method the In-app Billing API version (“3”), the package name of your calling app, and the purchase type (“inapp” or "subs").</p>
diff --git a/docs/html/google/play/billing/billing_overview.jd b/docs/html/google/play/billing/billing_overview.jd
index 301d911..12f8c9a 100644
--- a/docs/html/google/play/billing/billing_overview.jd
+++ b/docs/html/google/play/billing/billing_overview.jd
@@ -38,6 +38,16 @@
 features that you need to understand in order to add In-app 
 Billing features into your application.</p>
 
+<p class="note"><b>Note</b>: Ensure that you comply with applicable laws in the countries where you
+distribute apps. For example, in EU countries, laws based on the
+<a href="http://ec.europa.eu/justice/consumer-marketing/unfair-trade/unfair-practices/">Unfair
+Commercial Practices Directive</a> prohibit direct exhortations to children to buy advertised
+products or to persuade their parents or other adults to buy advertised products for them.
+See the
+<a href="http://ec.europa.eu/consumers/enforcement/docs/common_position_on_online_games_en.pdf">position
+of the EU consumer protection authorities</a> for more information on this and other topics.
+</p>
+
 <h2 id="api">In-app Billing API</h2>
 <p>Your application accesses the In-app Billing service using an API that is 
 exposed by the Google Play app that is installed on the device. The Google Play 
diff --git a/docs/html/google/play/billing/billing_reference.jd b/docs/html/google/play/billing/billing_reference.jd
index e168d70..4d80964 100644
--- a/docs/html/google/play/billing/billing_reference.jd
+++ b/docs/html/google/play/billing/billing_reference.jd
@@ -1,4 +1,4 @@
-page.title=In-app Billing Reference <span style="font-size:16px;">(IAB Version 3)</span>
+page.title=In-app Billing Reference
 parent.title=In-app Billing
 parent.link=index.html
 @jd:body
@@ -102,15 +102,28 @@
   </tr>
   <tr>
     <td>{@code type}</td>
-    <td>Value must be “inapp” for an in-app product or "subs" for 
+    <td>Value must be “inapp” for an in-app product or "subs" for
 subscriptions.</td>
   </tr>
   <tr>
     <td>{@code price}</td>
-    <td>Formatted price of the item, including its currency sign. The price 
+    <td>Formatted price of the item, including its currency sign. The price
 does not include tax.</td>
   </tr>
   <tr>
+    <td>{@code price_amount_micros}</td>
+    <td>Price in micro-units, where 1,000,000 micro-units equal one unit of the
+    currency. For example, if {@code price} is {@code "€7.99"}, {@code
+    price_amount_micros} is {@code "7990000"}.</td>
+  </tr>
+  <tr>
+    <td>{@code price_currency_code}</td>
+    <td><a href="http://en.wikipedia.org/wiki/ISO_4217#Active_codes">ISO 4217
+    currency code</a> for {@code price}. For example, if {@code price} is
+    specified in British pounds sterling, {@code price_currency_code} is {@code
+    "GBP"}.</td>
+  </tr>
+  <tr>
     <td>{@code title}</td>
     <td>Title of the product.</td>
   </tr>
diff --git a/docs/html/google/play/billing/billing_subscriptions.jd b/docs/html/google/play/billing/billing_subscriptions.jd
index d0e6dc5..2b78ab3 100644
--- a/docs/html/google/play/billing/billing_subscriptions.jd
+++ b/docs/html/google/play/billing/billing_subscriptions.jd
@@ -1,9 +1,9 @@
-page.title=Google Play In-App Subscriptions
+page.title=In-App Subscriptions
 parent.title=In-app Billing
 parent.link=index.html
 page.metaDescription=Subscriptions let you sell content or features in your app with automated, recurring billing.
 page.image=/images/play_dev.jpg
-page.tags="inapp, iap, billing"
+page.tags="subscriptions, billing, inapp, iap"
 meta.tags="monetization, inappbilling, subscriptions"
 @jd:body
 
@@ -24,6 +24,7 @@
     <li><a href="#administering">Configuring Subscriptions Items</a></li>
     <li><a href="#cancellation">Cancellation</a></li>
     <li><a href="#payment">Payment Processing</a></li>
+    <li><a href="#strategies">Purchase Verification Strategies</a></li>
   </ol>
   <h2>See also</h2>
   <ol>
@@ -325,6 +326,21 @@
 {@code orderId} field of the {@code INAPP_PURCHASE_DATA} JSON field (in V3) 
 or the {@code PURCHASE_STATE_CHANGED} intent (in V2).</p>
 
+<h2 id="strategies">Purchase Verification Strategies</h2>
+
+<p>In a typical scenario, your app verifies the order status for new purchases
+to ensure that they are valid before granting access to the purchased
+content.</p>
+
+<p>To verify a purchase, the app passes the purchase token and other details up
+to your backend servers, which verifies them directly with Google Play using the
+Purchase Status API.  If the backend server determines that the purchase is
+valid, it notifies the app and grants access to the content.</p>
+
+<p>Keep in mind that users will want the ability to use your app at any time,
+including when there may be no network connection available. Make sure that your
+approach to purchase verification accounts for the offline use-case.</p>
+
 <h2 id="play-dev-api">Google Play Android Developer API</h2>
 
 <p>Google Play offers an HTTP-based API that lets you remotely query the
@@ -333,4 +349,4 @@
 managing subscriptions, as well as extending and integrating subscriptions with
 other services.</p>
 
-<p>For complete information, see <a href="{@docRoot}google/play/billing/gp-purchase-status-api.html">Purchase Status API</a>.</p>
\ No newline at end of file
+<p>For complete information, see <a href="{@docRoot}google/play/billing/gp-purchase-status-api.html">Purchase Status API</a>.</p>
diff --git a/docs/html/google/play/billing/billing_testing.jd b/docs/html/google/play/billing/billing_testing.jd
index 8a49433..10f5326 100644
--- a/docs/html/google/play/billing/billing_testing.jd
+++ b/docs/html/google/play/billing/billing_testing.jd
@@ -1,6 +1,7 @@
 page.title=Testing In-app Billing
 parent.title=In-app Billing
 parent.link=index.html
+page.tags="inapp, billing, iap"
 @jd:body
 
 <div id="qv-wrapper">
diff --git a/docs/html/google/play/billing/gp-purchase-status-api.jd b/docs/html/google/play/billing/gp-purchase-status-api.jd
index 4cfacee..23a4e61 100644
--- a/docs/html/google/play/billing/gp-purchase-status-api.jd
+++ b/docs/html/google/play/billing/gp-purchase-status-api.jd
@@ -1,38 +1,113 @@
-page.title=Purchase Status API
-page.tags="In-app Billing", "Google Play", "inapp billing", "in app billing", "iab", "billing"
+page.title=Google Play Developer API
+page.tags="In-app Billing", "Google Play", "inapp billing", "in app billing", "iab", "billing", "publishing"
 
 @jd:body
 
 <div id="qv-wrapper">
 <div id="qv">
   <h2>In this document</h2>
+  <!-- TODO: Update TOC -->
   <ol>
-    <li><a href="#overview">Overview</a></li>
-    <li><a href="#using">Using the API</a></li>
-        <li><a href="#strategies">Verification Strategies</a></li>
-            <li><a href="#practices">Using the API Efficiently</a></li>
+    <li><a href="#publishing_api_overview">Publishing API</a>
+    <li><a href="#subscriptions_api_overview">Subscriptions and In-App
+          Purchases API</a></li>
+    <li><a href="#using">Using the API</a>
+    <li><a href="#edits">Staged Edits</a></li>
+    <li><a href="#practices">Using the API Efficiently</a>
+      <ol>
+        <li><a href="#quota">Quota</a></li>
+      </ol>
+    </li>
   </ol>
+
   <h2>See also</h2>
   <ol>
-    <li><a href="https://developers.google.com/android-publisher/v1_1/">Google Play Android Developer API</a></li>
+    <li><a href="https://developers.google.com/android-publisher/">Google Play
+        Developer API</a> documentation</li>
+    <li><a href="https://support.google.com/googleplay/android-developer/answer/6071616">Google
+        Help Center</a> overview of the Google Play Developer API</li>
   </ol>
 </div>
 </div>
 
-<p>Google Play provides an HTTP-based Purchase Status API that lets
-you remotely query the status of a specific in-app product or subscription,
-or cancel an active subscription. The API is designed to be used from your
-backend servers as a way of securely managing in-app products and
-subscriptions, as well as extending and integrating them with other services.</p>
+<p>The Google Play Developer API is a REST-based web service that allows you to perform publishing
+and app-management tasks. You can use this API to integrate your publishing
+operations with your release-management process.</p>
 
-<h2 id="overview">Overview</h2>
+<p>Not all developers will need to use these APIs&mdash;in most cases you will
+continue to manage your apps directly using the Google Play Developer Console.
+However, if you have a large number of APKs to manage, or have to track user
+purchases and subscriptions, you may find this API very useful.</p>
 
-<p>With the Purchase Status API you can quickly retrieve the details of any
-purchase using a standard GET request. In the request you supply information
-about the purchase &mdash; app package name, purchase or subscription ID,
-and the purchase token. The server responds with a JSON object describing
-the associated purchase details, order status, developer payload, and other
-information.</p>
+<p>Using the Google Play Developer API, you can automate a variety of
+app-management tasks, including:</p>
+
+<ul>
+<li>Uploading and releasing new versions of your app</li>
+<li>Editing your app Google Play Store listings, including localized text and
+    graphics</li>
+<li>Managing your in-app product catalog, your products purchase status and your
+    app subscriptions</li>
+</li>
+</ul>
+
+
+
+<p>The Google Play Developer API lets you focus on designing and developing your
+app, while spending less time and effort managing your releases, even as you
+grow to new markets.</p>
+
+<p>The Google Play Developer API includes two components:</p>
+
+<ul>
+<li>The <a href="#publishing_api_overview">Publishing API</a> lets you upload and publish
+  apps, and perform other publishing-related tasks.</li>
+<li>The <a href="#subscriptions_api_overview">Subscriptions and In-App Purchases
+  API</a> lets you manage in-app purchases and subscriptions. (This was
+  previously known as the "Purchase Status API".)</li>
+</ul>
+
+<h2 id="publishing_api_overview">Publishing API</h2>
+
+<p>
+The Google Play Developer Publishing API allows you to automate frequent tasks
+having to do with app distribution. This provides functions
+similar to those available to a developer through the Google Play
+Developer Console, such
+as:
+</p>
+
+<ul><li>Uploading new versions of an app</li>
+<li>Releasing apps, by assigning APKs to various <em>Tracks</em> (alpha, beta,
+  staged rollout, or production)</li>
+<li>Creating and modifying Google Play Store listings, including localized text
+  and graphics and multi-device screenshots</li></ul>
+
+<p>Those tasks are performed using the
+<a href="#edits">edits</a>
+functionality, which takes a transactional approach to making changes &mdash;
+you bundle several changes into a single draft edit, then commit the changes all
+at once. (None of the changes take effect until the edit is committed.)</p>
+
+<p class="note"><strong>Note:</strong> Not all developers will need to use this
+API. All the functionality provided by the API is also available through the
+Google Play
+Developer Console. However, this API lets you integrate your app and listing
+update process with your existing tools, which will be very useful for some
+developers. In particular, if you have a large number of APKs to manage, or
+localized listings in many different locales, you may find this API invaluable.
+</p>
+
+<h2 id="subscriptions_api_overview">Subscriptions and In-App Purchases API</h2>
+
+<p>The API allows you to manage your app's catalog of in-app products and
+subscriptions. In addition, with the Subscriptions and In-App Purchases API you
+can quickly retrieve the
+details of any purchase using a standard GET request. In the request you supply
+information about the purchase &mdash; app package name, purchase or
+subscription ID, and the purchase token. The server responds with a JSON object
+describing the associated purchase details, order status, developer payload, and
+other information.</p>
 
 <p>You can use the Purchase Status API in several ways, such as for reporting
 and reconciliation of individual orders and for verifying purchases and
@@ -40,101 +115,85 @@
 orders and confirm whether in-app products have been consumed, including
 whether they were consumed before being cancelled.</p>
 
-<p>For subscriptions, in addition to querying for order status and expiration,
-you can use the Purchase Status API to remotely cancel a subscription. This is a
-convenient way to manage cancellations on behalf of customers, without
-requiring them to manage the cancellation themselves on their Android devices.</p>
-
-<p>If you plan to use the Purchase Status API, keep in mind that:</p>
-<ul><li>You can use the API to check the status of individual items only
-&mdash; bulk requests for order status are not supported at this time.</li>
-<li>You can query for the details of orders placed on or after 12 June 2013,
-but not for orders placed earlier.</li>
-<li>You can query purchases of any item type made with the In-app
-Billing v3 API, or purchases of managed items made with In-app Billing v1 and
-v2. You can not use the Purchase Status API to query purchases of unmanaged items
-made with In-app Billing v1 or v2.</li>
-</ul>
+<p class="note"><strong>Note:</strong> The Subscriptions and In-App
+Purchases API does not use the new, transactional "edits" functionality used by
+the <a href="#publishing_api_overview">Publishing API</a>. Methods for the
+<a href="https://developers.google.com/android-publisher/api-ref/inappproducts">Inappproducts</a>,
+<a href="https://developers.google.com/android-publisher/api-ref/purchases/products">Purchases.products</a>,
+and <a href="https://developers.google.com/android-publisher/api-ref/purchases/subscriptions">Purchases.subscriptions</a>
+resources take effect immediately. Each resource's API reference page notes
+specifically whether the methods for that resource use the "edits"
+model.</p>
 
 <p>The Purchase Status API is part of the <a
-href="https://developers.google.com/android-publisher/v1_1/">Google Play Android
-Developer API v1.1</a>, available through the Google Developers Console. The new version
-of the API supersedes the v1 API, which is deprecated. If you are using the v1
-API, please migrate your operations to the v1.1 API as soon as possible.</p>
-
+href="https://developers.google.com/android-publisher/">Google Play Developer
+API</a> v. 2.0, available through the Google Developers Console.</p>
 
 <h2 id="using">Using the API</h2>
 
-<p>To use the API, you must first register a project at the <a
-href="https://cloud.google.com/console">Google Developers Console</a> and receive
-a Client ID and shared secret that  your app will present when calling the
-API. All calls are authenticated with OAuth 2.0.</p>
+<p>To start making API calls, you’ll set up and manage the Google Play Developer
+API directly from the <a href="https://play.google.com/apps/publish/">Google
+Play Developer Console</a>. The API can only be managed by the owner of your
+Google Play Developer account.</p>
 
-<p>Once your app is registered, you can access the API directly, using standard
-HTTP methods to retrieve and manipulate resources. The API is built on a RESTful
-design that uses HTTP and JSON. so any standard web stack can send requests and
-parse the responses. However, if you don’t want to send HTTP requests and parse
-responses manually, you can access the API using the Google APIs Client
-Libraries, which provide better language integration, improved security,
-and support for making calls that require user authorization.</p>
+<p>To access the API, you'll need to:</p>
 
-<p>For more information about the API and how to access it through the Google
-APIs Client Libraries, see the documentation at:</p> 
+<ol><li>Set up a new or existing API project</li>
+<li>Set up one or more authorized clients, which can be either:
+<ul>
+  <li><a href="https://developers.google.com/accounts/docs/OAuth2">OAuth
+      clients</a></li>
+  <li><a href="https://developers.google.com/accounts/docs/OAuth2ServiceAccount">
+      service account</a></li>
+</ul></li></ol>
 
-<p style="margin-left:1.5em;"><a
-href="https://developers.google.com/android-publisher/v1_1/">https://developers.
-google.com/android-publisher/v1_1/</a></p>
+<p>For full details, see the Google Play Developer API
+<a href="https://developers.google.com/android-publisher/getting_started">Getting
+Started</a> page.</p>
 
-<h3 id="quota">Quota</h3>
+<h2 id="edits">Staged Edits</h2>
 
-<p>Applications using the Google Play Android Developer API are limited to an
-initial courtesy usage quota of <strong>200,000 requests per day</strong> (per
-application). This should provide enough access for normal
-subscription-validation needs, assuming that you follow the recommendation in
-this section.</p>
+<p>The Google Play Developer Publishing API Edits methods allow you to prepare
+and commit changes to your Google Play apps. Once your update is ready to go,
+you can deploy it with a single operation. The changes you can make include:</p>
 
-<p>If you need to request a higher limit for your application, see the
-instructions in the <a
-href="https://developers.google.com/console/help/new/#trafficcontrols">Google Developers
-Console Help</a>.
-Also, please read the section below on design best practices for minimizing your
-use of the API.</p>
+<ul>
+  <li>Uploading one or more APKs</li>
+  <li>Assigning different APKs to different “tracks”: alpha, beta, staged
+      rollout, and production</li>
+  <li>Creating and modifying localized store listings for the app</li>
+  <li>Uploading screenshots and other images for the app’s store listings</li>
+</ul>
 
-<h3 id="auth">Authorization</h3>
+<p>Once all the desired changes have been staged, they are all committed with a
+single operation.</p>
 
-<p>Calls to the Google Play Android Developer API require authorization. Google
-uses the OAuth 2.0 protocol to allow authorized applications to access user
-data. To learn more, see <a
-href="https://developers.google.com/android-publisher/authorization">Authorization</a>
-in the Google Play Android Developer API documentation.</p>
+<p>For full details on staged edits, see the Google Play Developer API
+<a href="https://developers.google.com/android-publisher/edits/">Edits</a>
+page.</p>
 
-<h2 id="strategies">Purchase Verification Strategies</h2>
-
-<p>In a typical scenario, your app verifies the order status for new purchases
-to ensure that they are valid before granting access to the purchased content.</p>
-
-<p>To verify a purchase, the app passes the purchase token and other details up
-to your backend servers, which verifies them directly with Google Play using the
-Purchase Status API. For security reasons, the app should not normally attempt to verify
-the purchase itself using the Purchase Status API.</p>
-
-<p>If the backend server determines that the purchase is valid, it notifies the
-app and grants access to the content. For improved performance, the backend servers
-should store the purchase details and order status in a local database, updated at
-intervals or as-needed.</p>
-
-<p>Keep in mind that users will want the ability to use your app at any time, including
-when there may be no network connection available. Make sure that your approach to
-purchase verification accounts for the offline use-case.</p>
+<p class="note"><strong>Note:</strong> The new, transactional "edits"
+functionality is only used by the <a href="#publishing_api_overview">Publishing
+API</a>. Methods for the <a href="#subscriptions_api_overview">Subscriptions and
+In-App Purchases API</a> take effect immediately. Each resource's API reference
+page notes specifically whether the methods for that resource use the "edits"
+model.</p>
 
 <h2 id="practices">Using the API Efficiently</h2>
 
-<p>Access to the Google Play Android Developer API is regulated to help ensure a
-high-performance environment for all applications that use it. While you can
+<p>Access to the Google Play Developer API is regulated to help ensure a
+high-performance environment for all applications that use it (as described in
+<a href="#quota">Quota</a>). While you can
 request a higher daily quota for your application, we highly recommend that you
-minimize your access using the techniques below. </p>
+minimize your access using these techniques: </p>
 
 <ul>
+  <li><em>Limit the number of app updates</em> &mdash; Do not publish alpha or beta
+  updates more frequently than once a day. (Production apps should be updated
+  even less frequently than that.) Every update costs your users time and
+  possibly money. If you update too frequently, users will start ignoring
+  updates, or even uninstall the product. (Of course, if there's a major problem
+  with your app, go ahead and fix it.)</li>
   <li><em>Query the Purchase Status API for new purchases only</em> &mdash; At
   purchase, your app can pass the purchase token and other details to your backend
   servers, which can use the Purchase Status API to verify the purchase.</li>
@@ -163,6 +222,15 @@
 </ul>
 
 <p>By following those general guidelines, your implementation will offer the
-best possible performance for users and minimize use of the <a
-href="https://developers.google.com/android-publisher/v1_1/">Google Play Android
-Developer API</a>.</p>
+best possible performance for users.</p>
+
+<h3 id="quota">Quota</h3>
+
+<p>Applications using the Google Play Developer API are limited to an
+initial courtesy usage quota of <strong>200,000 requests per day</strong> (per
+application). This should provide enough access for publishing activities and
+normal subscription-validation needs.</p>
+
+<p>If you need to request a higher limit for your application, use the "Request
+more" link on the <strong>Quotas</strong>
+pane of the Google Developers Console.</p>
diff --git a/docs/html/google/play/billing/index.jd b/docs/html/google/play/billing/index.jd
index dce20cb..875271fe 100644
--- a/docs/html/google/play/billing/index.jd
+++ b/docs/html/google/play/billing/index.jd
@@ -2,7 +2,7 @@
 page.metaDescription=In-app Billing lets you sell digital content as one-time purchases or subscriptions.
 page.image=/images/play_dev.jpg
 meta.tags="monetizing, inappbilling, subscriptions"
-page.tags="inapp, iap, subscriptions"
+page.tags="billing, inapp, iap"
 @jd:body
 
 <p>In-app Billing is a Google Play service that lets you sell digital content from inside
@@ -14,7 +14,11 @@
 <div class="sidebox">
   <h2><strong>New in In-App Billing</strong></h2>
   <ul>
-  <li><strong>Purchase Status API</strong>&mdash;The <a href="{@docRoot}google/play/billing/gp-purchase-status-api.html">Purchase Status API</a> lets you query the status of in-app product or subscription purchases. </li>
+  <li><strong>Google Play Developer API</strong>&mdash;The
+    <a href="{@docRoot}google/play/billing/gp-purchase-status-api.html">Google
+    Play Developer API</a> allows you to perform a number of publishing and
+    app-management tasks. It includes the functionality previously known as the
+    <em>Purchase Status API.</em> </li>
   <li><strong>In-app Billing Version 3</strong>&mdash;The <a href="{@docRoot}google/play/billing/api.html">latest version</a> of In-app Billing features a synchronous API that is easier to implement and lets you manage in-app products and subscriptions more effectively.</li>
   <li><strong>Subscriptions now supported in Version 3</strong>&mdash;You can query and launch purchase flows for subscription items using the V3 API.</li>
   <li><strong>Free trials</strong>&mdash;You can now offer users a configurable <a href="/google/play/billing/v2/billing_subscriptions.html#trials">free trial period</a> for your in-app subscriptions. You can set up trials with a simple change in the Developer Console&mdash;no change to your app code is needed.</li>
diff --git a/docs/html/google/play/billing/versions.jd b/docs/html/google/play/billing/versions.jd
index 1271a15..dbe3ea3 100644
--- a/docs/html/google/play/billing/versions.jd
+++ b/docs/html/google/play/billing/versions.jd
@@ -1,3 +1,4 @@
+excludeFromSuggestions=true
 page.title=In-app Billing Version Notes
 @jd:body
 
diff --git a/docs/html/google/play/dist.jd b/docs/html/google/play/dist.jd
index b4efe40..f1ad834 100644
--- a/docs/html/google/play/dist.jd
+++ b/docs/html/google/play/dist.jd
@@ -49,4 +49,12 @@
     <p>Protect your revenue streams and integrate policies for usage into your app.
     </p><a href="{@docRoot}google/play/licensing/index.html">Learn more &raquo;</a>
   </div>
-</div>
\ No newline at end of file
+  <div class="layout-content-col span-6">
+    <h4>
+      Google Play Developer API
+    </h4>
+    <p>Integrate your publishing operations with your release-management
+      process.
+    </p><a href="{@docRoot}google/play/billing/gp-purchase-status-api.html">Learn more &raquo;</a>
+  </div>
+</div>
diff --git a/docs/html/guide/components/intents-common.jd b/docs/html/guide/components/intents-common.jd
index b4813a5..af9456d 100644
--- a/docs/html/guide/components/intents-common.jd
+++ b/docs/html/guide/components/intents-common.jd
@@ -1316,7 +1316,7 @@
 <dt>{@link android.provider.MediaStore#EXTRA_MEDIA_FOCUS MediaStore.EXTRA_MEDIA_FOCUS} (required)</dt>
 <dd>
 <p>Indicates the search mode (whether the user is looking for a particular artist, album, song,
-playlist, or radio channel). Most search modes take additional extras. For example, if the user
+or playlist). Most search modes take additional extras. For example, if the user
 is interested in listening to a particular song, the intent might have three additional extras:
 the song title, the artist, and the album. This intent supports the following search modes for
 each value of {@link android.provider.MediaStore#EXTRA_MEDIA_FOCUS}:</p>
@@ -1399,24 +1399,6 @@
       intent as an unstructured search.</li>
 </ul>
 </dd>
-<dt><p><em>Radio channel</em> - <code>"vnd.android.cursor.item/radio"</code></p></dt>
-<dd>
-<p>Play a particular radio channel or a radio channel that matches some criteria specified
-by additional extras.</p>
-<p>Additional extras:</p>
-<ul>
-  <li>{@link android.provider.MediaStore#EXTRA_MEDIA_ALBUM} - The album.</li>
-  <li>{@link android.provider.MediaStore#EXTRA_MEDIA_ARTIST} - The artist.</li>
-  <li><code>"android.intent.extra.genre"</code> - The genre.</li>
-  <li><code>"android.intent.extra.radio_channel"</code> - The radio channel.</li>
-  <li>{@link android.provider.MediaStore#EXTRA_MEDIA_TITLE} - The song name that the radio
-      channel is based on.</li>
-  <li>{@link android.app.SearchManager#QUERY} (required) - A string that contains any combination
-      of: the album, the artist, the genre, the radio channel, or the title. This extra is
-      always provided for backward compatibility: existing apps that do not know about search
-      modes can process this intent as an unstructured search.</li>
-</ul>
-</dd>
 <dt><p><em>Playlist</em> - {@link android.provider.MediaStore.Audio.Playlists#ENTRY_CONTENT_TYPE Audio.Playlists.ENTRY_CONTENT_TYPE}</p></dt>
 <dd>
 <p>Play a particular playlist or a playlist that matches some criteria specified
@@ -1444,13 +1426,13 @@
 
 
 <p><b>Example intent:</b></p>
-<p>If the user wants to listen to a radio station that plays songs from a particular artist,
-a search app may generate the following intent:</p>
+<p>If the user wants to listen to music from a particular artist, a search app may generate the
+following intent:</p>
 <pre>
-public void playSearchRadioByArtist(String artist) {
+public void playSearchArtist(String artist) {
     Intent intent = new Intent(MediaStore.INTENT_ACTION_MEDIA_PLAY_FROM_SEARCH);
     intent.putExtra(MediaStore.EXTRA_MEDIA_FOCUS,
-                    "vnd.android.cursor.item/radio");
+                    MediaStore.Audio.Artists.ENTRY_CONTENT_TYPE);
     intent.putExtra(MediaStore.EXTRA_MEDIA_ARTIST, artist);
     intent.putExtra(SearchManager.QUERY, artist);
     if (intent.resolveActivity(getPackageManager()) != null) {
@@ -1488,7 +1470,6 @@
         String artist = intent.getStringExtra(MediaStore.EXTRA_MEDIA_ARTIST);
         String genre = intent.getStringExtra("android.intent.extra.genre");
         String playlist = intent.getStringExtra("android.intent.extra.playlist");
-        String rchannel = intent.getStringExtra("android.intent.extra.radio_channel");
         String title = intent.getStringExtra(MediaStore.EXTRA_MEDIA_TITLE);
 
         // Determine the search mode and use the corresponding extras
@@ -1521,10 +1502,6 @@
             // 'Song' search mode
             playSong(album, artist, genre, title);
 
-        } else if (mediaFocus.compareTo("vnd.android.cursor.item/radio") == 0) {
-            // 'Radio channel' search mode
-            playRadioChannel(album, artist, genre, rchannel, title);
-
         } else if (mediaFocus.compareTo(MediaStore.Audio.Playlists.ENTRY_CONTENT_TYPE) == 0) {
             // 'Playlist' search mode
             playPlaylist(album, artist, genre, playlist, title);
@@ -1701,7 +1678,7 @@
 <p><b>Example intent:</b></p>
 <pre>
 public void composeMmsMessage(String message, Uri attachment) {
-    Intent intent = new Intent(Intent.ACTION_SEND);
+    Intent intent = new Intent(Intent.ACTION_SENDTO);
     intent.setType(HTTP.PLAIN_TEXT_TYPE);
     intent.putExtra("sms_body", message);
     intent.putExtra(Intent.EXTRA_STREAM, attachment);
diff --git a/docs/html/guide/practices/screens_support.jd b/docs/html/guide/practices/screens_support.jd
index dbe6c1a..7ebda53 100644
--- a/docs/html/guide/practices/screens_support.jd
+++ b/docs/html/guide/practices/screens_support.jd
@@ -111,15 +111,15 @@
   <dd>Actual physical size, measured as the screen's diagonal.
 
   <p>For simplicity, Android groups all actual screen sizes into four generalized sizes: small,
-normal, large, and extra large.</p></dd>
+normal, large, and extra-large.</p></dd>
 
 <dt><em>Screen density</em></dt>
   <dd>The quantity of pixels within a physical area of the screen; usually referred to as dpi (dots
 per inch). For example, a "low" density screen has fewer pixels within a given physical area,
 compared to a "normal" or "high" density screen.</p>
 
-  <p>For simplicity, Android groups all actual screen densities into four generalized densities:
-low, medium, high, and extra high.</p></dd>
+  <p>For simplicity, Android groups all actual screen densities into six generalized densities:
+low, medium, high, extra-high, extra-extra-high, and extra-extra-extra-high.</p></dd>
 
 <dt><em>Orientation</em></dt>
   <dd>The orientation of the screen from the user's point of view. This is either landscape or
@@ -168,9 +168,15 @@
 href="#DeclaringTabletLayouts">Declaring Tablet Layouts for Android 3.2</a> for more
 information.</p>
 </li>
-<li>A set of four generalized <strong>densities</strong>: <em>ldpi</em> (low), <em>mdpi</em>
-(medium),
-<em>hdpi</em> (high), and <em>xhdpi</em> (extra high)
+<li>A set of six generalized <strong>densities</strong>:
+  <ul>
+    <li><em>ldpi</em> (low) ~120dpi</li>
+    <li><em>mdpi</em> (medium) ~160dpi</li>
+    <li><em>hdpi</em> (high) ~240dpi</li>
+    <li><em>xhdpi</em> (extra-high) ~320dpi</li>
+    <li><em>xxhdpi</em> (extra-extra-high) ~480dpi</li>
+    <li><em>xxxhdpi</em> (extra-extra-extra-high) ~640dpi</li>
+  </ul>
 </li>
 </ul>
 
@@ -243,14 +249,14 @@
 densities.</p>
 
 <p>Maintaining density independence is important because, without it, a UI element (such as a
-button) appears physically larger on a low density screen and smaller on a high density screen. Such
+button) appears physically larger on a low-density screen and smaller on a high-density screen. Such
 density-related size changes can cause problems in your application layout and usability. Figures 2
 and 3 show the difference between an application when it does not provide density independence and
 when it does, respectively.</p>
 
 <img src="{@docRoot}images/screens_support/density-test-bad.png" alt=""  />
 <p class="img-caption"><strong>Figure 2.</strong> Example application without support for
-different densities, as shown on low, medium, and high density screens.</p>
+different densities, as shown on low, medium, and high-density screens.</p>
 
 <img src="{@docRoot}images/screens_support/density-test-good.png" alt="" />
 <p class="img-caption"><strong>Figure 3.</strong> Example application with good support for
@@ -266,8 +272,8 @@
 </ul>
 
 <p>In figure 2, the text view and bitmap drawable have dimensions specified in pixels ({@code px}
-units), so the views are physically larger on a low density screen and smaller on a high density
-screen. This is because although the actual screen sizes may be the same, the high density screen
+units), so the views are physically larger on a low-density screen and smaller on a high-density
+screen. This is because although the actual screen sizes may be the same, the high-density screen
 has more pixels per inch (the same amount of pixels fit in a smaller area). In figure 3, the layout
 dimensions are specified in density-independent pixels ({@code dp} units). Because the baseline for
 density-independent pixels is a medium-density screen, the device with a medium-density screen looks
@@ -311,7 +317,7 @@
 <a href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
 &lt;supports-screens&gt;}</a> element in your manifest file.</p>
   </li>
-  
+
   <li><strong>Provide different layouts for different screen sizes</strong>
     <p>By default, Android resizes your application layout to fit the current device screen. In most
 cases, this works fine. In other cases, your UI might not look as good and might need adjustments
@@ -320,7 +326,7 @@
 you might need to adjust sizes so that everything can fit on the screen.</p>
     <p>The configuration qualifiers you can use to provide size-specific resources are
 <code>small</code>, <code>normal</code>, <code>large</code>, and <code>xlarge</code>. For
-example, layouts for an extra large screen should go in {@code layout-xlarge/}.</p>
+example, layouts for an extra-large screen should go in {@code layout-xlarge/}.</p>
     <p>Beginning with Android 3.2 (API level 13), the above size groups are deprecated and you
 should instead use the {@code sw&lt;N&gt;dp} configuration qualifier to define the smallest
 available width required by your layout resources. For example, if your multi-pane tablet layout
@@ -328,7 +334,7 @@
 new techniques for declaring layout resources is discussed further in the section about <a
 href="#DeclaringTabletLayouts">Declaring Tablet Layouts for Android 3.2</a>.</p>
   </li>
-  
+
   <li><strong>Provide different bitmap drawables for different screen densities</strong>
     <p>By default, Android scales your bitmap drawables ({@code .png}, {@code .jpg}, and {@code
 .gif} files) and Nine-Patch drawables ({@code .9.png} files) so that they render at the appropriate
@@ -337,10 +343,22 @@
 screen, and scales them down when on a low-density screen. This scaling can cause artifacts in the
 bitmaps. To ensure your bitmaps look their best, you should include alternative versions at
 different resolutions for different screen densities.</p>
-    <p>The configuration qualifiers you can use for density-specific resources are
-<code>ldpi</code> (low), <code>mdpi</code> (medium), <code>hdpi</code> (high), and
-<code>xhdpi</code> (extra high). For example, bitmaps for high-density screens should go in
-{@code drawable-hdpi/}.</p>
+    <p>The <a href="#qualifiers">configuration qualifiers</a> (described in detail below) that you
+can use for density-specific resources are <code>ldpi</code> (low), <code>mdpi</code> (medium),
+<code>hdpi</code> (high), <code>xhdpi</code> extra-high), <code>xxhdpi</code>
+(extra-extra-high), and <code>xxxhdpi</code> (extra-extra-extra-high). For example, bitmaps
+for high-density screens should go in {@code drawable-hdpi/}.</p>
+    <p class="note" id="xxxhdpi-note"><strong>Note:</strong>  the <code>drawable-xxxhdpi</code>
+qualifier is necessary only to provide a launcher icon that can appear larger than usual on an
+xxhdpi device. You do not need to provide xxxhdpi assets for all your app's images.</p>
+    <p>Some devices scale-up the launcher icon by as much as 25%. For example, if your highest
+density launcher icon image is already extra-extra-high-density, the scaling process will make it
+appear less crisp. So you should provide a higher density launcher icon in the
+<code>drawable-xxxhdpi</code> directory, which the system uses instead of scaling up a smaller
+version of the icon.</p>
+    <p>See <a href="{@docRoot}design/style/iconography.html#xxxhdpi-launcher">Provide an
+xxx-high-density launcher icon</a> for more information. You should not use the
+<code>xxxhdpi</code> qualifier for UI elements other than the launcher icon.</p>
   </li>
 </ul>
 
@@ -371,14 +389,14 @@
   <p>The "default" resources are those that are not tagged with a configuration qualifier. For
 example, the resources in {@code drawable/} are the default drawable resources. The system
 assumes that default resources are designed for the baseline screen size and density, which is a
-normal screen size and a medium density. As such, the system scales default density
+normal screen size and a medium-density. As such, the system scales default density
 resources up for high-density screens and down for low-density screens, as appropriate.</p>
   <p>However, when the system is looking for a density-specific resource and does not find it in
 the density-specific directory, it won't always use the default resources. The system may
 instead use one of the other density-specific resources in order to provide better results
 when scaling. For example, when looking for a low-density resource and it is not available, the
 system prefers to scale-down the high-density version of the resource, because the
-system can easily scale a high-density resource down to low-density by a factor of 0.5, with 
+system can easily scale a high-density resource down to low-density by a factor of 0.5, with
 fewer artifacts, compared to scaling a medium-density resource by a factor of 0.75.</p>
 </li>
 </ol>
@@ -416,9 +434,9 @@
 files must be named exactly the same as the default resource files.</li>
 </ol>
 
-<p>For example, {@code xlarge} is a configuration qualifier for extra large screens. When you append
+<p>For example, {@code xlarge} is a configuration qualifier for extra-large screens. When you append
 this string to a resource directory name (such as {@code layout-xlarge}), it indicates to the
-system that these resources are to be used on devices that have an extra large screen.</p>
+system that these resources are to be used on devices that have an extra-large screen.</p>
 
 <p class="table-caption"><strong>Table 1.</strong> Configuration qualifiers that allow you to
 provide special resources for different screen configurations.</p>
@@ -445,11 +463,11 @@
 </tr>
 <tr>
 <td><code>xlarge</code></td>
-<td>Resources for <em>extra large</em> size screens.</td>
+<td>Resources for <em>extra-large</em> size screens.</td>
 </tr>
 
 <tr>
-<td rowspan="6">Density</td>
+<td rowspan="8">Density</td>
 <td><code>ldpi</code></td>
 <td>Resources for low-density (<em>ldpi</em>) screens (~120dpi).</td>
 </tr>
@@ -464,7 +482,14 @@
 </tr>
 <tr>
 <td><code>xhdpi</code></td>
-<td>Resources for extra high-density (<em>xhdpi</em>) screens (~320dpi).</td>
+<td>Resources for extra-high-density (<em>xhdpi</em>) screens (~320dpi).</td>
+</tr>
+<td><code>xxhdpi</code></td>
+<td>Resources for extra-extra-high-density (<em>xxhdpi</em>) screens (~480dpi).</td>
+</tr>
+<td><code>xxxhdpi</code></td>
+<td>Resources for extra-extra-extra-high-density (<em>xxxhdpi</em>) uses (~640dpi). Use this for the
+  launcher icon only, see <a href="#xxxhdpi-note">note</a> above.</td>
 </tr>
 <tr>
 <td><code>nodpi</code></td>
@@ -515,18 +540,18 @@
 
 <p>For example, the following is a list of resource directories in an application that
 provides different layout designs for different screen sizes and different bitmap drawables
-for medium, high, and extra high density screens.</p>
+for medium, high, and extra-high-density screens.</p>
 
 <pre class="classic">
-res/layout/my_layout.xml             // layout for normal screen size ("default")
-res/layout-small/my_layout.xml       // layout for small screen size
-res/layout-large/my_layout.xml       // layout for large screen size
-res/layout-xlarge/my_layout.xml      // layout for extra large screen size
-res/layout-xlarge-land/my_layout.xml // layout for extra large in landscape orientation
+res/layout/my_layout.xml              // layout for normal screen size ("default")
+res/layout-large/my_layout.xml        // layout for large screen size
+res/layout-xlarge/my_layout.xml       // layout for extra-large screen size
+res/layout-xlarge-land/my_layout.xml  // layout for extra-large in landscape orientation
 
-res/drawable-mdpi/my_icon.png        // bitmap for medium density
-res/drawable-hdpi/my_icon.png        // bitmap for high density
-res/drawable-xhdpi/my_icon.png       // bitmap for extra high density
+res/drawable-mdpi/my_icon.png         // bitmap for medium-density
+res/drawable-hdpi/my_icon.png         // bitmap for high-density
+res/drawable-xhdpi/my_icon.png        // bitmap for extra-high-density
+res/drawable-xxhdpi/my_icon.png       // bitmap for extra-extra-high-density
 </pre>
 
 <p>For more information about how to use alternative resources and a complete list of
@@ -575,10 +600,10 @@
 screen. For example, a row of buttons might not fit within the width of the screen on a small screen
 device. In this case you should provide an alternative layout for small screens that adjusts the
 size or position of the buttons.</li>
-  <li>When testing on an extra large screen, you might realize that your layout doesn't make
+  <li>When testing on an extra-large screen, you might realize that your layout doesn't make
 efficient use of the big screen and is obviously stretched to fill it.
-In this case, you should provide an alternative layout for extra large screens that provides a
-redesigned UI that is optimized for bigger screens such as tablets. 
+In this case, you should provide an alternative layout for extra-large screens that provides a
+redesigned UI that is optimized for bigger screens such as tablets.
     <p>Although your application should work fine without an alternative layout on big screens, it's
 quite important to users that your application looks as though it's designed specifically for their
 devices. If the UI is obviously stretched, users are more likely to be unsatisfied with the
@@ -598,7 +623,7 @@
 <p>If your UI uses bitmaps that need to fit the size of a view even after the system scales
 the layout (such as the background image for a button), you should use <a
 href="{@docRoot}guide/topics/graphics/2d-graphics.html#nine-patch">Nine-Patch</a> bitmap files. A
-Nine-Patch file is basically a PNG file in which you specific two-dimensional regions that are
+Nine-Patch file is basically a PNG file in which you specify two-dimensional regions that are
 stretchable. When the system needs to scale the view in which the bitmap is used, the system
 stretches the Nine-Patch bitmap, but stretches only the specified regions. As such, you don't
 need to provide different drawables for different screen sizes, because the Nine-Patch bitmap can
@@ -621,21 +646,24 @@
 each one, for different densities.</p>
 
 <p class="note"><strong>Note:</strong> You only need to provide density-specific drawables for
-bitmap files ({@code .png}, {@code .jpg}, or {@code .gif}) and Nine-Path files ({@code
+bitmap files ({@code .png}, {@code .jpg}, or {@code .gif}) and Nine-Patch files ({@code
 .9.png}). If you use XML files to define shapes, colors, or other <a
 href="{@docRoot}guide/topics/resources/drawable-resource.html">drawable resources</a>, you should
 put one copy in the default drawable directory ({@code drawable/}).</p>
 
 <p>To create alternative bitmap drawables for different densities, you should follow the
-<b>3:4:6:8 scaling ratio</b> between the four generalized densities. For example, if you have
-a bitmap drawable that's 48x48 pixels for medium-density screen (the size for a launcher icon),
-all the different sizes should be:</p>
+<b>3:4:6:8:12:16 scaling ratio</b> between the six generalized densities. For example, if you have
+a bitmap drawable that's 48x48 pixels for medium-density screens, all the different sizes should be:
+</p>
 
 <ul>
-  <li>36x36 for low-density</li>
-  <li>48x48 for medium-density</li>
-  <li>72x72 for high-density</li>
-  <li>96x96 for extra high-density</li>
+  <li>36x36 (0.75x) for low-density</li>
+  <li>48x48 (1.0x baseline) for medium-density</li>
+  <li>72x72 (1.5x) for high-density</li>
+  <li>96x96 (2.0x) for extra-high-density</li>
+  <li>180x180 (3.0x) for extra-extra-high-density</li>
+  <li>192x192 (4.0x) for extra-extra-extra-high-density (launcher icon only; see
+    <a href="#xxxhdpi-note">note</a> above)</li>
 </ul>
 
 <p>For more information about designing icons, see the <a
@@ -715,7 +743,7 @@
 screen area. Specifically, the device's smallestWidth is the shortest of the screen's available
 height and width (you may also think of it as the "smallest possible width" for the screen). You can
 use this qualifier to ensure that, regardless of the screen's current orientation, your
-application's has at least {@code &lt;N&gt;} dps of width available for it UI.</p>
+application's has at least {@code &lt;N&gt;} dps of width available for its UI.</p>
         <p>For example, if your layout requires that its smallest dimension of screen area be at
 least 600 dp at all times, then you can use this qualifer to create the layout resources, {@code
 res/layout-sw600dp/}. The system will use these resources only when the smallest dimension of
@@ -1011,8 +1039,8 @@
 <p>If you need to control exactly how your application will look on various
 screen configurations, adjust your layouts and bitmap drawables in configuration-specific
 resource directories. For example, consider an icon that you want to display on
-medium and high density screens. Simply create your icon at two different sizes
-(for instance 100x100 for medium density and 150x150 for high density) and put
+medium and high-density screens. Simply create your icon at two different sizes
+(for instance 100x100 for medium-density and 150x150 for high-density) and put
 the two variations in the appropriate directories, using the proper
 qualifiers:</p>
 
@@ -1115,9 +1143,7 @@
 <div class="figure" style="width:300px">
 <img src="{@docRoot}images/screens_support/scale-test.png" alt="" />
 <p class="img-caption"><strong>Figure 5.</strong> Comparison of pre-scaled and auto-scaled
-bitmaps, from <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/DensityActivity.html">
-ApiDemos</a>.
+bitmaps.
 </p>
 </div>
 
@@ -1153,10 +1179,7 @@
 (120), medium (160) and high (240) density bitmaps on a high-density screen. The differences are
 subtle, because all of the bitmaps are being scaled to match the current screen density, however the
 scaled bitmaps have slightly different appearances depending on whether they are pre-scaled or
-auto-scaled at draw time. You can find the source code for this sample application, which
-demonstrates using pre-scaled and auto-scaled bitmaps, in <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/graphics/DensityActivity.html">
-ApiDemos</a>.</p>
+auto-scaled at draw time.</p>
 
 <p class="note"><strong>Note:</strong> In Android 3.0 and above, there should be no perceivable
 difference between pre-scaled and auto-scaled bitmaps, due to improvements in the graphics
@@ -1172,9 +1195,9 @@
 pixels. Imagine an application in which a scroll or fling gesture is recognized after the user's
 finger has moved by at least 16 pixels. On a baseline screen, a user's must move by {@code 16 pixels
 / 160 dpi}, which equals 1/10th of an inch (or 2.5 mm) before the gesture is recognized. On a device
-with a high density display (240dpi), the user's must move by {@code 16 pixels / 240 dpi}, which
+with a high-density display (240dpi), the user's must move by {@code 16 pixels / 240 dpi}, which
 equals 1/15th of an inch (or 1.7 mm). The distance is much shorter and the application thus appears
-more sensitive to the user.</p> 
+more sensitive to the user.</p>
 
 <p>To fix this issue, the gesture threshold must be expressed in code in <code>dp</code> and then
 converted to actual pixels. For example:</p>
@@ -1194,7 +1217,7 @@
 <p>The {@link android.util.DisplayMetrics#density DisplayMetrics.density} field specifies the scale
 factor you must use to convert {@code dp} units to pixels, according to the current screen density.
 On a medium-density screen, {@link android.util.DisplayMetrics#density DisplayMetrics.density}
-equals 1.0; on a high-density screen it equals 1.5; on an extra high-density screen, it equals 2.0;
+equals 1.0; on a high-density screen it equals 1.5; on an extra-high-density screen, it equals 2.0;
 and on a low-density screen, it equals 0.75. This figure is the factor by which you should multiply
 the {@code dp} units on order to get the actual pixel count for the current screen. (Then add {@code
 0.5f} to round the figure up to the nearest whole number, when converting to an integer.) For more
@@ -1277,7 +1300,7 @@
         <nobr>High density (240), <em>hdpi</em><nobr>
       </th>
       <th>
-        <nobr>Extra high density (320), <em>xhdpi</em><nobr>
+        <nobr>Extra-high-density (320), <em>xhdpi</em><nobr>
       </th>
     </tr>
     <tr>
@@ -1315,7 +1338,7 @@
     </tr>
     <tr>
       <th>
-        <em>Extra Large</em> screen
+        <em>Extra-Large</em> screen
       </th>
       <td>1024x600</td>
       <td><strong>WXGA (1280x800)</strong><sup>&dagger;</sup><br>
@@ -1369,4 +1392,4 @@
 
 <p>For more information about creating AVDs from the command line, see <a
 href="{@docRoot}tools/devices/managing-avds-cmdline.html">Managing AVDs from the
-Command Line</a></p>
+Command Line</a>.</p>
\ No newline at end of file
diff --git a/docs/html/guide/topics/admin/device-admin.jd b/docs/html/guide/topics/admin/device-admin.jd
index a474498..2d02e51 100644
--- a/docs/html/guide/topics/admin/device-admin.jd
+++ b/docs/html/guide/topics/admin/device-admin.jd
@@ -28,12 +28,6 @@
       <li>{@link android.app.admin.DevicePolicyManager}</li>
       <li>{@link android.app.admin.DeviceAdminInfo}</li>
     </ol>
-    <h2>Related samples</h2>
-    <ol>
-      <li><a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/DeviceAdminSample.html">
-DeviceAdminSample</a></li>
-</ol>
 </div>
 </div>
 
@@ -232,18 +226,12 @@
 
 <h2 id="sample">Sample Application</h2>
 
-<p>The examples used in this document are based on the <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/DeviceAdminSample.html">
-Device Administration API
-sample</a>, which is included in the SDK samples. For information on downloading and
-installing the SDK samples, see <a
-href="{@docRoot}resources/samples/get.html">
-Getting the Samples</a>. Here is the  <a
-href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/DeviceAdminSample.html">
-complete code</a> for
-the sample. </p>
-<p>The
-sample application offers a demo of device admin features. It presents users
+<p>The examples used in this document are based on the Device Administration API
+sample, which is included in the SDK samples (available through the
+Android SDK Manager) and located on your system as 
+<code>&lt;sdk_root&gt;/ApiDemos/app/src/main/java/com/example/android/apis/app/DeviceAdminSample.java</code>.</p>
+
+<p>The sample application offers a demo of device admin features. It presents users
 with a user interface that lets them enable the device admin application. Once
 they've enabled the application, they can use the buttons in the user interface
 to do the following:</p>
@@ -676,7 +664,8 @@
 <p>You can also programmatically tell the device to lock immediately:</p>
 <pre>
 DevicePolicyManager mDPM;
-mDPM.lockNow();</pre>
+mDPM.lockNow();
+</pre>
 
 
 
@@ -692,12 +681,12 @@
 <pre>
 DevicePolicyManager mDPM;
 mDPM.wipeData(0);</pre>
-<p>The {@link android.app.admin.DevicePolicyManager#wipeData wipeData()} method takes as its parameter a bit mask of
-additional options. Currently the value must be 0. </p>
+<p>The {@link android.app.admin.DevicePolicyManager#wipeData wipeData()} method takes as its
+  parameter a bit mask of additional options. Currently the value must be 0. </p>
 
 <h4>Disable camera</h4>
 <p>Beginning with Android 4.0, you can disable the camera. Note that this doesn't have to be a permanent disabling. The camera can be enabled/disabled dynamically based on context, time, and so on. </p>
-<p>You control whether the camera is disabled by using the 
+<p>You control whether the camera is disabled by using the
 {@link android.app.admin.DevicePolicyManager#setCameraDisabled(android.content.ComponentName, boolean) setCameraDisabled()} method. For example, this snippet sets the camera to be enabled or disabled based on a checkbox setting:</p>
 
 <pre>private CheckBoxPreference mDisableCameraCheckbox;
@@ -708,8 +697,8 @@
 </pre>
 
 
-<h4 id=storage">Storage encryption</h4>
-<p>Beginning with Android 3.0, you can use the 
+<h4 id="storage">Storage encryption</h4>
+<p>Beginning with Android 3.0, you can use the
 {@link android.app.admin.DevicePolicyManager#setStorageEncryption(android.content.ComponentName,boolean) setStorageEncryption()} 
 method to set a policy requiring encryption of the storage area, where supported.</p>
 
@@ -722,5 +711,5 @@
 mDPM.setStorageEncryption(mDeviceAdminSample, true);
 </pre>
 <p>
-See the <a href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/app/DeviceAdminSample.html"> Device Administration API sample</a> for a complete
-example of how to enable storage encryption.</p>
+See the Device Administration API sample for a complete example of how to enable storage encryption.
+</p>
\ No newline at end of file
diff --git a/docs/html/guide/topics/manifest/activity-element.jd b/docs/html/guide/topics/manifest/activity-element.jd
index a8d7615..3c623f6 100644
--- a/docs/html/guide/topics/manifest/activity-element.jd
+++ b/docs/html/guide/topics/manifest/activity-element.jd
@@ -453,7 +453,7 @@
 created to handle a new intent.  However, if the target task already has an
 existing instance of the activity at the top of its stack, that instance
 will receive the new intent (in an
-<code>{@link android.app.Activity#onNewIntent onNewIntent()}</code> call);
+{@link android.app.Activity#onNewIntent onNewIntent()} call);
 a new instance is not created.
 In other circumstances &mdash; for example, if an existing instance of the
 "{@code singleTop}" activity is in the target task, but not at the top of
@@ -461,6 +461,22 @@
 &mdash; a new instance would be created and pushed on the stack.
 </p>
 
+<p>Similarly, if you
+<a href="{@docRoot}training/implementing-navigation/ancestral.html">navigate
+up</a> to an activity on the current stack, the behavior is determined by the
+parent activity's launch mode. If the parent activity has launch mode {@code
+singleTop} (or the <code>up</code> intent contains {@link
+android.content.Intent#FLAG_ACTIVITY_CLEAR_TOP}), the parent is brought to the
+top of the stack, and its state is preserved. The navigation intent is received
+by the parent activity's {@link android.app.Activity#onNewIntent onNewIntent()}
+method.  If the parent activity has launch mode {@code standard} (and the
+<code>up</code> intent does not contain {@link
+android.content.Intent#FLAG_ACTIVITY_CLEAR_TOP}), the current activity and its
+parent are both popped off the stack, and a new instance of the parent activity
+is created to receive the navigation intent.
+</p>
+
+
 <p>
 The "{@code singleTask}" and "{@code singleInstance}" modes also differ from
 each other in only one respect:  A "{@code singleTask}" activity allows other
diff --git a/docs/html/guide/topics/renderscript/compute.jd b/docs/html/guide/topics/renderscript/compute.jd
index c62510b..100894c 100644
--- a/docs/html/guide/topics/renderscript/compute.jd
+++ b/docs/html/guide/topics/renderscript/compute.jd
@@ -157,8 +157,7 @@
 
 <ul>
   <li><strong>{@link android.renderscript}</strong> - The APIs in this class package are
-    available on devices running Android 3.0 (API level 11) and higher. These are the original APIs
-    for RenderScript and are not currently being updated.</li>
+    available on devices running Android 3.0 (API level 11) and higher. </li>
   <li><strong>{@link android.support.v8.renderscript}</strong> - The APIs in this package are
     available through a <a href="{@docRoot}tools/support-library/features.html#v8">Support
     Library</a>, which allows you to use them on devices running Android 2.2 (API level 8) and
@@ -166,8 +165,8 @@
 </ul>
 
 <p>We strongly recommend using the Support Library APIs for accessing RenderScript because they
-  include the latest improvements to the RenderScript compute framework and provide a wider range
-  of device compatibility.</p>
+  provide a wider range of device compatibility. Developers targeting specific versions of 
+  Android can use {@link android.renderscript} if necessary.</p>
 
 
 <h3 id="ide-setup">Using the RenderScript Support Library APIs</h3>
@@ -308,4 +307,4 @@
 <li><strong>Tear down the RenderScript context.</strong> The RenderScript context can be destroyed
 with {@link android.renderscript.RenderScript#destroy} or by allowing the RenderScript context
 object to be garbage collected. This will cause any further use of any object belonging to that
-context to throw an exception.</li> </ol>
\ No newline at end of file
+context to throw an exception.</li> </ol>
diff --git a/docs/html/guide/topics/resources/localization.jd b/docs/html/guide/topics/resources/localization.jd
index e86d4c9..1ee6606 100644
--- a/docs/html/guide/topics/resources/localization.jd
+++ b/docs/html/guide/topics/resources/localization.jd
@@ -402,8 +402,7 @@
 	resolution and density of the device screen may differ, which could affect 

 	the display of strings and drawables in your UI.</p>

 

-<p>To change the locale on a device, use  the Settings application  (Home &gt;

-Menu &gt; Settings &gt; Locale &amp; text &gt; Select locale). </p>

+<p>To change the locale or language on a device, use the Settings application.</p>

 

 <h3 id="emulator">Testing on an Emulator</h3>

 

diff --git a/docs/html/guide/topics/resources/providing-resources.jd b/docs/html/guide/topics/resources/providing-resources.jd
index bf16630..6d9527f 100644
--- a/docs/html/guide/topics/resources/providing-resources.jd
+++ b/docs/html/guide/topics/resources/providing-resources.jd
@@ -389,7 +389,7 @@
             <ul>
               <li>240x320 ldpi (QVGA handset)</li>
               <li>320x480 mdpi (handset)</li>
-              <li>480x800 hdpi (high density handset)</li>
+              <li>480x800 hdpi (high-density handset)</li>
             </ul>
           </li>
           <li>480, for screens such as 480x800 mdpi (tablet/handset).</li>
@@ -483,20 +483,20 @@
         <ul class="nolist">
         <li>{@code small}: Screens that are of similar size to a
         low-density QVGA screen. The minimum layout size for a small screen
-        is approximately 320x426 dp units.  Examples are QVGA low density and VGA high
+        is approximately 320x426 dp units.  Examples are QVGA low-density and VGA high
         density.</li>
         <li>{@code normal}: Screens that are of similar size to a
         medium-density HVGA screen. The minimum
         layout size for a normal screen is approximately 320x470 dp units.  Examples
-        of such screens a WQVGA low density, HVGA medium density, WVGA
-        high density.</li>
+        of such screens a WQVGA low-density, HVGA medium-density, WVGA
+        high-density.</li>
         <li>{@code large}: Screens that are of similar size to a
         medium-density VGA screen.
         The minimum layout size for a large screen is approximately 480x640 dp units.
-        Examples are VGA and WVGA medium density screens.</li>
+        Examples are VGA and WVGA medium-density screens.</li>
         <li>{@code xlarge}: Screens that are considerably larger than the traditional
         medium-density HVGA screen. The minimum layout size for an xlarge screen
-        is approximately 720x960 dp units.  In most cases, devices with extra large
+        is approximately 720x960 dp units.  In most cases, devices with extra-large
         screens would be too large to carry in a pocket and would most likely
         be tablet-style devices. <em>Added in API level 9.</em></li>
         </ul>
@@ -613,6 +613,8 @@
         <code>mdpi</code><br/>
         <code>hdpi</code><br/>
         <code>xhdpi</code><br/>
+        <code>xxhdpi</code><br/>
+        <code>xxxhdpi</code><br/>
         <code>nodpi</code><br/>
         <code>tvdpi</code>
       </td>
@@ -622,8 +624,14 @@
           <li>{@code mdpi}: Medium-density (on traditional HVGA) screens; approximately
 160dpi.</li>
           <li>{@code hdpi}: High-density screens; approximately 240dpi.</li>
-          <li>{@code xhdpi}: Extra high-density screens; approximately 320dpi. <em>Added in API
+          <li>{@code xhdpi}: Extra-high-density screens; approximately 320dpi. <em>Added in API
 Level 8</em></li>
+          <li>{@code xxhdpi}: Extra-extra-high-density screens; approximately 480dpi. <em>Added in API
+Level 16</em></li>
+          <li>{@code xxxhdpi}: Extra-extra-extra-high-density uses (launcher icon only, see the 
+            <a href="{@docRoot}guide/practices/screens_support.html#xxxhdpi-note">note</a> 
+            in <em>Supporting Multiple Screens</em>); approximately 640dpi. <em>Added in API
+Level 18</em></li>
           <li>{@code nodpi}: This can be used for bitmap resources that you do not want to be scaled
 to match the device density.</li>
           <li>{@code tvdpi}: Screens somewhere between mdpi and hdpi; approximately 213dpi. This is
@@ -631,8 +639,9 @@
 apps shouldn't need it&mdash;providing mdpi and hdpi resources is sufficient for most apps and
 the system will scale them as appropriate. This qualifier was introduced with API level 13.</li>
         </ul>
-        <p>There is a 3:4:6:8 scaling ratio between the four primary densities (ignoring the
-tvdpi density). So, a 9x9 bitmap in ldpi is 12x12 in mdpi, 18x18 in hdpi and 24x24 in xhdpi.</p>
+        <p>There is a 3:4:6:8:12:16 scaling ratio between the six primary densities (ignoring the
+tvdpi density). So, a 9x9 bitmap in ldpi is 12x12 in mdpi, 18x18 in hdpi, 24x24 in xhdpi and so on.
+</p>
         <p>If you decide that your image resources don't look good enough on a television or
 other certain devices and want to try tvdpi resources, the scaling factor is 1.33*mdpi. For
 example, a 100px x 100px image for mdpi screens should be 133px x 133px for tvdpi.</p>
diff --git a/docs/html/guide/topics/text/creating-input-method.jd b/docs/html/guide/topics/text/creating-input-method.jd
index 7254594..8b75cc8 100644
--- a/docs/html/guide/topics/text/creating-input-method.jd
+++ b/docs/html/guide/topics/text/creating-input-method.jd
@@ -4,6 +4,30 @@
 
 <div id="qv-wrapper">
 <div id="qv">
+<h2>In This Document</h2>
+<ol>
+    <li>
+        <a href="#InputMethodLifecycle">The IME Lifecycle</a>
+    </li>
+    <li>
+        <a href="#DefiningIME">Declaring IME Components in the Manifest</a>
+    </li>
+    <li>
+        <a href="#IMEAPI">The Input Method API</a>
+    </li>
+    <li>
+        <a href="#IMEUI">Designing the Input Method UI</a>
+    </li>
+    <li>
+        <a href="#SendText">Sending Text to the Application</a>
+    </li>
+    <li>
+        <a href="#IMESubTypes">Creating an IME Subtype</a>
+    </li>
+    <li>
+        <a href="#GeneralDesign">General IME Considerations</a>
+    </li>
+</ol>
 <h2>See also</h2>
 <ol>
     <li>
@@ -16,29 +40,20 @@
 </div>
 </div>
 <p>
-    An input method editor (IME) is a user control that enables users to enter text. Android 
-    provides an extensible input method framework that allows applications to provide users 
-    alternative input methods, such as on-screen keyboards or even speech input. Once installed, 
-    users can select which IME they want to use from the system settings and use it across the 
+    An input method editor (IME) is a user control that enables users to enter text. Android
+    provides an extensible input method framework that allows applications to provide users
+    alternative input methods, such as on-screen keyboards or even speech input. Once installed,
+    users can select which IME they want to use from the system settings and use it across the
     entire system; only one IME may be enabled at a time.
 </p>
 <p>
     To add an IME to the Android system, you create an Android application
-    containing a class that extends {@link android.inputmethodservice.InputMethodService}. In 
+    containing a class that extends {@link android.inputmethodservice.InputMethodService}. In
     addition, you usually create a "settings" activity that passes options to the IME
     service. You can also define a settings UI that's displayed as part of the system settings.
 </p>
-<p>This article covers the following:</p>
-<ul>
-    <li>The IME lifecycle.</li>
-    <li>Declaring IME components in the application manifest.</li>
-    <li>The IME API.</li>
-    <li>Designing an IME UI.</li>
-    <li>Sending text from an IME to an application.</li>
-    <li>Working with IME subtypes.</li>
-</ul>
 <p>
-    If you haven't worked with IMEs before, you should read the introductory article 
+    If you haven't worked with IMEs before, you should read the introductory article
     <a href="http://android-developers.blogspot.com/2009/04/updating-applications-for-on-screen.html">Onscreen Input Methods</a> first.
     Also, the Soft Keyboard sample app included in the SDK contains sample code that you can modify
     to start building your own IME.
@@ -59,16 +74,16 @@
 <h2 id="DefiningIME">Declaring IME Components in the Manifest</h2>
 <p>
     In the Android system, an IME is an Android application that contains a special IME service.
-    The application's manifest file must declare the service, request the necessary permissions, 
-    provide an intent filter that matches the action <code>action.view.InputMethod</code>, and 
+    The application's manifest file must declare the service, request the necessary permissions,
+    provide an intent filter that matches the action <code>action.view.InputMethod</code>, and
     provide metadata that defines characteristics of the IME. In addition, to provide a settings
     interface that allows the user to modify the behavior of the IME, you can define a "settings"
     activity that can be launched from System Settings.
 </p>
 <p>
     The following snippet declares IME service. It requests the permission {@link
-    android.Manifest.permission#BIND_INPUT_METHOD} to allow the service to connect the IME to 
-    the system, sets up an intent filter that matches the action 
+    android.Manifest.permission#BIND_INPUT_METHOD} to allow the service to connect the IME to
+    the system, sets up an intent filter that matches the action
     <code>android.view.InputMethod</code>, and defines metadata for the IME:
 </p>
 <pre>
@@ -88,7 +103,7 @@
     for the IME application:</p>
 <pre>
     &lt;!-- Optional: an activity for controlling the IME settings --&gt;
-    &lt;activity android:name="FastInputIMESettings" 
+    &lt;activity android:name="FastInputIMESettings"
         android:label="&#64;string/fast_input_settings"&gt;
         &lt;intent-filter&gt;
             &lt;action android:name="android.intent.action.MAIN"/&gt;
@@ -105,12 +120,12 @@
     handling keyboard characters.
 </p>
 <p>
-    The central part of an IME is a service component, a class that extends 
-    {@link android.inputmethodservice.InputMethodService}. In addition to implementing the 
-    normal service lifecycle, this class has callbacks for providing your IME's UI, handling user 
+    The central part of an IME is a service component, a class that extends
+    {@link android.inputmethodservice.InputMethodService}. In addition to implementing the
+    normal service lifecycle, this class has callbacks for providing your IME's UI, handling user
     input, and delivering text to the field that currently has focus. By default, the
-    {@link android.inputmethodservice.InputMethodService} class provides most of the implementation 
-    for managing the state and visibility of the IME and communicating with the current 
+    {@link android.inputmethodservice.InputMethodService} class provides most of the implementation
+    for managing the state and visibility of the IME and communicating with the current
     input field.
 </p>
 <p>
@@ -122,13 +137,13 @@
         Defines the communication channel from an {@link android.view.inputmethod.InputMethod}
         back to the application that is receiving its input. You use it to read text around the
         cursor, commit text to the text box, and send raw key events to the application.
-        Applications should extend this class rather than implementing the base interface 
+        Applications should extend this class rather than implementing the base interface
         {@link android.view.inputmethod.InputConnection}.
     </dd>
     <dt>{@link android.inputmethodservice.KeyboardView}</dt>
     <dd>
         An extension of {@link android.view.View} that renders a keyboard and responds to user
-        input events. The keyboard layout is specified by an instance of 
+        input events. The keyboard layout is specified by an instance of
         {@link android.inputmethodservice.Keyboard}, which you can define in an XML file.
     </dd>
 </dl>
@@ -141,40 +156,40 @@
 <h3 id="InputView">Input view</h3>
 <p>
     The input view is the UI where the user inputs text, in the form of keyclicks, handwriting or
-    gestures. When the iIME is displayed for the first time, the system calls the 
+    gestures. When the iIME is displayed for the first time, the system calls the
     {@link android.inputmethodservice.InputMethodService#onCreateInputView()} callback. In your
     implementation of this method, you create the layout you want to display in the IME
     window and return the layout to the system. This snippet is an example of implementing the
     {@link android.inputmethodservice.InputMethodService#onCreateInputView()} method:
 <pre>
-    &#64;Override 
-    public View onCreateInputView() { 
-        MyKeyboardView inputView = 
+    &#64;Override
+    public View onCreateInputView() {
+        MyKeyboardView inputView =
             (MyKeyboardView) getLayoutInflater().inflate( R.layout.input, null);
-    
-        inputView.setOnKeyboardActionListener(this); inputView.setKeyboard(mLatinKeyboard); 
-        
-        return mInputView; 
-    } 
+
+        inputView.setOnKeyboardActionListener(this); inputView.setKeyboard(mLatinKeyboard);
+
+        return mInputView;
+    }
 </pre>
 <p>
-    In this example, {@code MyKeyboardView} is an instance of a custom implementation of 
-    {@link android.inputmethodservice.KeyboardView} that renders a 
-    {@link android.inputmethodservice.Keyboard}. If you’re building a traditional QWERTY keyboard, 
-    see the  Soft Keyboard <a href="{@docRoot}tools/samples/index.html">sample 
+    In this example, {@code MyKeyboardView} is an instance of a custom implementation of
+    {@link android.inputmethodservice.KeyboardView} that renders a
+    {@link android.inputmethodservice.Keyboard}. If you’re building a traditional QWERTY keyboard,
+    see the  Soft Keyboard <a href="{@docRoot}tools/samples/index.html">sample
     app</a> for an example of how to extend the {@link android.inputmethodservice.KeyboardView} class.
 </p>
 <h3 id="CandidateView">Candidates view</h3>
 <p>
     The candidates view is the UI where the IME displays potential word corrections or
-    suggestions for the user to select. In the IME lifecycle, the system calls 
-    {@link android.inputmethodservice.InputMethodService#onCreateCandidatesView()} when it's ready 
+    suggestions for the user to select. In the IME lifecycle, the system calls
+    {@link android.inputmethodservice.InputMethodService#onCreateCandidatesView()} when it's ready
     to display the candidate view. In your implementation of this method, return a layout that shows
     word suggestions, or return null if you don’t want to show anything (a null response is the
     default behavior, so you don’t have to implement this if you don’t provide suggestions).</p>
 <p>
-    For an example implementation that provides user suggestions, see the 
-    Soft Keyboard <a href="{@docRoot}tools/samples/index.html">sample 
+    For an example implementation that provides user suggestions, see the
+    Soft Keyboard <a href="{@docRoot}tools/samples/index.html">sample
     app</a>.
 </p>
 <h3 id="DesignConsiderations">UI design considerations</h3>
@@ -209,10 +224,10 @@
     <strong>Figure 2.</strong> Latin IME input types.
 </p>
 <p>
-    When an input field receives focus and your IME starts, the system calls 
+    When an input field receives focus and your IME starts, the system calls
     {@link android.inputmethodservice.InputMethodService#onStartInputView(EditorInfo, boolean)
-    onStartInputView()}, passing in an {@link android.view.inputmethod.EditorInfo} object that 
-    contains details about the input type and other attributes of the text field. In this object, 
+    onStartInputView()}, passing in an {@link android.view.inputmethod.EditorInfo} object that
+    contains details about the input type and other attributes of the text field. In this object,
     the {@link android.view.inputmethod.EditorInfo#inputType} field contains the text field's input
     type.
 </p>
@@ -223,7 +238,7 @@
     this:
 </p>
 <pre>
-inputType &amp; InputType.TYPE_MASK_CLASS 
+inputType &amp; InputType.TYPE_MASK_CLASS
 </pre>
 <p>
 The input type bit pattern can have one of several values, including:
@@ -248,7 +263,7 @@
     </dd>
 </dl>
 <p>
-    These constants are described in more detail in the reference documentation for 
+    These constants are described in more detail in the reference documentation for
     {@link android.text.InputType}.
 </p>
 <p>
@@ -287,8 +302,8 @@
 <p>
     As the user inputs text with your IME, you can send text to the application by
     sending individual key events or by editing the text around the cursor in the application's text
-    field. In either case, you use an instance of {@link android.view.inputmethod.InputConnection} 
-    to deliver the text. To get this instance, call 
+    field. In either case, you use an instance of {@link android.view.inputmethod.InputConnection}
+    to deliver the text. To get this instance, call
     {@link android.inputmethodservice.InputMethodService#getCurrentInputConnection
     InputMethodService.getCurrentInputConnection()}.
 </p>
@@ -336,18 +351,18 @@
 </p>
 <pre>
     InputConnection ic = getCurrentInputConnection();
-    
+
     ic.deleteSurroundingText(4, 0);
-    
+
     ic.commitText("Hello", 1);
-    
+
     ic.commitText("!", 1);
 </pre>
 <h3 id="ComposeThenCommit">Composing text before committing</h3>
 <p>
     If your IME does text prediction or requires multiple steps to compose a glyph or
     word, you can show the progress in the text field until the user commits the word, and then you
-    can replace the partial composition with the completed text. You may give special treatment to 
+    can replace the partial composition with the completed text. You may give special treatment to
     the text by adding a "span" to it when you pass it to InputConnection#setComposingText().
 </p>
 <p>
@@ -385,10 +400,10 @@
     selection during composition. You may also want to trap the back key to dismiss any popups
     originating from the input method window.</p>
 <p>
-    To intercept hardware keys, override 
+    To intercept hardware keys, override
     {@link android.inputmethodservice.InputMethodService#onKeyDown(int, KeyEvent) onKeyDown()}
-    and {@link android.inputmethodservice.InputMethodService#onKeyUp(int, KeyEvent) onKeyUp()}. 
-    See the Soft Keyboard <a href="{@docRoot}tools/samples/index.html">sample 
+    and {@link android.inputmethodservice.InputMethodService#onKeyUp(int, KeyEvent) onKeyUp()}.
+    See the Soft Keyboard <a href="{@docRoot}tools/samples/index.html">sample
     app</a> for an example.
 </p>
 <p>
@@ -396,7 +411,7 @@
 </p>
 <h2 id="IMESubTypes">Creating an IME Subtype</h2>
 <p>
-    Subtypes allow the IME to expose multiple input modes and languages supported by an IME. A 
+    Subtypes allow the IME to expose multiple input modes and languages supported by an IME. A
     subtype can represent:
 </p>
 <ul>
@@ -414,13 +429,13 @@
 <p>
     Subtype information is used for an IME switcher dialog that's available from the notification
     bar and also for IME settings. The information also allows the framework to bring up a
-    specific subtype of an IME directly. When you build an IME, use the subtype facility, because 
+    specific subtype of an IME directly. When you build an IME, use the subtype facility, because
     it helps the user identify and switch between different IME languages and modes.
 </p>
 <p>
     You define subtypes in one of the input method's XML resource files, using the
-    <code>&lt;subtype&gt;</code> element. The following snippet defines an IME with two 
-    subtypes: a keyboard subtype for the US English locale, and another keyboard subtype for the 
+    <code>&lt;subtype&gt;</code> element. The following snippet defines an IME with two
+    subtypes: a keyboard subtype for the US English locale, and another keyboard subtype for the
     French language locale for France:
 </p>
 <pre>
@@ -457,8 +472,8 @@
         android:imeSubtypeMode="keyboard" /&gt;
 </pre>
 <p>
-    The next snippet is part of the IME's <code>strings.xml</code> file. The string 
-    resource <code>label_subtype_generic</code>, which is used by the input method UI definition to 
+    The next snippet is part of the IME's <code>strings.xml</code> file. The string
+    resource <code>label_subtype_generic</code>, which is used by the input method UI definition to
     set the subtype's label, is defined as:
 </p>
 <pre>
@@ -487,9 +502,9 @@
 <h3 id="SubtypeSettings">Choosing IME subtypes from System Settings</h3>
 <p>
     A user can control how subtypes are used in the “Language &amp; input” settings panel in the
-    System Settings area. In the Soft Keyboard sample, the file 
-    <code>InputMethodSettingsFragment.java</code> contains an implementation that 
-    facilitates a subtype enabler in the IME settings. Please refer to the SoftKeyboard sample in 
+    System Settings area. In the Soft Keyboard sample, the file
+    <code>InputMethodSettingsFragment.java</code> contains an implementation that
+    facilitates a subtype enabler in the IME settings. Please refer to the SoftKeyboard sample in
     the Android SDK for more information about how to support Input Method Subtypes in your IME.
 </p>
 <img src="{@docRoot}resources/articles/images/inputmethod_subtype_settings.png" alt=""
@@ -497,6 +512,7 @@
 <p class="img-caption">
     <strong>Figure 6.</strong> Choosing a language for the IME.
 </p>
+
 <h2 id="GeneralDesign">General IME Considerations</h2>
 <p>
     Here are some other things to consider as you're implementing your IME:
@@ -506,22 +522,22 @@
     Provide a way for users to set options directly from the IME's UI.
 </li>
 <li>
-    Because multiple IMEs may be installed on the device, provide a way for the user to switch to a 
+    Because multiple IMEs may be installed on the device, provide a way for the user to switch to a
     different IME directly from the input method UI.
 </li>
 <li>
-    Bring up the IME's UI quickly. Preload or load on demand any large resources so that users 
-    see the IME as soon as they tap on a text field. Cache resources and views for subsequent 
+    Bring up the IME's UI quickly. Preload or load on demand any large resources so that users
+    see the IME as soon as they tap on a text field. Cache resources and views for subsequent
     invocations of the input method.
 </li>
 <li>
-    Conversely, you should release large memory allocations soon after the input method window is 
+    Conversely, you should release large memory allocations soon after the input method window is
     hidden, so that applications can have sufficient memory to run. Consider using a delayed message
     to release resources if the IME is in a hidden state for a few seconds.
-</li>    
+</li>
 <li>
-    Make sure that users can enter as many characters as possible for the language or locale 
-    associated with the IME. Remember that users may use punctuation in passwords or user 
+    Make sure that users can enter as many characters as possible for the language or locale
+    associated with the IME. Remember that users may use punctuation in passwords or user
     names, so your IME has to provide many different characters to allow users to enter a
     password and get access to the device.
 </li>
diff --git a/docs/html/guide/topics/ui/accessibility/services.jd b/docs/html/guide/topics/ui/accessibility/services.jd
index c868080..d69af9f 100644
--- a/docs/html/guide/topics/ui/accessibility/services.jd
+++ b/docs/html/guide/topics/ui/accessibility/services.jd
@@ -71,24 +71,30 @@
 
 <h3 id="service-declaration">Accessibility service declaration</h3>
 
-<p>In order to be treated as an accessibility service, your application must include the
+<p>In order to be treated as an accessibility service, you must include a
 {@code service} element (rather than the {@code activity} element) within the {@code application}
-element in its manifest. In addition, within the {@code service} element, you must also include an
+element in your manifest. In addition, within the {@code service} element, you must also include an
 accessibility service intent filter. For compatiblity with Android 4.1 and higher, the manifest
 must also request the {@link android.Manifest.permission#BIND_ACCESSIBILITY_SERVICE} permission
 as shown in the following sample:</p>
 
 <pre>
-&lt;application&gt;
-  &lt;service android:name=&quot;.MyAccessibilityService&quot;
-      android:label=&quot;@string/accessibility_service_label&quot;
-      android:permission=&quot;android.permission.BIND_ACCESSIBILITY_SERVICE&quot&gt;
-    &lt;intent-filter&gt;
-      &lt;action android:name=&quot;android.accessibilityservice.AccessibilityService&quot; /&gt;
-    &lt;/intent-filter&gt;
-  &lt;/service&gt;
-  &lt;uses-permission android:name="android.permission.BIND_ACCESSIBILITY_SERVICE" /&gt;
-&lt;/application&gt;
+&lt;manifest&gt;
+  ...
+  &lt;uses-permission ... /&gt;
+  ...
+  &lt;application&gt;
+    ...
+    &lt;service android:name=&quot;.MyAccessibilityService&quot;
+        android:label=&quot;@string/accessibility_service_label&quot;
+        android:permission=&quot;android.permission.BIND_ACCESSIBILITY_SERVICE&quot&gt;
+      &lt;intent-filter&gt;
+        &lt;action android:name=&quot;android.accessibilityservice.AccessibilityService&quot; /&gt;
+      &lt;/intent-filter&gt;
+    &lt;/service&gt;
+    &lt;uses-permission android:name="android.permission.BIND_ACCESSIBILITY_SERVICE" /&gt;
+  &lt;/application&gt;
+&lt;/manifest&gt;
 </pre>
 
 <p>These declarations are required for all accessibility services deployed on Android 1.6 (API Level
diff --git a/docs/html/guide/topics/ui/declaring-layout.jd b/docs/html/guide/topics/ui/declaring-layout.jd
index 40ae81e..e1d51e6 100644
--- a/docs/html/guide/topics/ui/declaring-layout.jd
+++ b/docs/html/guide/topics/ui/declaring-layout.jd
@@ -31,7 +31,7 @@
     <li>{@link android.view.ViewGroup}</li>
     <li>{@link android.view.ViewGroup.LayoutParams}</li>
   </ol>
-  
+
   <h2>See also</h2>
   <ol>
     <li><a href="{@docRoot}training/basics/firstapp/building-ui.html">Building a Simple User
@@ -43,9 +43,9 @@
 href="{@docRoot}guide/topics/appwidgets/index.html">app widget</a>.
 You can declare a layout in two ways:</p>
 <ul>
-<li><strong>Declare UI elements in XML</strong>. Android provides a straightforward XML 
+<li><strong>Declare UI elements in XML</strong>. Android provides a straightforward XML
 vocabulary that corresponds to the View classes and subclasses, such as those for widgets and layouts.</li>
-<li><strong>Instantiate layout elements at runtime</strong>. Your 
+<li><strong>Instantiate layout elements at runtime</strong>. Your
 application can create View and ViewGroup objects (and manipulate their properties) programmatically. </li>
 </ul>
 
@@ -55,12 +55,12 @@
 <div class="sidebox">
   <ul>
   <li>The <a href="{@docRoot}tools/sdk/eclipse-adt.html">ADT
-  Plugin for Eclipse</a> offers a layout preview of your XML &mdash; 
+  Plugin for Eclipse</a> offers a layout preview of your XML &mdash;
   with the XML file opened, select the <strong>Layout</strong> tab.</li>
-  <li>You should also try the 
-  <a href="{@docRoot}tools/debugging/debugging-ui.html#hierarchyViewer">Hierarchy Viewer</a> tool, 
-  for debugging layouts &mdash; it reveals layout property values, 
-  draws wireframes with padding/margin indicators, and full rendered views while 
+  <li>You should also try the
+  <a href="{@docRoot}tools/debugging/debugging-ui.html#hierarchyViewer">Hierarchy Viewer</a> tool,
+  for debugging layouts &mdash; it reveals layout property values,
+  draws wireframes with padding/margin indicators, and full rendered views while
   you debug on the emulator or device.</li>
   <li>The <a href="{@docRoot}tools/debugging/debugging-ui.html#layoutopt">layoutopt</a> tool lets
   you quickly analyze your layouts and hierarchies for inefficiencies or other problems.</li>
@@ -68,10 +68,10 @@
 </div>
 
 <p>The advantage to declaring your UI in XML is that it enables you to better separate the presentation of your application from the code that controls its behavior. Your UI descriptions are external to your application code, which means that you can modify or adapt it without having to modify your source code and recompile. For example, you can create XML layouts for different screen orientations, different device screen sizes, and different languages. Additionally, declaring the layout in XML makes it easier to visualize the structure of your UI, so it's easier to debug problems. As such, this document focuses on teaching you how to declare your layout in XML. If you're
-interested in instantiating View objects at runtime, refer to the {@link android.view.ViewGroup} and 
+interested in instantiating View objects at runtime, refer to the {@link android.view.ViewGroup} and
 {@link android.view.View} class references.</p>
 
-<p>In general, the XML vocabulary for declaring UI elements closely follows the structure and naming of the classes and methods, where element names correspond to class names and attribute names correspond to methods. In fact, the correspondence is often so direct that you can guess what XML attribute corresponds to a class method, or guess what class corresponds to a given xml element. However, note that not all vocabulary is identical. In some cases, there are slight naming differences. For
+<p>In general, the XML vocabulary for declaring UI elements closely follows the structure and naming of the classes and methods, where element names correspond to class names and attribute names correspond to methods. In fact, the correspondence is often so direct that you can guess what XML attribute corresponds to a class method, or guess what class corresponds to a given XML element. However, note that not all vocabulary is identical. In some cases, there are slight naming differences. For
 example, the EditText element has a <code>text</code> attribute that corresponds to
 <code>EditText.setText()</code>. </p>
 
@@ -102,7 +102,7 @@
 &lt;/LinearLayout>
 </pre>
 
-<p>After you've declared your layout in XML, save the file with the <code>.xml</code> extension, 
+<p>After you've declared your layout in XML, save the file with the <code>.xml</code> extension,
 in your Android project's <code>res/layout/</code> directory, so it will properly compile. </p>
 
 <p>More information about the syntax for a layout XML file is available in the <a
@@ -111,11 +111,11 @@
 <h2 id="load">Load the XML Resource</h2>
 
 <p>When you compile your application, each XML layout file is compiled into a
-{@link android.view.View} resource. You should load the layout resource from your application code, in your 
+{@link android.view.View} resource. You should load the layout resource from your application code, in your
 {@link android.app.Activity#onCreate(android.os.Bundle) Activity.onCreate()} callback implementation.
-Do so by calling <code>{@link android.app.Activity#setContentView(int) setContentView()}</code>, 
-passing it the reference to your layout resource in the form of: 
-<code>R.layout.<em>layout_file_name</em></code>  
+Do so by calling <code>{@link android.app.Activity#setContentView(int) setContentView()}</code>,
+passing it the reference to your layout resource in the form of:
+<code>R.layout.<em>layout_file_name</em></code>.
 For example, if your XML layout is saved as <code>main_layout.xml</code>, you would load it
 for your Activity like so:</p>
 <pre>
@@ -126,7 +126,7 @@
 </pre>
 
 <p>The <code>onCreate()</code> callback method in your Activity is called by the Android framework when
-your Activity is launched (see the discussion about lifecycles, in the 
+your Activity is launched (see the discussion about lifecycles, in the
 <a href="{@docRoot}guide/components/activities.html#Lifecycle">Activities</a>
 document).</p>
 
@@ -136,18 +136,18 @@
 <p>Every View and ViewGroup object supports their own variety of XML attributes.
 Some attributes are specific to a View object (for example, TextView supports the <code>textSize</code>
 attribute), but these attributes are also inherited by any View objects that may extend this class.
-Some are common to all View objects, because they are inherited from the root View class (like 
-the <code>id</code> attribute). And, other attributes are considered "layout parameters," which are 
+Some are common to all View objects, because they are inherited from the root View class (like
+the <code>id</code> attribute). And, other attributes are considered "layout parameters," which are
 attributes that describe certain layout orientations of the View object, as defined by that object's
 parent ViewGroup object.</p>
 
 <h3 id="id">ID</h3>
 
 <p>Any View object may have an integer ID associated with it, to uniquely identify the View within the tree.
-When the application is compiled, this ID is referenced as an integer, but the ID is typically 
+When the application is compiled, this ID is referenced as an integer, but the ID is typically
 assigned in the layout XML file as a string, in the <code>id</code> attribute.
 This is an XML attribute common to all View objects
-(defined by the {@link android.view.View} class) and you will use it very often. 
+(defined by the {@link android.view.View} class) and you will use it very often.
 The syntax for an ID, inside an XML tag is:</p>
 <pre>android:id="&#64;+id/my_button"</pre>
 
@@ -170,7 +170,7 @@
         android:text="&#64;string/my_button_text"/>
 </pre>
   </li>
-  <li>Then create an instance of the view object and capture it from the layout 
+  <li>Then create an instance of the view object and capture it from the layout
 (typically in the <code>{@link android.app.Activity#onCreate(Bundle) onCreate()}</code> method):
 <pre>
 Button myButton = (Button) findViewById(R.id.my_button);
@@ -178,16 +178,16 @@
   </li>
 </ol>
 <p>Defining IDs for view objects is important when creating a {@link android.widget.RelativeLayout}.
-In a relative layout, sibling views can define their layout relative to another sibling view, 
+In a relative layout, sibling views can define their layout relative to another sibling view,
 which is referenced by the unique ID.</p>
 <p>An ID need not be unique throughout the entire tree, but it should be
-unique within the part of the tree you are searching (which may often be the entire tree, so it's best 
+unique within the part of the tree you are searching (which may often be the entire tree, so it's best
 to be completely unique when possible).</p>
 
 
 <h3 id="layout-params">Layout Parameters</h3>
 
-<p>XML layout attributes named <code>layout_<em>something</em></code> define 
+<p>XML layout attributes named <code>layout_<em>something</em></code> define
 layout parameters for the View that are appropriate for the ViewGroup in which it resides.</p>
 
 <p>Every ViewGroup class implements a nested class that extends {@link
@@ -201,7 +201,7 @@
 parameters associated with each view.</p>
 
 <p>Note that every LayoutParams subclass has its own syntax for setting
-values. Each child element must define LayoutParams that are appropriate for its parent, 
+values. Each child element must define LayoutParams that are appropriate for its parent,
 though it may also define different LayoutParams for its own children. </p>
 
 <p>All view groups include a width and height (<code>layout_width</code> and
@@ -214,7 +214,7 @@
 
 <ul>
   <li><var>wrap_content</var> tells your view to size itself to the dimensions
-required by its content</li>
+required by its content.</li>
   <li><var>match_parent</var> (named <var>fill_parent</var> before API Level 8)
 tells your view to become as big as its parent view group will allow.</li>
 </ul>
@@ -236,17 +236,17 @@
    two dimensions, expressed as a width and a height. The unit for location
    and dimensions is the pixel.
    </p>
-  
+
    <p>
    It is possible to retrieve the location of a view by invoking the methods
    {@link android.view.View#getLeft()} and {@link android.view.View#getTop()}. The former returns the left, or X,
    coordinate of the rectangle representing the view. The latter returns the
    top, or Y, coordinate of the rectangle representing the view. These methods
    both return the location of the view relative to its parent. For instance,
-   when getLeft() returns 20, that means the view is located 20 pixels to the
+   when <code>getLeft()</code> returns 20, that means the view is located 20 pixels to the
    right of the left edge of its direct parent.
    </p>
-  
+
    <p>
    In addition, several convenience methods are offered to avoid unnecessary
    computations, namely {@link android.view.View#getRight()} and {@link android.view.View#getBottom()}.
@@ -254,14 +254,14 @@
    rectangle representing the view. For instance, calling {@link android.view.View#getRight()}
    is similar to the following computation: <code>getLeft() + getWidth()</code>.
    </p>
-   
+
 
 <h2 id="SizePaddingMargins">Size, Padding and Margins</h2>
    <p>
    The size of a view is expressed with a width and a height. A view actually
    possess two pairs of width and height values.
    </p>
-  
+
    <p>
    The first pair is known as <em>measured width</em> and
    <em>measured height</em>. These dimensions define how big a view wants to be
@@ -269,27 +269,27 @@
    measured dimensions can be obtained by calling {@link android.view.View#getMeasuredWidth()}
    and {@link android.view.View#getMeasuredHeight()}.
    </p>
-  
+
    <p>
    The second pair is simply known as <em>width</em> and <em>height</em>, or
    sometimes <em>drawing width</em> and <em>drawing height</em>. These
    dimensions define the actual size of the view on screen, at drawing time and
    after layout. These values may, but do not have to, be different from the
    measured width and height. The width and height can be obtained by calling
-   {@link android.view.View#getWidth()} and {@link android.view.View#getHeight()}. 
+   {@link android.view.View#getWidth()} and {@link android.view.View#getHeight()}.
    </p>
-  
+
    <p>
    To measure its dimensions, a view takes into account its padding. The padding
    is expressed in pixels for the left, top, right and bottom parts of the view.
-   Padding can be used to offset the content of the view by a specific amount of
+   Padding can be used to offset the content of the view by a specific number of
    pixels. For instance, a left padding of 2 will push the view's content by
    2 pixels to the right of the left edge. Padding can be set using the
    {@link android.view.View#setPadding(int, int, int, int)} method and queried by calling
    {@link android.view.View#getPaddingLeft()}, {@link android.view.View#getPaddingTop()},
-   {@link android.view.View#getPaddingRight()} and {@link android.view.View#getPaddingBottom()}.  
+   {@link android.view.View#getPaddingRight()} and {@link android.view.View#getPaddingBottom()}.
    </p>
-  
+
    <p>
    Even though a view can define a padding, it does not provide any support for
    margins. However, view groups provide such a support. Refer to
@@ -297,13 +297,13 @@
    {@link android.view.ViewGroup.MarginLayoutParams} for further information.
    </p>
 
-   <p>For more information about dimensions, see 
+   <p>For more information about dimensions, see
    <a href="{@docRoot}guide/topics/resources/more-resources.html#Dimension">Dimension Values</a>.
    </p>
-   
 
-   
-   
+
+
+
 
 
 <style type="text/css">
@@ -332,7 +332,7 @@
 possible. Your layout draws faster if it has fewer nested layouts (a wide view hierarchy is
 better than a deep view hierarchy).</p>
 
-<!-- 
+<!--
 <h2 id="framelayout">FrameLayout</h2>
 <p>{@link android.widget.FrameLayout FrameLayout} is the simplest type of layout
 object. It's basically a blank space on your screen that you can
@@ -375,7 +375,7 @@
 <p>When the content for your layout is dynamic or not pre-determined, you can use a layout that
 subclasses {@link android.widget.AdapterView} to populate the layout with views at runtime. A
 subclass of the {@link android.widget.AdapterView} class uses an {@link android.widget.Adapter} to
-bind data to its layout. The {@link android.widget.Adapter} behaves as a middle-man between the data
+bind data to its layout. The {@link android.widget.Adapter} behaves as a middleman between the data
 source and the {@link android.widget.AdapterView} layout&mdash;the {@link android.widget.Adapter}
 retrieves the data (from a source such as an array or a database query) and converts each entry
 into a view that can be added into the {@link android.widget.AdapterView} layout.</p>
@@ -417,7 +417,7 @@
 android.widget.ListView}, initialize a new {@link android.widget.ArrayAdapter} using a
 constructor to specify the layout for each string and the string array:</p>
 <pre>
-ArrayAdapter adapter = new ArrayAdapter&lt;String>(this, 
+ArrayAdapter&lt;String> adapter = new ArrayAdapter&lt;String>(this,
         android.R.layout.simple_list_item_1, myStringArray);
 </pre>
 <p>The arguments for this constructor are:</p>
@@ -453,14 +453,14 @@
 android.database.Cursor} you want in the layout for each result and an integer array specifying the
 corresponding views that each column should be placed:</p>
 <pre>
-String[] fromColumns = {ContactsContract.Data.DISPLAY_NAME, 
+String[] fromColumns = {ContactsContract.Data.DISPLAY_NAME,
                         ContactsContract.CommonDataKinds.Phone.NUMBER};
 int[] toViews = {R.id.display_name, R.id.phone_number};
 </pre>
 <p>When you instantiate the {@link android.widget.SimpleCursorAdapter}, pass the layout to use for
 each result, the {@link android.database.Cursor} containing the results, and these two arrays:</p>
 <pre>
-SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, 
+SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
         R.layout.person_name_and_number, cursor, fromColumns, toViews, 0);
 ListView listView = getListView();
 listView.setAdapter(adapter);
@@ -490,7 +490,7 @@
     }
 };
 
-listView.setOnItemClickListener(mMessageClickedHandler); 
+listView.setOnItemClickListener(mMessageClickedHandler);
 </pre>
 
 
diff --git a/docs/html/images/tools/as-allocstart.png b/docs/html/images/tools/as-allocstart.png
new file mode 100644
index 0000000..b9c770a
--- /dev/null
+++ b/docs/html/images/tools/as-allocstart.png
Binary files differ
diff --git a/docs/html/images/tools/as-allocstop.png b/docs/html/images/tools/as-allocstop.png
new file mode 100644
index 0000000..8271161
--- /dev/null
+++ b/docs/html/images/tools/as-allocstop.png
Binary files differ
diff --git a/docs/html/images/tools/as-alloctrack.png b/docs/html/images/tools/as-alloctrack.png
new file mode 100644
index 0000000..4280f02
--- /dev/null
+++ b/docs/html/images/tools/as-alloctrack.png
Binary files differ
diff --git a/docs/html/images/tools/projectview01.png b/docs/html/images/tools/projectview01.png
new file mode 100644
index 0000000..90589fb
--- /dev/null
+++ b/docs/html/images/tools/projectview01.png
Binary files differ
diff --git a/docs/html/images/tools/projectview03.png b/docs/html/images/tools/projectview03.png
new file mode 100644
index 0000000..f527ff1
--- /dev/null
+++ b/docs/html/images/tools/projectview03.png
Binary files differ
diff --git a/docs/html/images/tools/signadt3.png b/docs/html/images/tools/signadt3.png
new file mode 100644
index 0000000..3f5650b
--- /dev/null
+++ b/docs/html/images/tools/signadt3.png
Binary files differ
diff --git a/docs/html/images/tools/signadt4.png b/docs/html/images/tools/signadt4.png
new file mode 100644
index 0000000..2adfff0
--- /dev/null
+++ b/docs/html/images/tools/signadt4.png
Binary files differ
diff --git a/docs/html/images/tools/signadt5.png b/docs/html/images/tools/signadt5.png
new file mode 100644
index 0000000..e1861e8
--- /dev/null
+++ b/docs/html/images/tools/signadt5.png
Binary files differ
diff --git a/docs/html/images/tools/signstudio1.png b/docs/html/images/tools/signstudio1.png
new file mode 100644
index 0000000..374e04f
--- /dev/null
+++ b/docs/html/images/tools/signstudio1.png
Binary files differ
diff --git a/docs/html/images/tools/signstudio10.png b/docs/html/images/tools/signstudio10.png
new file mode 100644
index 0000000..5b9ae6d
--- /dev/null
+++ b/docs/html/images/tools/signstudio10.png
Binary files differ
diff --git a/docs/html/images/tools/signstudio11.png b/docs/html/images/tools/signstudio11.png
new file mode 100644
index 0000000..0bf0d51
--- /dev/null
+++ b/docs/html/images/tools/signstudio11.png
Binary files differ
diff --git a/docs/html/images/tools/signstudio2.png b/docs/html/images/tools/signstudio2.png
new file mode 100644
index 0000000..5e8e416
--- /dev/null
+++ b/docs/html/images/tools/signstudio2.png
Binary files differ
diff --git a/docs/html/images/tools/signstudio3.png b/docs/html/images/tools/signstudio3.png
new file mode 100644
index 0000000..f25bf00
--- /dev/null
+++ b/docs/html/images/tools/signstudio3.png
Binary files differ
diff --git a/docs/html/jd_extras.js b/docs/html/jd_extras.js
index a4302ef..62d18d6 100644
--- a/docs/html/jd_extras.js
+++ b/docs/html/jd_extras.js
@@ -57,9 +57,9 @@
     "type":"video"
   },
   {
-    "title":"5 Tips for Succeeding",
+    "title":"Plan for Success",
     "titleFriendly":"",
-    "summary":"See inspirational ways of using technology in the classroom.",
+    "summary":"5 tips from developers on creating great EDU apps.",
     "url":"https://www.youtube.com/watch?v=Eh2adsAyTKc",
     "group":"",
     "keywords": [],
diff --git a/docs/html/preview/api-overview.jd b/docs/html/preview/api-overview.jd
index cf594dc..beea0ca 100644
--- a/docs/html/preview/api-overview.jd
+++ b/docs/html/preview/api-overview.jd
@@ -19,6 +19,7 @@
       <li><a href="#BehaviorNotifications">If your app implements notifications...</a></li>
       <li><a href="#BehaviorMediaControl">If your app uses RemoteControlClient...</a></li>
 <li><a href="#BehaviorGetRecentTasks">If your app uses ActivityManager.getRecentTasks()...</a></li>
+<li><a href="#64BitSupport">If you are using the Android Native Development Kit (NDK)...</a></li>
     </ol>
   </li>
   <li><a href="#UI">User Interface</a>
@@ -246,6 +247,29 @@
 its own tasks, use {@code android.app.ActivityManager.getAppTasks()} instead to
 retrieve that information.</p>
 
+<h3 id="64BitSupport">If you are using the Android Native Development Kit (NDK)...</h3>
+
+<p>The L Developer Preview introduces support for 64-bit systems and other
+  preview NDK APIs. The 64-bit enhancement adds needed address space as Android
+  usage diversifies and increases performance while still supporting existing
+  32-bit apps fully. Use of OpenSSL for cryptography in the platform is also
+  faster. In addition, this release introduces new native audio and media NDK
+  APIs and native OpenGL ES (GLES) 3.1 support.</p>
+
+<p>To use this enhancement, download and install NDK Revision 10 from the
+<a href="{@docRoot}tools/sdk/ndk/index.html">Android NDK page</a>. Refer to the
+Revision 10 <a href="{@docRoot}tools/sdk/ndk/index.html#Revisions">release notes</a>
+for more information about important changes and bug fixes to the NDK.</p>
+
+<p>If you are using the NDK and want to use the features provided in the L
+  Developer Preview, download the {@code android-ndk64-r10} package for your
+  target platform. Due to a
+  <a href="https://code.google.com/p/android/issues/detail?id=73705">known issue</a>,
+  you must still download the 64-bit package even if you only want to compile
+  apps for 32-bit systems. The package also includes
+  the {@code gcc-4.9} compiler for both 32- and 64-bit apps. The L Developer
+  Preview API library is located under the {@code platforms/android-L/} API directory.</p>
+
 <h2 id="UI">User Interface</h2>
 
 <h3 id="MaterialDesign">Material design support</h3>
diff --git a/docs/html/preview/material/ui-widgets.jd b/docs/html/preview/material/ui-widgets.jd
index 2266815..69b7d2d 100644
--- a/docs/html/preview/material/ui-widgets.jd
+++ b/docs/html/preview/material/ui-widgets.jd
@@ -132,7 +132,7 @@
                                                    int viewType) {
         // create a new view
         View v = LayoutInflater.from(parent.getContext())
-                               .inflate(R.layout.my_text_view, null);
+                               .inflate(R.layout.my_text_view, parent, false);
         // set the view's size, margins, paddings and layout parameters
         ...
         ViewHolder vh = new ViewHolder(v);
diff --git a/docs/html/preview/preview_toc.cs b/docs/html/preview/preview_toc.cs
index a505905..819976e 100644
--- a/docs/html/preview/preview_toc.cs
+++ b/docs/html/preview/preview_toc.cs
@@ -68,6 +68,8 @@
             Recommendations</a></li>
         </ul>
       </li>
+      <li><a href="<?cs var:toroot ?>preview/tv/tif/index.html">
+        TV Input Framework</a></li>
       <li><a href="<?cs var:toroot ?>preview/tv/games/index.html">
         Games on TV</a></li>
       <li><a href="<?cs var:toroot ?>preview/tv/start/hardware-features.html">
diff --git a/docs/html/preview/support.jd b/docs/html/preview/support.jd
index 9d7844b..3220d63 100644
--- a/docs/html/preview/support.jd
+++ b/docs/html/preview/support.jd
@@ -106,3 +106,15 @@
 <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>
+
+<h3 id="64bitsupport">64-bit support</h3>
+<ul>
+<li><p>If you are using the NDK to compile apps for 32- or 64-bit systems and
+want to use the features provided in the L Developer Preview, download the
+{@code android-ndk64-r10} package for your target platform from the
+<a href="{@docRoot}tools/sdk/ndk/index.html">Android NDK page</a>. The
+{@code android-ndk64-r10} package contains the L Developer Preview API
+library (located under the {@code platforms/android-L/} API directory) for both
+32- and 64-bit systems. The package also includes the {@code gcc-4.9} compiler
+for both 32- and 64-bit apps.</p></li>
+</ul>
diff --git a/docs/html/preview/tv/adt-1/index.jd b/docs/html/preview/tv/adt-1/index.jd
index e09dcbf..b37a55a 100644
--- a/docs/html/preview/tv/adt-1/index.jd
+++ b/docs/html/preview/tv/adt-1/index.jd
@@ -52,16 +52,16 @@
 </p>
 <p>Unplug the included power cable from the back of ADT-1. The device does not have an on/off
   switch. However, ADT-1 will begin sleeping (daydream) based on user settings in
-  <strong>Settings &gt; Display &gt; Daydream</strong>.
+  <strong>Settings &gt; Device &gt; Display &gt; Daydream</strong>.
   </p>
 
 <p>
   <strong>How do I connect to the network?</strong>
 </p>
 <p>ADT-1 has both wireless and Ethernet for connecting to your network. To change your wireless
-  network, go to <strong>Settings -&gt; Wi-Fi</strong>. To use an Ethernet network connection,
-  simply plug an Ethernet cable (that is connected to your network) into the port on the back of
-  ADT-1.</p>
+  network, go to <strong>Settings &gt; Device &gt; Wi-Fi</strong>. To use an Ethernet network
+  connection, simply plug an Ethernet cable (that is connected to your network) into the port on
+  the back of ADT-1.</p>
 
 <p>
   <strong>How do I use the developer cable?</strong>
@@ -70,6 +70,35 @@
   power port on the back of ADT-1, a standard male USB-A connector that connects your PC, and a
   small, female power connector that the included power supply plugs into.</p>
 
+<p class="note">
+  <strong>Note:</strong> Make sure you have enabled USB debugging in <strong>Settings &gt;
+  Preferences &gt; Developer options &gt; Debugging &gt; USB debugging</strong>, so that you can
+  use the Android Debug Bridge (adb) to connect with the ADT-1 device.
+</p>
+
+<p id="adb-tcp">
+  <strong>Can I connect without a developer cable?</strong>
+</p>
+<p>
+  Yes. The ADT-1 device is enabled for Android Debug Bridge (adb) connections over TCP/IP. To
+  connect to the ADT-1 device using this method:
+</p>
+<ol>
+  <li>Make sure that your development computer and the ADT-1 device are on the same network.</li>
+  <li>Determine the IP address of the ADT-1 device by navigating to <strong>Settings &gt;
+    Device &gt; Wi-Fi &gt; your-network-name &gt; Status info</strong>.</li>
+  <li>Connect to the ADT-1 device using the following adb command:
+<pre>
+$ adb connect &lt;ip-address-for-adt-1&gt;:4321
+</pre>
+  </li>
+</ol>
+
+<p class="note">
+  <strong>Note:</strong> Make sure you have enabled USB debugging in <strong>Settings &gt;
+  Preferences &gt; Developer options &gt; Debugging &gt; USB debugging</strong>, so that you can
+  use the Android Debug Bridge (adb) to connect with the ADT-1 device.
+</p>
 
 
 <h3 id="input">User Input</h3>
@@ -139,15 +168,15 @@
   <li>YouTube</li>
   <li>Netflix</li>
   <li>Google+ Photos</li>
-  <li>Google Play Movies and TV (Android only)</li>
+  <li>Google Play Movies and TV (Android and iOS only)</li>
+  <li>Google Play Music</li>
+  <li>Mirror your Android device screen to ADT-1</li>
 </ul>
 
 <p>Coming soon:</p>
 
 <ul>
-  <li>Google Play Music</li>
-  <li>Google Play Movies and TV (iOS and Chrome)</li>
-  <li>Mirror you Android device screen to ADT-1</li>
+  <li>Google Play Movies and TV (Chrome)</li>
 </ul>
 
 <p class="note">
@@ -179,8 +208,8 @@
   <strong>How do I register my ADT-1 in order to run my apps?</strong>
 </p>
 <ol>
-  <li>Go to <strong>Settings &gt; Google Cast</strong> and turn on developer support, allowing the
-    ADT-1 device to send its serial number to Google.</li>
+  <li>Go to <strong>Settings &gt; Device &gt; Google Cast</strong> and turn on developer support,
+    allowing the ADT-1 device to send its serial number to Google.</li>
   <li>Register your ADT-1 device in the Google Cast Developer Console, using the 12 character
     serial number engraved on the back of the ADT-1.</li>
 </ol>
@@ -203,8 +232,8 @@
 <p>
   <strong>Why doesn't the on-screen keyboard come up?</strong>
 </p>
-<p>Enable the keyboard in the device Settings. Go to <strong>Settings &gt; Keyboard &gt; Current
-  keyboard</strong> and choose <strong>Leanback keyboard</strong>.
+<p>Enable the keyboard in the device Settings. Go to <strong>Settings &gt; Preferences &gt;
+  Keyboard &gt; Current keyboard</strong> and choose <strong>Leanback keyboard</strong>.
 
 <p>
   <strong>How do I perform a hardware reboot?</strong>
@@ -221,8 +250,8 @@
   data, downloaded apps, app data, and account settings.
 </p>
 
-<p>From the home screen, go to <strong>Settings &gt; Device &gt; Factory data reset</strong>, and
-  select <strong>Reset device</strong>.
+<p>From the home screen, go to <strong>Settings &gt; Device &gt; Storage &amp; Reset</strong>, and
+  select <strong>Factory data reset</strong>.
 </p>
 
 <p>
@@ -279,4 +308,3 @@
   <li><a href="regulatory.html">Regulatory Disclosures</a></li>
   <li><a href="safety.html">Important Safety Information</a></li>
 </ul>
-
diff --git a/docs/html/preview/tv/images/tif-overview.png b/docs/html/preview/tv/images/tif-overview.png
new file mode 100644
index 0000000..197775e
--- /dev/null
+++ b/docs/html/preview/tv/images/tif-overview.png
Binary files differ
diff --git a/docs/html/preview/tv/tif/index.jd b/docs/html/preview/tv/tif/index.jd
new file mode 100644
index 0000000..ef02def
--- /dev/null
+++ b/docs/html/preview/tv/tif/index.jd
@@ -0,0 +1,38 @@
+page.title=TV Input Framework
+page.tags=tif
+
+@jd:body
+
+<p>
+  Watching live television shows and other continuous, channel-based content is a big part of the
+  TV experience. Android supports receiving and playback of live video content through the TV Input
+  Framework. This framework provides a unified method for receiving audio and video channel content
+  from hardware sources, such as HDMI ports and built-in-tuners, and software sources, such as
+  video streamed over the internet.
+</p>
+<p>
+  The framework enables developers to define live TV input sources by implementing a TV input
+  service. This service publishes a list of channels and programs to the TV Provider. The live TV
+  app on a TV device gets the list of available channels and programs from the TV Provider and
+  displays them to a user. When a user selects a specific channel, the live TV app creates a
+  session for the associated TV input service through the TV Input Manager, and tells the TV input
+  service to tune to the requested channel and play the content to a display surface provided by
+  the TV app.
+</p>
+
+<img src="{@docRoot}preview/tv/images/tif-overview.png" id="figure1">
+<p class="img-caption">
+  <strong>Figure 1.</strong> Functional diagram of the TV Input Framework
+</p>
+
+<p>
+  The TV Input Framework is designed to provide access to a wide variety of live TV input sources
+  and bring them together in a single user interface for users to browse, view, and enjoy content.
+  Building a TV input service for your content can help make it more accessible on TV devices.
+</p>
+
+<p>
+  The APIs for the TV Input Framework are available in the L Developer Preview and you can
+  review them in the preview API reference docs. However, more changes are planned, so stay tuned
+  for additional information with the official Android platform launch.
+</p>
diff --git a/docs/html/sdk/index.jd b/docs/html/sdk/index.jd
index 68560ff..edee360 100644
--- a/docs/html/sdk/index.jd
+++ b/docs/html/sdk/index.jd
@@ -306,6 +306,9 @@
   <p>
   Android Studio is a new IDE powered by IntelliJ that provides new features and improvements
   over ADT. It's currently in beta but will be the official Android IDE once it's ready.</p>
+  <p>
+  If you're a new Android developer, you should consider starting with Android Studio, because the
+  ADT plugin for Eclipse is no longer in active development.</p>
   <p style="margin: 0;">
   <a href="/sdk/installing/studio.html">Learn more about Android Studio</a></p>
   </div>
diff --git a/docs/html/sdk/installing/create-project.jd b/docs/html/sdk/installing/create-project.jd
index c0d523a..a7c12d4 100644
--- a/docs/html/sdk/installing/create-project.jd
+++ b/docs/html/sdk/installing/create-project.jd
@@ -76,7 +76,7 @@
 <img src="{@docRoot}images/tools/wizard7.png" alt="" width="750" height="509">
 <p class="img-caption"><strong>Figure 7.</strong> The default project structure for a mobile app.</p>
 
-<p>Now you are ready to develop your app. Fore more information, see the following links:</p>
+<p>Now you are ready to develop your app. For more information, see the following links:</p>
 
 <ul>
 <li><a href="{@docRoot}training/">Training Lessons</a></li>
diff --git a/docs/html/sdk/installing/installing-adt.jd b/docs/html/sdk/installing/installing-adt.jd
index 88bc733..5a433d4 100644
--- a/docs/html/sdk/installing/installing-adt.jd
+++ b/docs/html/sdk/installing/installing-adt.jd
@@ -1,8 +1,8 @@
 page.title=Installing the Eclipse Plugin
-adt.zip.version=23.0.2
-adt.zip.download=ADT-23.0.2.zip
-adt.zip.bytes=103287135
-adt.zip.checksum=cde1d0a463b5ccce844b63161cfa1cb9
+adt.zip.version=23.0.3
+adt.zip.download=ADT-23.0.3.zip
+adt.zip.bytes=103321934
+adt.zip.checksum=ab2f5e2fbbdddeeb7dfd02cd4046538a
 
 @jd:body
 
@@ -28,8 +28,7 @@
       <li>Eclipse <a href="http://www.eclipse.org/jdt">JDT</a> plugin (included
 in most Eclipse IDE packages) </li>
       <li><a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">JDK 6</a>
-        (JRE alone is not sufficient)</li>oid Development Tools plugin</a>
-(recommended)</li>
+        (JRE alone is not sufficient)</li>
       <li><strong>Not</strong> compatible with GNU Compiler for Java (gcj)</li>
     </ul>
 
@@ -79,73 +78,6 @@
 <a href="{@docRoot}sdk/installing/adding-packages.html">Adding Platforms and Packages</a>.</p>
 
 
-<h2 id="tmgr">Download the ADT Translation Manager Plugin</h2>
-
-<div class="sidebox-wrapper">
-<div class="sidebox">
-<h2>App Translations in Google Play</h2>
-<p>Google Play <a href="{@docRoot}distribute/tools/localization-checklist.html#gp-trans">App
-Translation Service</a> is available in the Developer Console to help you
-localize your app for a global user base. You can browse qualified vendors, get
-estimates, upload strings for translation, and then import the translations directly
-into your app.</p>
-</div>
-</div>
-
-<p>ADT Translation Manager Plugin is an Android SDK Tools plugin that helps
-you work with strings that you are localizing. It's designed to work
-with the translation services built into the Google Play Developer
-Console that let you quickly find and purchase translations of
-your app from a list of pre-qualified vendors. </p>
-
-<p>The plugin simplifies the management of strings
-during translation. It lets you easily export your default strings
-and upload them directly to the Developer Console, from which you
-can get estimates or purchase translations. When your translations
-are ready, the plugin lets you quickly download and import them
-back into your project. During import, it moves all of the translated resources into
-the correct locations under <code>res/values</code>, so that
-localization works instantly.</p>
-
-<p>For more information about translation services in Google Play, see <a
-href="{@docRoot}distribute/tools/localization-checklist.html#gp-trans">Purchase
-professional translations through the Developer Console</a>.</p>
-
-<p>To install the ADT Translation Manager Plugin follow these steps:</p>
-
-<ol>
-    <li>Install the ADT Plugin, as described above. </li>
-    <li>In Eclipse, select <strong>Help</strong> &gt; <strong>Install New
-Software</strong>.</li>
-    <li>Click <strong>Add</strong>, in the top-right corner.</li>
-    <li>In the Add Repository dialog that appears, enter a repository name for the <em>Name</em>
-      and the following URL for the <em>Location</em>:
-      <pre>https://dl.google.com/alt/</pre>
-    </li>
-    <li>Click <strong>OK</strong>.
-    <li>In the Available Software dialog, select the checkbox next to <strong>Android Developer Tools
-       - Translation Manager</strong> and click <strong>Next</strong>.</li>
-    <li>In the next window, you'll see a list of the tools to be downloaded. Click
-<strong>Next</strong>. </li>
-    <li>Read and accept the license agreements, then click <strong>Finish</strong>.
-      <p>If you get a security warning saying that the authenticity or validity of
-the software can't be established, click <strong>OK</strong>.</p></li>
-    <li>When the installation completes, restart Eclipse. </li>
-</ol>
-
-<h4 id="translation-manager-notes">Installation notes</h4>
-
-<ul>
-<li>The full ADT Plugin must be installed in your Eclipse environment before you install the ADT Translation Manager Plugin.</li>
-<li>ADT Translation Manager Plugin is designed for use with the translation services offered through the Google Play Developer Console. It is not designed for general purpose import/export of strings. </li>
-<li>To use the plugin, you must <a href="{@docRoot}distribute/googleplay/start.html">set up a Developer Console account</a>. </li>
-<li>Currently, translation services are available through the Developer Console only as part of a pilot program. To use the plugin, you must first sign up for the pilot program by visiting the Developer Console.</li>
-<li>If you downloaded ADT as part of the SDK ADT bundle, you may encounter an error when attempting to download the ADT Translation Manager Plugin from the remote repository. In that case, open the <strong>Install New
-Software</strong>, uncheck "Contact all update sites during install to find required software" at the bottom and try again. </li>
-</ul>
-
-
-
 <h2 id="Troubleshooting">Troubleshooting ADT Installation</h2>
 
 <p>If you are having trouble downloading the ADT plugin after following the
@@ -172,7 +104,7 @@
   </tr>
   <tr>
     <td>
-      <a href="http://dl.google.com/android/{@adtZipDownload}">{@adtZipDownload}</a>
+      <a href="https://dl.google.com/android/{@adtZipDownload}">{@adtZipDownload}</a>
     </td>
     <td>{@adtZipBytes} bytes</td>
     <td>{@adtZipChecksum}</td>
diff --git a/docs/html/sdk/installing/studio-androidview.jd b/docs/html/sdk/installing/studio-androidview.jd
new file mode 100644
index 0000000..09aeaba
--- /dev/null
+++ b/docs/html/sdk/installing/studio-androidview.jd
@@ -0,0 +1,55 @@
+page.title=Using the Android Project View
+
+@jd:body
+
+
+<p>The Android project view in Android Studio shows a flattened version of your project's structure
+that provides quick access to the key source files of Android projects and helps you work with
+the new <a href="{@docRoot}sdk/installing/studio-build.html">Gradle-based build system</a>. The
+Android project view:</p>
+
+<ul>
+<li>Groups the build files for all modules at the top level of the project hierarchy.</li>
+<li>Shows the most important source directories at the top level of the module hierarchy.</li>
+<li>Groups all the manifest files for each module.</li>
+<li>Shows resource files from all Gradle source sets.</li>
+<li>Groups resource files for different locales, orientations, and screen types in a single group
+per resource type.</li>
+</ul>
+
+<div style="float:right;margin-left:30px;width:240px">
+<img src="{@docRoot}images/tools/projectview01.png" alt="" width="220" height="264"/>
+<p class="img-caption"><strong>Figure 1:</strong> Show the Android project view.</p>
+</div>
+
+
+<h2 id="enable-view">Enable the Android Project View</h2>
+
+<p>The Android project view is not yet enabled by default. To show the Android project view,
+click <strong>Project</strong> and select <strong>Android</strong>, as shown in Figure 1.</p>
+
+
+<h2 id="project-view">Use the Android Project View</h2>
+
+<p>The Android project view shows all the build files at the top level of the project hierarchy
+under <strong>Gradle Scripts</strong>. Each project module appears as a folder at the top
+level of the project hierarchy and contains these three elements at the top level:</p>
+
+<ul>
+<li><code>java/</code> - Source files for the module.</li>
+<li><code>manifests/</code> - Manifest files for the module.</li>
+<li><code>res/</code> - Resource files for the module.</li>
+</ul>
+
+<p>Figure 2 shows how the Android project view groups all the instances of the
+<code>ic_launcher.png</code> resource for different screen densities under the same element.</p>
+
+<p class="note"><strong>Note:</strong> The Android project view shows a hierarchy that helps you
+work with Android projects by providing a flattened structure that highlights the most commonly
+used files while developing Android applications. However, the project structure on disk differs
+from this representation.</p>
+
+<img src="{@docRoot}images/tools/projectview03.png" alt=""
+     style="margin-top:10px" width="650" height="508"/>
+<p class="img-caption"><strong>Figure 2:</strong> The traditional project view (left) and the
+Android project view (right).</p>
\ No newline at end of file
diff --git a/docs/html/sdk/installing/studio-debug.jd b/docs/html/sdk/installing/studio-debug.jd
index 7e2efe3..2e3e137 100644
--- a/docs/html/sdk/installing/studio-debug.jd
+++ b/docs/html/sdk/installing/studio-debug.jd
@@ -19,6 +19,7 @@
         <li><a href="#breakPointsDebug">Debug your app with breakpoints</a></li>
     </ol>
   </li>
+  <li><a href="#allocTracker">Track Object Allocation</a></li>
   <li><a href="#deviceMonitor">Analyze Runtime Metrics to Optimize your App</a></li>
   <li><a href="#screenCap">Capture Screenshots and Videos</a></li>
 </ol>
@@ -281,6 +282,47 @@
 <p class="img-caption"><strong>Figure 7.</strong> The Variables view in the Debug tool window.</p>
 
 
+<h2 id="allocTracker">Track Object Allocation</h2>
+
+<p>Android Studio lets you track objects that are being allocated on the Java heap and see which
+classes and threads are allocating these objects. This allows you to see the list of objects
+allocated during a period of interest. This information is valuable for assessing memory usage
+that can affect application performance.</p>
+
+<p>To track memory allocation of objects:</p>
+
+<ol>
+<li>Start your app as described in <a href="#runDebug">Run Your App in Debug Mode</a>.</li>
+<li>Click <strong>Android</strong> <img src="{@docRoot}images/tools/as-android.png" alt=""
+style="vertical-align:bottom;margin:0;height:20px"/> to open the <em>Android DDMS</em>
+tool window.</li>
+<li>On the <em>Android DDMS</em> tool window, select the <strong>Devices | logcat tab</strong>.</li>
+<li>Select your device from the dropdown list.</li>
+<li>Select your app by its package name from the list of running apps.</li>
+<li>Click <strong>Start Allocation Tracking</strong>
+<img src="{@docRoot}images/tools/as-allocstart.png" alt=""
+style="vertical-align:bottom;margin:0;height:20px"/></li>
+<li>Interact with your app on the device.</li>
+<li>Click <strong>Stop Allocation Tracking</strong>
+<img src="{@docRoot}images/tools/as-allocstop.png" alt=""
+style="vertical-align:bottom;margin:0;height:20px"/></li>
+</ol>
+
+<p>Android Studio shows the objects that the system allocated with the following information:</p>
+
+<ul>
+<li>Allocation order</li>
+<li>Allocated class</li>
+<li>Allocation size</li>
+<li>Thread ID</li>
+<li>Allocation method, class, and line number</li>
+<li>Stack trace at the point of allocation</li>
+</ul>
+
+<img src="{@docRoot}images/tools/as-alloctrack.png" alt="" width="750" height="252" />
+<p class="img-caption"><strong>Figure 8.</strong> Object allocation tracking in Android Studio.</p>
+
+
 <h2 id="deviceMonitor">Analyze Runtime Metrics to Optimize your App</h2>
 
 <p>Even if your application does not generate runtime errors, this does not mean it is free of
diff --git a/docs/html/sdk/installing/studio-tips.jd b/docs/html/sdk/installing/studio-tips.jd
index 12d2527..03e29ca 100644
--- a/docs/html/sdk/installing/studio-tips.jd
+++ b/docs/html/sdk/installing/studio-tips.jd
@@ -52,6 +52,12 @@
 <p>The following topics describe how to perform
 some basic development tasks with Android Studio.</p>
 
+<p class="note"><strong>Note:</strong> This section lists Android Studio keyboard shortcuts
+for the default keymap. To change the default keymap on Windows and Linux, go to
+<strong>File</strong> &gt; <strong>Settings</strong> &gt; <strong>Keymap</strong>. To change
+the default keymap on Mac OS X, go to <strong>Android Studio</strong> &gt;
+<strong>Preferences</strong> &gt; <strong>Keymap</strong>.</p>
+
 <h3>Creating virtual devices</h3>
 
 <p>All the capabilities of the <a href="{@docRoot}tools/devices/managing-avds.html">Android
@@ -75,10 +81,11 @@
 <h3>Creating new files</h3>
 
 <p>You can quickly add new code and resource files by clicking the appropriate directory in the
-<strong>Project</strong> pane and pressing CTRL + N (CMD + N, on Mac). Based on the type of
-directory selected, Android Studio offers to create the appropriate file type.</p>
+<strong>Project</strong> pane and pressing ALT + INSERT on Windows and Linux or COMMAND + N on Mac.
+Based on the type of directory selected, Android Studio offers to create the appropriate file
+type.</p>
 
-<p>For example, if you select a layout directory, press CTRL + N, and select
+<p>For example, if you select a layout directory, press ALT + INSERT on Windows, and select
 <strong>Layout resource file</strong>, a dialog opens so you can name the file (you can exclude
 the {@code .xml} suffix) and choose a root view element. The editor then switches to the layout
 design editor so you can begin designing your layout.</p>
diff --git a/docs/html/sdk/installing/studio.jd b/docs/html/sdk/installing/studio.jd
index 3b7a7da..ee14b19 100644
--- a/docs/html/sdk/installing/studio.jd
+++ b/docs/html/sdk/installing/studio.jd
@@ -234,7 +234,7 @@
 
 
 <h4 style="margin-top: 20px;"><a href='' class="expandable"
-  onclick="toggleExpandable(this,'.pax');return false;"
+  onclick="toggleExpandable(this,'.pax');hideExpandable('.reqs');return false;"
   >VIEW ALL DOWNLOADS AND SIZES</a></h4>
 
 <div class="pax col-13 online" style="display:none;margin:0;">
@@ -251,42 +251,94 @@
     <td>Windows</td>
     <td>
   <a onclick="return onDownload(this)" id="win-studio"
-      href="http://dl.google.com/android/studio/install/0.8.0/android-studio-bundle-135.1245622-windows.exe">
-      android-studio-bundle-135.1245622-windows.exe
+      href="https://dl.google.com/android/studio/install/0.8.6/android-studio-bundle-135.1339820-windows.exe">
+      android-studio-bundle-135.1339820-windows.exe
       </a>
     </td>
-    <td>380000036 bytes</td>
-    <td>5720baef7d492f2df7398a38dae2fa92</td>
+    <td>379497130 bytes</td>
+    <td>024e002b8c8fa7dcd2ff69fd69e06e56</td>
   </tr>
 
   <tr>
     <td><nobr>Mac OS X</nobr></td>
     <td>
   <a onclick="return onDownload(this)" id="mac-studio"
-    href="http://dl.google.com/android/studio/install/0.8.0/android-studio-bundle-135.1245622-mac.dmg">
-    android-studio-bundle-135.1245622-mac.dmg
+    href="https://dl.google.com/android/studio/install/0.8.6/android-studio-bundle-135.1339820-mac.dmg">
+    android-studio-bundle-135.1339820-mac.dmg
     </a>
     </td>
-    <td>368451923 bytes</td>
-    <td>fa9da3625db44687576c5c4e8f96280e</td>
+    <td>368507143 bytes</td>
+    <td>4143f2aa556634eae91701965d88899b</td>
   </tr>
 
   <tr>
     <td>Linux</td>
     <td>
   <a onclick="return onDownload(this)" id="linux-studio"
-    href="http://dl.google.com/android/studio/install/0.8.0/android-studio-bundle-135.1245622-linux.tgz">
-    android-studio-bundle-135.1245622-linux.tgz
+    href="https://dl.google.com/android/studio/install/0.8.6/android-studio-bundle-135.1339820-linux.tgz">
+    android-studio-bundle-135.1339820-linux.tgz
     </a>
     </td>
-    <td>417756987 bytes</td>
-    <td>c70dd2e4035484b84f0ad0046a34f136</td>
+    <td>417631443 bytes</td>
+    <td>fa403762ecd0a5da87acbeff485f81cc</td>
   </tr>
   </table>
 
 </div><!-- end pax -->
 
 
+<h4 style="margin-top: 20px;"><a href='' class="expandable"
+  onclick="toggleExpandable(this,'.reqs');hideExpandable('.pax');return false;"
+  >SYSTEM REQUIREMENTS</a></h4>
+
+<div class="reqs col-13 online" style="display:none;margin:0;">
+<table>
+<tr>
+<th>Windows</th>
+<th style="width:40%">Mac OS</th>
+<th>Linux</th>
+</tr>
+<tr>
+<td>
+<ul>
+  <li>Microsoft Windows 8, 7, Vista, 2003, or XP (32 or 64 bit)</li>
+  <li>1 GB of RAM minimum, 2 GB recommended</li>
+  <li>400 MB of disk space</li>
+  <li>At least 1 GB of additional disk space for the Android SDK, emulator system images, and caches</li>
+  <li>1280x800 minimum screen resolution</li>
+  <li>Java Development Kit (JDK) 6 or higher</li>
+</ul>
+</td>
+<td>
+<ul>
+  <li>Mac OS X 10.5 or higher, up to 10.9 (Mavericks)</li>
+  <li>1 GB of RAM minimum, 2 GB recommended</li>
+  <li>400 MB of disk space</li>
+  <li>At least 1 GB of additional disk space for the Android SDK, emulator system images, and caches</li>
+  <li>1280x800 minimum screen resolution</li>
+  <li>Java Runtime Environment (JRE) 6 *</li>
+  <li>Java Development Kit (JDK) 6 or JDK 7</li>
+</ul>
+<p>* On Mac OS, run Android Studio with Java Runtime Environment (JRE) 6 for optimized font
+rendering. You can then configure your project to use Java Development Kit (JDK) 6 or JDK 7.</p>
+</td>
+<td>
+<ul>
+  <li>GNOME or KDE desktop</li>
+  <li>1 GB of RAM minimum, 2 GB recommended</li>
+  <li>400 MB of disk space</li>
+  <li>At least 1 GB of additional disk space for the Android SDK, emulator system images, and caches</li>
+  <li>1280x800 minimum screen resolution</li>
+  <li>Oracle Java Development Kit (JDK) 6 or JDK 7</li>
+</ul>
+</td>
+</tr>
+</table>
+<p class="note"><strong>Note:</strong> Java Development Kit (JDK) 7 is required if you're targeting
+the Android L Developer Preview.</p>
+</div><!-- end pax -->
+
+
 
 <h2 style="margin-bottom: 0px;">Android Studio vs. Eclipse ADT Comparison</h2>
 
@@ -398,6 +450,17 @@
 <div class="toggle-content opened">
   <p><a href="#" onclick="return toggleContent(this)">
     <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img"
+      alt=""/>Android Studio v0.8.6</a> <em>(August 2014)</em>
+  </p>
+
+  <div class="toggle-content-toggleme">
+    <p>See <a href="http://tools.android.com/recent">tools.android.com</a> for a full list of changes.</p>
+  </div>
+</div>
+
+<div class="toggle-content closed">
+  <p><a href="#" onclick="return toggleContent(this)">
+    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
       alt=""/>Android Studio v0.8.0</a> <em>(June 2014)</em>
   </p>
 
@@ -584,7 +647,7 @@
   if (os) {
     /* set up primary ACE download button */
     $('#download-ide-button').show();
-    $('#download-ide-button').append("Download Android Studio Beta <span class='small'>v0.8.0</span>"
+    $('#download-ide-button').append("Download Android Studio Beta <span class='small'>v0.8.6</span>"
         + "<br/> <span class='small'>with the Android SDK for " + os + "</span>");
     $('#download-ide-button').click(function() {return onDownload(this,true);}).attr('href', bundlename);
 
diff --git a/docs/html/tools/building/index.jd b/docs/html/tools/building/index.jd
index c64942f..c1f3019 100644
--- a/docs/html/tools/building/index.jd
+++ b/docs/html/tools/building/index.jd
@@ -79,3 +79,14 @@
     running on a device.</li>
   </ul>
 
+<p class="note"><b>Note:</b> Apps are limited to a 64K method reference limit. If your app reaches
+this limit, the build process outputs the following error message:
+
+<pre>Unable to execute dex: method ID not in [0, 0xffff]: 65536.</pre>
+
+To avoid this, you can
+<a href="http://android-developers.blogspot.com.es/2011/07/custom-class-loading-in-dalvik.html">load
+secondary dex files at runtime</a> and use
+<a href="http://developer.android.com/tools/help/proguard.html">ProGuard</a> to strip out unnecessary
+class references (Proguard only works when building in release mode).
+</p>
\ No newline at end of file
diff --git a/docs/html/tools/publishing/app-signing.jd b/docs/html/tools/publishing/app-signing.jd
index 1de1fd7..53e6e65 100644
--- a/docs/html/tools/publishing/app-signing.jd
+++ b/docs/html/tools/publishing/app-signing.jd
@@ -4,33 +4,26 @@
 <div id="qv-wrapper">
 <div id="qv">
 
-<h2>Quickview</h2>
-
-<ul>
-<li>All Android apps <em>must</em> be signed</li>
-<li>You can sign with a self-signed key</li>
-<li>How you sign your apps is critical &mdash; read this document carefully</li>
-<li>Determine your signing strategy early in the development process</li>
-</ul>
-
 <h2>In this document</h2>
 
 <ol>
-<li><a href="#signing">Signing Process</a></li>
-<li><a href="#strategies">Signing Strategies</a></li>
-<li><a href="#setup">Basic Setup for Signing</a></li>
-<li><a href="#debugmode">Signing in Debug Mode</a></li>
-<li><a href="#releasemode">Signing Release Mode</a>
-    <ol>
-    <li><a href="#cert">Obtain a suitable private key</a></li>
-    <li><a href="#releasecompile">Compile the application in release mode</a></li>
-    <li><a href="#signapp">Sign your application with your private key</a></li>
-    <li><a href="#align">Align the final APK package</a></li>
-    <li><a href="#ExportWizard">Compile and sign with Eclipse ADT</a></li>
-    </ol>
+<li><a href="#overview">Signing Overview</a>
+  <ol>
+  	<li><a href="#debug-mode">Signing in Debug Mode</a></li>
+  	<li><a href="#release-mode">Signing in Release Mode</a></li>
+  	<li><a href="#wear-apps">Signing Android Wear Apps</a></li>
+  </ol>
 </li>
+<li><a href="#studio">Signing Your App in Android Studio</a>
+  <ol>
+  	<li><a href="sign-auto">Automatically Signing Your App</a></li>
+  </ol>
+</li>
+<li><a href="#adt">Signing Your App with the ADT plugin for Eclipse</a></li>
+<li><a href="#considerations">Signing Considerations</a></li>
 <li><a href="#secure-key">Securing Your Private Key</a></li>
-
+<li><a href="#expdebug">Expiry of the Debug Certificate</a></li>
+<li><a href="#signing-manually">Signing Your App Manually</a></li>
 </ol>
 
 <h2>See also</h2>
@@ -43,588 +36,288 @@
 </div>
 </div>
 
-<p>The Android system requires that all installed applications be digitally signed with a
-certificate whose private key is held by the application's developer. The Android system uses the
-certificate as a means of identifying the author of an application and establishing trust
-relationships between applications. The certificate is not used to control which applications the
-user can install. The certificate does not need to be signed by a certificate authority: it is
-perfectly allowable, and typical, for Android applications to use self-signed certificates.</p>
 
-<p>The important points to understand about signing Android applications are:</p>
-
-<ul>
-  <li>All applications <em>must</em> be signed. The system will not install an application
-on an emulator or a device if it is not signed.</li>
-  <li>To test and debug your application, the build tools sign your application with a special debug
-    key that is created by the Android SDK build tools.</li>
-  <li>When you are ready to release your application for end-users, you must sign it with a suitable
-    private key. You cannot publish an application that is signed with the debug key generated
-    by the SDK tools.</li>
-  <li>You can use self-signed certificates to sign your applications. No certificate authority is
-    needed.</li>
-  <li>The system tests a signer certificate's expiration date only at install time. If an
-application's signer certificate expires after the application is installed, the application
-will continue to function normally.</li>
-  <li>You can use standard tools &mdash; Keytool and Jarsigner &mdash; to generate keys and
-sign your application {@code .apk} files.</li>
-  <li>After you sign your application for release, we recommend that you use the
-    <code>zipalign</code> tool to optimize the final APK package.</li>
-</ul>
-
-<p>The Android system will not install or run an application that is not signed appropriately. This
-applies wherever the Android system is run, whether on an actual device or on the emulator.
-For this reason, you must <a href="#setup">set up signing</a> for your application before you can
-run it or debug it on an emulator or device.</p>
-
-<h2 id="signing">Signing Process</h3>
-
-<p>The Android build process signs your application differently depending on which build mode you
-use to build your application. There are two build modes: <em>debug mode</em> and <em>release
-mode</em>. You use debug mode when you are developing and testing your application. You use
-release mode when you want to build a release version of your application that you can
-distribute directly to users or publish on an application marketplace such as Google Play.</p>
-
-<p>When you build in <em>debug mode</em> the Android SDK build tools use the Keytool utility
-(included in the JDK) to create a debug key. Because the SDK build tools created the debug key,
-they know the debug key's alias and password. Each time you compile your application in debug mode,
-the build tools use the debug key along with the Jarsigner utility (also included in the JDK) to
-sign your application's <code>.apk</code> file. Because the alias and password are known to the SDK
-build tools, the tools don't need to prompt you for the debug key's alias and password each time
-you compile.</p>
-
-<p>When you build in <em>release mode</em> you use your own private key to sign your application. If
-you don't have a private key, you can use the Keytool utility to create one for you. When you
-compile your application in release mode, the build tools use your private key along with the
-Jarsigner utility to sign your application's <code>.apk</code> file. Because the certificate and
-private key you use are your own, you must provide the password for the keystore and key alias.</p>
-
-<p>The debug signing process happens automatically when you run or debug your application using
-Eclipse with the ADT plugin. Debug signing also happens automatically when you use the Ant build
-script with the <code>debug</code> option. You can automate the release signing process by using the
-Eclipse Export Wizard or by modifying the Ant build script and building with the
-<code>release</code> option.</p>
-
-<h2 id="strategies">Signing Strategies</h2>
-
-<p>Some aspects of application signing may affect how you approach the development
-of your application, especially if you are planning to release multiple
-applications. </p>
-
-<p>In general, the recommended strategy for all developers is to sign
-all of your applications with the same certificate, throughout the expected
-lifespan of your applications. There are several reasons why you should do so: </p>
-
-<ul>
-<li>Application upgrade &ndash; As you release updates to your application, you
-must continue to sign the updates with the same certificate or set of certificates,
-if you want users to be able to upgrade seamlessly to the new version. When
-the system is installing an update to an application, it compares the
-certificate(s) in the new version with those in the existing version. If the
-certificates match exactly, including both the certificate data and order, then
-the system allows the update. If you sign the new version without using matching
-certificates, you must also assign a different package name to the
-application &mdash; in this case, the user installs the new version as a
-completely new application. </li>
-
-<li>Application modularity &ndash; The Android system allows applications that
-are signed by the same certificate to run in the same process, if the
-applications so requests, so that the system treats them as a single application.
-In this way you can deploy your application in modules, and users can update
-each of the modules independently if needed.</li>
-
-<li>Code/data sharing through permissions &ndash; The Android system provides
-signature-based permissions enforcement, so that an application can expose
-functionality to another application that is signed with a specified
-certificate. By signing multiple applications with the same certificate and
-using signature-based permissions checks, your applications can share code and
-data in a secure manner. </li>
-
-</ul>
-
-<p>Another important consideration in determining your signing strategy is
-how to set the validity period of the key that you will use to sign your
-applications.</p>
-
-<ul>
-<li>If you plan to support upgrades for a single application, you should ensure
-that your key has a validity period that exceeds the expected lifespan of
-that application. A validity period of 25 years or more is recommended.
-When your key's validity period expires, users will no longer be
-able to seamlessly upgrade to new versions of your application.</li>
-
-<li>If you will sign multiple distinct applications with the same key,
-you should ensure that your key's validity period exceeds the expected
-lifespan of <em>all versions of all of the applications</em>, including
-dependent applications that may be added to the suite in the future. </li>
-
-<li>If you plan to publish your application(s) on Google Play, the
-key you use to sign the application(s) must have a validity period
-ending after 22 October 2033. Google Play enforces this requirement
-to ensure that users can seamlessly upgrade applications when
-new versions are available. </li>
-</ul>
-
-<p>As you design your application, keep these points in mind and make sure to
-use a <a href="#cert">suitable certificate</a> to sign your applications. </p>
-
-<h2 id="setup">Basic Setup for Signing</h2>
-
-<p>Before you begin, make sure that the Keytool utility and Jarsigner utility are available to
-the SDK build tools. Both of these tools are available in the JDK. In most cases, you can tell
-the SDK build tools how to find these utilities by setting your <code>JAVA_HOME</code> environment
-variable so it references a suitable JDK. Alternatively, you can add the JDK version of Keytool and
-Jarsigner to your <code>PATH</code> variable.</p>
-
-<p>If you are developing on a version of Linux that originally came with GNU Compiler for
-Java, make sure that the system is using the JDK version of Keytool, rather than the gcj
-version. If Keytool is already in your <code>PATH</code>, it might be pointing to a symlink at
-<code>/usr/bin/keytool</code>. In this case, check the symlink target to be sure it points
-to the Keytool in the JDK.</p>
-
-<h2 id="debugmode">Signing in Debug Mode</h2>
-
-<p>The Android build tools provide a debug signing mode that makes it easier for you
-to develop and debug your application, while still meeting the Android system
-requirement for signing your APK.
-When using debug mode to build your app, the SDK tools invoke Keytool to automatically create
-a debug keystore and key. This debug key is then used to automatically sign the APK, so
-you do not need to sign the package with your own key.</p>
-
-<p>The SDK tools create the debug keystore/key with predetermined names/passwords:</p>
-<ul>
-<li>Keystore name: "debug.keystore"</li>
-<li>Keystore password: "android"</li>
-<li>Key alias: "androiddebugkey"</li>
-<li>Key password: "android"</li>
-<li>CN: "CN=Android Debug,O=Android,C=US"</li>
-</ul>
-
-<p>If necessary, you can change the location/name of the debug keystore/key or
-supply a custom debug keystore/key to use. However, any custom debug
-keystore/key must use the same keystore/key names and passwords as the default
-debug key (as described above). (To do so in Eclipse/ADT, go to
-<strong>Windows</strong> &gt; <strong>Preferences</strong> &gt;
-<strong>Android</strong> &gt; <strong>Build</strong>.) </p>
-
-<p class="caution"><strong>Caution:</strong> You <em>cannot</em> release your application
-to the public when signed with the debug certificate.</p>
-
-<h3>Eclipse Users</h3>
-
-<p>If you are developing in Eclipse/ADT (and have set up Keytool and Jarsigner as described above in
-<a href="#setup">Basic Setup for Signing</a>),
-signing in debug mode is enabled by default. When you run or debug your
-application, ADT signs the {@code .apk} file with the debug certificate, runs {@code zipalign} on
-the package, then installs it on
-the selected emulator or connected device. No specific action on your part is needed,
-provided ADT has access to Keytool.</p>
-
-<h3>Ant Users</h3>
-
-<p>If you are using Ant to build your {@code .apk} file, debug signing mode
-is enabled by using the <code>debug</code> option with the <code>ant</code> command
-(assuming that you are using a <code>build.xml</code> file generated by the
-<code>android</code> tool). When you run <code>ant debug</code> to
-compile your app, the build script generates a keystore/key and signs the APK for you.
-The script then also aligns the APK with the <code>zipalign</code> tool.
-No other action on your part is needed. Read
-<a href="{@docRoot}tools/building/building-cmdline.html#DebugMode">Building and Running Apps
-on the Command Line</a> for more information.</p>
+<p>Android requires that all apps be digitally signed with a certificate before they can be
+installed. Android uses this certificate to identify the author of an app, and the certificate
+does not need to be signed by a certificate authority. Android apps often use self-signed
+certificates. The app developer holds the certificate's private key.</p>
 
 
-<h3 id="debugexpiry">Expiry of the Debug Certificate</h3>
+<h2 id="overview">Signing Overview</h2>
 
-<p>The self-signed certificate used to sign your application in debug mode (the default on
-Eclipse/ADT and Ant builds) will have an expiration date of 365 days from its creation date.</p>
+<p>You can sign an app in debug or release mode. You sign your app in debug mode during development
+and in release mode when you are ready to distribute your app. The Android SDK generates a
+certificate to sign apps in debug mode. To sign apps in release mode, you need to generate
+your own certificate.</p>
 
-<p>When the certificate expires, you will get a build error. On Ant builds, the error
-looks like this:</p>
+<h3 id="debug-mode">Signing in Debug Mode</h3>
 
-<pre>debug:
-[echo] Packaging bin/samples-debug.apk, and signing it with a debug key...
-[exec] Debug Certificate expired on 8/4/08 3:43 PM</pre>
+<p>In debug mode, you sign your app with a debug certificate generated by the Android SDK tools.
+This certificate has a private key with a known password, so you can run and debug your app
+without typing the password every time you make a change to your project.</p>
 
-<p>In Eclipse/ADT, you will see a similar error in the Android console.</p>
+<p>Android Studio and the ADT plugin for Eclipse sign your app in debug mode automatically when
+you run or debug your project from the IDE.</p>
 
-<p>To fix this problem, simply delete the <code>debug.keystore</code> file.
-The default storage location for AVDs is in <code>~/.android/</code> on OS X and Linux,
-in <code>C:\Documents and Settings\&lt;user>\.android\</code> on Windows XP, and in
-<code>C:\Users\&lt;user>\.android\</code> on Windows Vista and Windows 7.</p>
+<p>You can run and debug an app signed in debug mode on the emulator and on devices connected
+to your development manchine through USB, but you cannot distribute an app signed in debug
+mode.</p>
 
+<p>For more information about how to build and run apps in debug mode, see
+<a href="{@docRoot}tools/building/index.html">Building and Running</a>.</p>
 
-<p>The next time you build, the build tools will regenerate a new keystore and debug key.</p>
+<h3 id="release-mode">Signing in Release Mode</h3>
 
-<p>Note that, if your development machine is using a non-Gregorian locale, the build
-tools may erroneously generate an already-expired debug certificate, so that you get an
-error when trying to compile your application. For workaround information, see the
-troubleshooting topic <a href="{@docRoot}resources/faq/troubleshooting.html#signingcalendar">
-I&nbsp;can't&nbsp;compile my app because the build tools generated an expired debug
-certificate</a>. </p>
+<p>In release mode, you sign your app with your own certificate:</p>
 
-
-<h2 id="releasemode">Signing in Release Mode</h2>
-
-<p>When your application is ready for release to other users, you must:</p>
 <ol>
-  <li><a href="#cert">Obtain a suitable private key</a></li>
-  <li><a href="#releasecompile">Compile the application in release mode</a></li>
-  <li><a href="#signapp">Sign your application with your private key</a></li>
-  <li><a href="#align">Align the final APK package</a></li>
+<li><em>Create a keystore.</em> A <strong>keystore</strong> is a binary file that contains a
+set of private keys. You must keep your keystore in a safe and secure place.</li>
+<li><em>Create a private key.</em> A <strong>private key</strong> represents the entity to
+be identified with the app, such as a person or a company.</li>
+<li><em>Build your project</em>. Generate an unsigned APK for your app.</li>
+<li><em>Sign your app.</em> Use your private key to generate a signed version of your APK.</li>
 </ol>
 
-<p>If you are developing in Eclipse with the ADT plugin, you can use the Export Wizard
-to perform the compile, sign, and align procedures. The Export Wizard even allows you to
-generate a new keystore and private key in the process. So if you use Eclipse, you can
-skip to <a href="#ExportWizard">Compile and sign with Eclipse ADT</a>.</p>
+<p>After you complete this process, you can distribute your app and publish it on Google Play.</p>
 
-
-
-<h3 id="cert">1. Obtain a suitable private key</h3>
-
-<p>In preparation for signing your application, you must first ensure that
-you have a suitable private key with which to sign. A suitable private
-key is one that:</p>
-
-<ul>
-<li>Is in your possession</li>
-<li>Represents the personal, corporate, or organizational entity to be identified
-with the application</li>
-<li>Has a validity period that exceeds the expected lifespan of the application
-or application suite. A validity period of more than 25 years is recommended.
-<p>If you plan to publish your application(s) on Google Play, note that a
-validity period ending after 22 October 2033 is a requirement. You can not upload an
-application if it is signed with a key whose validity expires before that date.
-</p></li>
-<li>Is not the debug key generated by the Android SDK tools. </li>
-</ul>
-
-<p>The key may be self-signed. If you do not have a suitable key, you must
-generate one using Keytool. Make sure that you have Keytool available, as described
-in <a href="#setup">Basic Setup</a>.</p>
-
-<p>To generate a self-signed key with Keytool, use the <code>keytool</code>
-command and pass any of the options listed below (and any others, as
-needed). </p>
-
-<p class="warning"><strong>Warning:</strong> Keep your private key secure.
-Before you run Keytool, make sure to read
-<a href="#secure-key">Securing Your Private Key</a> for a discussion of how to keep
-your key secure and why doing so is critically important to you and to users. In
-particular, when you are generating your key, you should select strong passwords
-for both the keystore and key.</p>
-
-<p class="warning"><strong>Warning:</strong> Keep the keystore file you generate with Keytool
-in a safe, secure place. You must use the same key to sign future versions of your application. If
-you republish your app with a new key, Google Play will consider it a new app. For more information
-on settings that must remain constant over the life of your app, see the Android Developer Blog post
-<a href="http://android-developers.blogspot.com/2011/06/things-that-cannot-change.html">Things
-That Cannot Change</a>.</p>
-
-<table>
-<tr>
-<th>Keytool Option</th>
-<th>Description</th>
-</tr>
-<tr>
-<td><code>-genkey</code></td><td>Generate a key pair (public and private
-keys)</td>
-</tr>
-<tr>
-<td><code>-v</code></td><td>Enable verbose output.</td>
-</tr>
-<tr>
-<td><code>-alias &lt;alias_name&gt;</code></td><td>An alias for the key. Only
-the first 8 characters of the alias are used.</td>
-</tr>
-<tr>
-<td><code>-keyalg &lt;alg&gt;</code></td><td>The encryption algorithm to use
-when generating the key. Both DSA and RSA are supported.</td>
-</tr>
-<tr>
-<td><code>-keysize &lt;size&gt;</code></td><td>The size of each generated key
-(bits). If not supplied, Keytool uses a default key size of 1024 bits. In
-general, we recommend using a key size of 2048 bits or higher. </td>
-</tr>
-<tr>
-<td><code>-dname &lt;name&gt;</code></td><td><p>A Distinguished Name that describes
-who created the key. The value is used as the issuer and subject fields in the
-self-signed certificate. </p><p>Note that you do not need to specify this option
-in the command line. If not supplied, Jarsigner prompts you to enter each
-of the Distinguished Name fields (CN, OU, and so on).</p></td>
-</tr>
-<tr>
-<td><code>-keypass &lt;password&gt;</code></td><td><p>The password for the
-key.</p> <p>As a security precaution, do not include this option in your command
-line. If not supplied, Keytool prompts you to enter the password. In this way,
-your password is not stored in your shell history.</p></td>
-</tr>
-<tr>
-<td><code>-validity &lt;valdays&gt;</code></td><td><p>The validity period for the
-key, in days. </p><p><strong>Note:</strong> A value of 10000 or greater is recommended.</p></td>
-</tr>
-<tr>
-<td><code>-keystore&nbsp;&lt;keystore-name&gt;.keystore</code></td><td>A name
-for the keystore containing the private key.</td>
-</tr>
-<tr>
-<td><code>-storepass &lt;password&gt;</code></td><td><p>A password for the
-keystore.</p><p>As a security precaution, do not include this option in your
-command line. If not supplied, Keytool prompts you to enter the password. In
-this way, your password is not stored in your shell history.</p></td>
-</tr>
-</table>
-
-<p>Here's an example of a Keytool command that generates a private key:</p>
-
-<pre>$ keytool -genkey -v -keystore my-release-key.keystore
--alias alias_name -keyalg RSA -keysize 2048 -validity 10000</pre>
-
-<p>Running the example command above, Keytool prompts you to provide
-passwords for the keystore and key, and to provide the Distinguished
-Name fields for your key. It then generates the keystore as a file called
-<code>my-release-key.keystore</code>. The keystore and key are
-protected by the passwords you entered. The keystore contains
-a single key, valid for 10000 days. The alias is a name that you &mdash;
-will use later, to refer to this keystore when signing your application. </p>
-
-<p>For more information about Keytool, see the documentation at
-<a
-href="http://docs.oracle.com/javase/6/docs/technotes/tools/windows/keytool.html">
-http://docs.oracle.com/javase/6/docs/technotes/tools/windows/keytool.html</a></p>
-
-
-
-<h3 id="releasecompile">2. Compile the application in release mode</h3>
-
-<p>In order to release your application to users, you must compile it in release mode.
-In release mode, the compiled application is not signed by default and you will need
-to sign it with your private key.</p>
-
-<p class="caution"><strong>Caution:</strong>
-You can not release your application unsigned, or signed with the debug key.</p>
-
-<h4>With Eclipse</h4>
-
-<p>To export an <em>unsigned</em> APK from Eclipse, right-click the project in the Package
-Explorer and select <strong>Android Tools</strong> > <strong>Export Unsigned Application
-Package</strong>. Then specify the file location for the unsigned APK.
-(Alternatively, open your <code>AndroidManifest.xml</code> file in Eclipse, select
-the <strong>Manifest</strong> tab, and click <strong>Export an unsigned APK</strong>.)</p>
-
-<p>Note that you can combine the compiling and signing steps with the Export Wizard. See
-<a href="#ExportWizard">Compiling and signing with Eclipse ADT</a>.</p>
-
-<h4>With Ant</h4>
-
-<p>If you are using Ant, you can enable release mode by using the <code>release</code> option
-with the <code>ant</code> command. For example, if you are running Ant from the
-directory containing your {@code build.xml} file, the command would look like this:</p>
-
-<pre>$ ant release</pre>
-
-<p>By default, the build script compiles the application APK without signing it. The output file
-in your project {@code bin/} will be <code><em>&lt;your_project_name></em>-unsigned.apk</code>.
-Because the application APK is still unsigned, you must manually sign it with your private
-key and then align it using {@code zipalign}.</p>
-
-<p>However, the Ant build script can also perform the signing
-and aligning for you, if you have provided the path to your keystore and the name of
-your key alias in the project's {@code ant.properties} file. With this information provided,
-the build script will prompt you for your keystore and alias password when you perform
-<code>ant release</code>, it will sign the package and then align it. The final output
-file in {@code bin/} will instead be
-<code><em>&lt;your_project_name></em>-release.apk</code>. With these steps
-automated for you, you're able to skip the manual procedures below (steps 3 and 4).
-To learn how to specify your keystore and alias in the {@code ant.properties} file,
-see <a href="{@docRoot}tools/building/building-cmdline.html#ReleaseMode">
-Building and Running Apps on the Command Line</a>.</p>
-
-
-
-<h3 id="signapp">3. Sign your application with your private key</h3>
-
-<p>When you have an application package that is ready to be signed, you can do sign it
-using the Jarsigner tool. Make sure that you have Jarsigner available on your
-machine, as described in <a href="#setup">Basic Setup</a>. Also, make sure that
-the keystore containing your private key is  available.</p>
-
-<p>To sign your application, you run Jarsigner, referencing both the
-application's APK and the keystore containing the private key with which to
-sign the APK. The table below shows the options you could use. </p>
-
-<table>
-<tr>
-<th>Jarsigner Option</th>
-<th>Description</th>
-</tr>
-<tr>
-<td><code>-keystore&nbsp;&lt;keystore-name&gt;.keystore</code></td><td>The name of
-the keystore containing your private key.</td>
-</tr>
-<tr>
-<td><code>-verbose</code></td><td>Enable verbose output.</td>
-</tr>
-<tr>
-<td><code>-sigalg</code></td><td>The name of the signature algorithim to use in signing the APK.
-Use the value {@code SHA1withRSA}.</td>
-</tr>
-<tr>
-<td><code>-digestalg</code></td><td>The message digest algorithim to use in processing the entries
-of an APK. Use the value {@code SHA1}.</td>
-</tr>
-<tr>
-<td><code>-storepass &lt;password&gt;</code></td><td><p>The password for the
-keystore. </p><p>As a security precaution, do not include this option
-in your command line unless you are working at a secure computer.
-If not supplied, Jarsigner prompts you to enter the password. In this
-way, your password is not stored in your shell history.</p></td>
-</tr>
-<tr>
-<td><code>-keypass &lt;password&gt;</code></td><td><p>The password for the private
-key. </p><p>As a security precaution, do not include this option
-in your command line unless you are working at a secure computer.
-If not supplied, Jarsigner prompts you to enter the password. In this
-way, your password is not stored in your shell history.</p></td>
-</tr>
-</table>
-
-<p>Here's how you would use Jarsigner to sign an application package called
-<code>my_application.apk</code>, using the example keystore created above.
-</p>
-
-<pre>$ jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore
-my_application.apk alias_name</pre>
-
-<p>Running the example command above, Jarsigner prompts you to provide
-passwords for the keystore and key. It then modifies the APK
-in-place, meaning the APK is now signed. Note that you can sign an
-APK multiple times with different keys.</p>
-
-<p class="caution"><strong>Caution:</strong> As of JDK 7, the default signing algorithim has
-changed, requiring you to specify the signature and digest algorithims ({@code -sigalg} and {@code
--digestalg}) when you sign an APK.</p>
-
-<p>To verify that your APK is signed, you can use a command like this:</p>
-
-<pre>$ jarsigner -verify my_signed.apk</pre>
-
-<p>If the APK is signed properly, Jarsigner prints "jar verified".
-If you want more details, you can try one of these commands:</p>
-
-<pre>$ jarsigner -verify -verbose my_application.apk</pre>
-
-<p>or</p>
-
-<pre>$ jarsigner -verify -verbose -certs my_application.apk</pre>
-
-<p>The command above, with the <code>-certs</code> option added, will show you the
-"CN=" line that describes who created the key.</p>
-
-<p class="note"><strong>Note:</strong> If you see "CN=Android Debug", this means the APK was
-signed with the debug key generated by the Android SDK. If you intend to release
-your application, you must sign it with your private key instead of the debug
+<p class="warning"><strong>Warning:</strong> Keep your keystore and private key in a safe and
+secure place, and ensure that you have secure backups of them. If you publish an app to Google
+Play and then lose the key with which you signed your app, you will not be able to publish
+any updates to your app, since you must always sign all versions of your app with the same
 key.</p>
 
-<p>For more information about Jarsigner, see the documentation at
-<a href="http://docs.oracle.com/javase/6/docs/technotes/tools/windows/jarsigner.html">
-http://docs.oracle.com/javase/6/docs/technotes/tools/windows/jarsigner.html</a></p>
+<p>The rest of this document provides detailed instructions about how to generate a private
+key and sign your apps in release mode with Android Studio and with the ADT plugin for Eclipse.</p>
+
+<h3 id="wear-apps">Signing Android Wear Apps</h3>
+
+<p>When publishing Android Wear apps, you package the wearable app inside of a handheld app,
+because users cannot browse and install apps directly on the wearable. Both apps must be signed.
+For more information on packaging and signing Android Wear apps, see
+<a href="{@docRoot}training/wearables/apps/packaging.html">Packaging Wearable Apps</a>.</p>
 
 
-<h3 id="align">4. Align the final APK package</h3>
+<h2 id="studio">Signing Your App in Android Studio</h2>
 
-<p>Once you have signed the APK with your private key, run <code>zipalign</code> on the file.
-This tool ensures that all uncompressed data starts with a particular byte alignment,
-relative to the start of the file. Ensuring alignment at 4-byte boundaries provides
-a performance optimization when installed on a device. When aligned, the Android
-system is able to read files with {@code mmap()}, even if
-they contain binary data with alignment restrictions, rather than copying all
-of the data from the package. The benefit is a reduction in the amount of
-RAM consumed by the running application.</p>
-
-<p>The <code>zipalign</code> tool is provided with the Android SDK, inside the
-<code>tools/</code> directory. To align your signed APK, execute:</p>
-
-<pre>$ zipalign -v 4 <em>your_project_name</em>-unaligned.apk <em>your_project_name</em>.apk</pre>
-
-<p>The {@code -v} flag turns on verbose output (optional). {@code 4} is the
-byte-alignment (don't use anything other than 4). The first file argument is
-your signed {@code .apk} file (the input) and the second file is the destination {@code .apk} file
-(the output). If you're overriding an existing APK, add the {@code -f} flag.</p>
-
-<p class="caution"><strong>Caution:</strong> Your input APK must be signed with your
-private key <strong>before</strong> you optimize the package with {@code zipalign}.
-If you sign it after using {@code zipalign}, it will undo the alignment.</p>
-
-<p>For more information, read about the
-<a href="{@docRoot}tools/help/zipalign.html">zipalign</a> tool.
-
-
-<h3 id="ExportWizard">Compile and sign with Eclipse ADT</h3>
-
-<p>If you are using Eclipse with the ADT plugin, you can use the Export Wizard to
-export a <em>signed</em> APK (and even create a new keystore,
-if necessary). The Export Wizard performs all the interaction with
-the Keytool and Jarsigner for you, which allows you to sign the package using a GUI
-instead of performing the manual procedures to compile, sign,
-and align, as discussed above. Once the wizard has compiled and signed your package,
-it will also perfom package alignment with {@code zipalign}.
-Because the Export Wizard uses both Keytool and Jarsigner, you should
-ensure that they are accessible on your computer, as described above
-in the <a href="#setup">Basic Setup for Signing</a>.</p>
-
-<p>To create a signed and aligned APK in Eclipse:</p>
+<p>To sign your app in release mode in Android Studio, follow these steps:</p>
 
 <ol>
-  <li>Select the project in the Package
-Explorer and select <strong>File > Export</strong>.</li>
-  <li>Open the Android folder, select Export Android Application,
-  and click <strong>Next</strong>.
-  <p>The Export Android Application wizard now starts, which will
-  guide you through the process of signing your application,
-  including steps for selecting the private key with which to sign the APK
-  (or creating a new keystore and private key).</p>
-  <li>Complete the Export Wizard and your application will be compiled,
-  signed, aligned, and ready for distribution.</li>
+<li>On the menu bar, click <strong>Build</strong> &gt; <strong>Generate Signed APK</strong>.</li>
+<li><p>On the <em>Generate Signed APK Wizard</em> window, click <strong>Create new</strong> to create
+a new keystore.</p><p>If you already have a keystore, go to step 4.</p></li>
+<li><p>On the <em>New Key Store</em> window, provide the required information as shown
+in figure 1.</p><p>Your key should be valid for at least 25 years, so you can sign app updates
+with the same key through the lifespan of your app.</p>
+<img src="{@docRoot}images/tools/signstudio2.png" alt=""
+     width="416" height="364" style="margin-top:15px"/>
+<p class="img-caption"><strong>Figure 1</strong>. Create a new keystore in Android Studio.</p>
+</li>
+<li><p>On the <em>Generate Signed APK Wizard</em> window, select a keystore, a private key, and enter
+the passwords for both. Then click <strong>Next</strong>.</p>
+<img src="{@docRoot}images/tools/signstudio1.png" alt=""
+     width="349" height="232" style="margin-top:15px"/>
+<p class="img-caption"><strong>Figure 2</strong>. Select a private key in Android Studio.</p>
+</li>
+<li><p>On the next window, select a destination for the signed APK and click
+<strong>Finish</strong>.</p>
+<img src="{@docRoot}images/tools/signstudio3.png" alt=""
+     width="350" height="175" style="margin-top:15px"/>
+<p class="img-caption"><strong>Figure 3</strong>. Generate a signed APK in Android Studio.</p>
+</li>
 </ol>
 
+<h3 id="sign-auto">Automatically Signing Your App</h3>
+
+<p>In Android Studio, you can configure your project to sign your release APK automatically
+during the build process:</p>
+
+<ol>
+<li>On the project browser, right click on your app and select <strong>Open Module
+Settings</strong>.</li>
+<li>On the <em>Project Structure</em> window, select your app's module under <em>Modules</em>.</li>
+<li>Click on the <strong>Signing</strong> tab.</li>
+<li><p>Select your keystore file, enter a name for this signing configuration (as you may create
+more than one), and enter the required information.</p>
+<img src="{@docRoot}images/tools/signstudio10.png" alt=""
+     width="623" height="372" style="margin-top:15px"/>
+<p class="img-caption"><strong>Figure 4</strong>. Create a signing configuration in Android Studio.</p>
+</li>
+<li>Click on the <strong>Build Types</strong> tab.</li>
+<li>Select the <strong>release</strong> build.</li>
+<li><p>Under <em>Signing Config</em>, select the signing configuration you just created.</p>
+<img src="{@docRoot}images/tools/signstudio11.png" alt=""
+     width="623" height="372" style="margin-top:15px"/>
+<p class="img-caption"><strong>Figure 5</strong>. Select a signing configuration in Android Studio.</p>
+</li>
+<li>Click <strong>OK</strong>.</li>
+</ol>
+
+<p>You can also specify your signing settings in Gradle configuration files. For more information,
+see <a href="{@docRoot}sdk/installing/studio-build.html#configureSigning">Signing settings</a>.</p>
+
+
+<h2 id="adt">Signing Your App with the ADT Plugin for Eclipse</h2>
+
+<p>To sign your app in release mode in ADT, follow these steps:</p>
+
+<ol>
+<li>Select the project in the Package Explorer and select <strong>File</strong> >
+<strong>Export</strong>.</li>
+<li>On the <em>Export</em> window, select <strong>Export Android Application</strong> and click
+<strong>Next</strong>.</li>
+<li>On the <em>Export Android Application</em> window, select the project you want to sign and
+click <strong>Next</strong>.</li>
+<li>
+<p>On the next window, enter the location to create a keystore and a keystore password. If you
+already have a keystore, select <strong>Use existing keystore</strong>, enter your keystore's
+location and password, and go to step 6.</p>
+<img src="{@docRoot}images/tools/signadt3.png" alt=""
+     width="488" height="270" style="margin-top:15px"/>
+<p class="img-caption"><strong>Figure 6</strong>. Select a keystore in ADT.</p>
+</li>
+<li><p>On the next window, provide the required information as shown in figure 5.<p>
+<p>Your key should be valid for at least 25 years, so you can sign app updates with the same key
+through the lifespan of your app.</p>
+<img src="{@docRoot}images/tools/signadt4.png" alt=""
+     width="488" height="448" style="margin-top:15px"/>
+<p class="img-caption"><strong>Figure 7</strong>. Create a private key in ADT.</p>
+</li>
+<li><p>On the next window, select the location to export the signed APK.</p>
+<img src="{@docRoot}images/tools/signadt5.png" alt=""
+     width="488" height="217" style="margin-top:15px"/>
+<p class="img-caption"><strong>Figure 8</strong>. Export the signed APK in ADT.</p>
+</li>
+</ol>
+
+
+<h2 id="considerations">Signing Considerations</h2>
+
+<p>You should sign all of your apps with the same certificate throughout the expected lifespan
+of your applications. There are several reasons why you should do so:</p>
+
+<ul>
+<li>App upgrade: When the system is installing an update to an app, it compares the certificate(s)
+in the new version with those in the existing version. The system allows the update if the
+certificates match. If you sign the new version with a different certificate, you must assign a
+different package name to the application&mdash;in this case, the user installs the new version as
+a completely new application.</li>
+<li>App modularity: Android allows apps signed by the same certificate to run in the same process,
+if the applications so requests, so that the system treats them as a single application. In this
+way you can deploy your app in modules, and users can update each of the modules independently.</li>
+<li>Code/data sharing through permissions: Android provides signature-based permissions
+enforcement, so that an app can expose functionality to another app that is signed with a
+specified certificate. By signing multiple apps with the same certificate and using
+signature-based permissions checks, your apps can share code and data in a secure manner.</li>
+</ul>
+
+<p>If you plan to support upgrades for an app, ensure that your key has a validity
+period that exceeds the expected lifespan of that app. A validity period of 25 years or more is
+recommended. When your key's validity period expires, users will no longer be able to seamlessly
+upgrade to new versions of your application.</p>
+
+<p>If you plan to publish your apps on Google Play, the key you use to sign these apps must have
+a validity period ending after 22 October 2033. Google Play enforces this requirement to ensure
+that users can seamlessly upgrade apps when new versions are available.</p>
 
 
 <h2 id="secure-key">Securing Your Private Key</h2>
 
-<p>Maintaining the security of your private key is of critical importance, both
-to you and to the user. If you allow someone to use your key, or if you leave
-your keystore and passwords in an unsecured location such that a third-party
-could find and use them, your authoring identity and the trust of the user
-are compromised. </p>
+<p>Maintaining the security of your private key is of critical importance, both to you and to
+the user. If you allow someone to use your key, or if you leave your keystore and passwords in
+an unsecured location such that a third-party could find and use them, your authoring identity
+and the trust of the user are compromised.</p>
 
-<p>If a third party should manage to take your key without your knowledge or
-permission, that person could sign and distribute applications that maliciously
-replace your authentic applications or corrupt them. Such a person could also
-sign and distribute applications under your identity that attack other
-applications or the system itself, or corrupt or steal user data. </p>
+<p>If a third party should manage to take your key without your knowledge or permission, that
+person could sign and distribute apps that maliciously replace your authentic apps or corrupt
+them. Such a person could also sign and distribute apps under your identity that attack
+other apps or the system itself, or corrupt or steal user data.</p>
 
-<p>Your private key is required for signing all future versions of your application. If you lose or
-misplace your key, you will not be able to publish updates to your existing application. You cannot
+<p>Your private key is required for signing all future versions of your app. If you lose or
+misplace your key, you will not be able to publish updates to your existing appn. You cannot
 regenerate a previously generated key.</p>
 
-<p>Your reputation as a developer entity depends on your securing your private
-key properly, at all times, until the key is expired. Here are some tips for
-keeping your key secure: </p>
+<p>Your reputation as a developer entity depends on your securing your private key properly, at
+all times, until the key is expired. Here are some tips for keeping your key secure:</p>
 
 <ul>
 <li>Select strong passwords for the keystore and key.</li>
-<li>When you generate your key with Keytool, <em>do not</em> supply the
-<code>-storepass</code> and <code>-keypass</code> options at the command line.
-If you do so, your passwords will be available in your shell history,
-which any user on your computer could access.</li>
-<li>Similarly, when signing your applications with Jarsigner,
-<em>do not</em> supply the <code>-storepass</code> and <code>-keypass</code>
-options at the command line. </li>
-<li>Do not give or lend anyone your private key, and do not let unauthorized
-persons know your keystore and key passwords.</li>
-<li>Keep the keystore file containing your private key that you <a href="#cert">generate with the
-Keytool</a> in a safe, secure place.</li>
+<li>Do not give or lend anyone your private key, and do not let unauthorized persons know your
+keystore and key passwords.</li>
+<li>Keep the keystore file containing your private key in a safe, secure place.</li>
 </ul>
 
-<p>In general, if you follow common-sense precautions when generating, using,
-and storing your key, it will remain secure. </p>
+<p>In general, if you follow common-sense precautions when generating, using, and storing
+your key, it will remain secure.</p>
+
+
+<h2 id="expdebug">Expiry of the Debug Certificate</h2>
+
+<p>The self-signed certificate used to sign your application in debug mode has an expiration date
+of 365 days from its creation date. When the certificate expires, you will get a build error.</p>
+
+<p>To fix this problem, simply delete the <code>debug.keystore</code> file. The default storage
+location is in <code>~/.android/</code> on OS X and Linux, in <code>C:\Documents and
+Settings\&lt;user&gt;\.android\</code> on Windows XP, and in
+<code>C:\Users\&lt;user&gt;\.android\</code> on Windows Vista and Windows 7.</p>
+
+<p>The next time you build, the build tools will regenerate a new keystore and debug key.</p>
+
+<p>Note that, if your development machine is using a non-Gregorian locale, the build tools may
+erroneously generate an already-expired debug certificate, so that you get an error when trying
+to compile your application. For workaround information, see the troubleshooting topic
+<a href="{@docRoot}resources/faq/troubleshooting.html#signingcalendar">I can't compile my app
+because the build tools generated an expired debug certificate</a>.</p>
+
+
+<h2 id="signing-manually">Signing Your App Manually</h2>
+
+<p>You do not need Android Studio or the ADT plugin for Eclipse to sign your app. You can sign
+your app from the command line using standard tools from the Android SDK and the JDK. To sign
+an app in release mode from the command line:</p>
+
+<ol>
+<li>
+  <p>Generate a private key using
+  <code><a href="http://docs.oracle.com/javase/6/docs/technotes/tools/solaris/keytool.html">keytool</a></code>.
+  For example:</p>
+<pre>
+$ keytool -genkey -v -keystore my-release-key.keystore
+-alias alias_name -keyalg RSA -keysize 2048 -validity 10000
+</pre>
+  <p>This example prompts you for passwords for the keystore and key, and to provide the
+  Distinguished Name fields for your key. It then generates the keystore as a file called
+  <code>my-release-key.keystore</code>. The keystore contains a single key, valid for 10000 days.
+  The alias is a name that you will use later when signing your app.</p>
+</li>
+<li style="margin-top:18px">
+  <p>Compile your app in release mode to obtain an unsigned APK.</p>
+</li>
+<li style="margin-top:18px">
+  <p>Sign your app with your private key using
+  <code><a href="http://docs.oracle.com/javase/6/docs/technotes/tools/windows/jarsigner.html">jarsigner</a></code>:
+  </p>
+<pre>
+$ jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1
+-keystore my-release-key.keystore my_application.apk alias_name
+</pre>
+  <p>This example prompts you for passwords for the keystore and key. It then modifies the APK
+  in-place to sign it. Note that you can sign an APK multiple times with different keys.</p>
+</li>
+<li style="margin-top:18px">
+  <p>Verify that your APK is signed. For example:</p>
+<pre>
+$ jarsigner -verify -verbose -certs my_application.apk
+</pre>
+</li>
+<li style="margin-top:18px">
+  <p>Align the final APK package using
+  <code><a href="{@docRoot}tools/help/zipalign.html">zipalign</a></code>.</p>
+<pre>
+$ zipalign -v 4 your_project_name-unaligned.apk your_project_name.apk
+</pre>
+  <p><code>zipalign</code> ensures that all uncompressed data starts with a particular byte
+  alignment relative to the start of the file, which reduces the amount of RAM consumed by an
+  app.</p>
+</li>
+</ol>
diff --git a/docs/html/tools/sdk/eclipse-adt.jd b/docs/html/tools/sdk/eclipse-adt.jd
index 5d04098..cf33200 100644
--- a/docs/html/tools/sdk/eclipse-adt.jd
+++ b/docs/html/tools/sdk/eclipse-adt.jd
@@ -56,6 +56,42 @@
 <div class="toggle-content opened">
   <p><a href="#" onclick="return toggleContent(this)">
     <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img"
+      alt=""/>ADT 23.0.3</a> <em>(August 2014)</em>
+  </p>
+
+  <div class="toggle-content-toggleme">
+<dl>
+  <dt>Dependencies:</dt>
+
+  <dd>
+    <ul>
+      <li>Java 7 or higher is required if you are targeting the L Developer Preview.</li>
+      <li>Java 1.6 or higher is required if you are targeting other releases.</li>
+      <li>Eclipse Indigo (Version 3.7.2) or higher is required.</li>
+      <li>This version of ADT is designed for use with
+        <a href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools r23.0.2</a>.
+        If you haven't already installed SDK Tools r23.0.2 into your SDK, use the
+        Android SDK Manager to do so.</li>
+    </ul>
+  </dd>
+
+  <dt>General Notes:</dt>
+  <dd>
+    <ul>
+      <li>Fixed an issue where ADT displayed a <code>NullPointerException</code> warning dialog
+          when a valid SDK was not configured. (<a href="http://b.android.com/73313">Issue
+          73313</a>)</li>
+      <li>Fixed a minor issue with RenderScript support.</li>
+      <li>Disabled APK compression.</li>
+    </ul>
+  </dd>
+</dl>
+</div>
+</div>
+
+<div class="toggle-content closed">
+  <p><a href="#" onclick="return toggleContent(this)">
+    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
       alt=""/>ADT 23.0.2</a> <em>(July 2014)</em>
   </p>
 
diff --git a/docs/html/tools/sdk/ndk/index.jd b/docs/html/tools/sdk/ndk/index.jd
index b77a72a..e75f451 100644
--- a/docs/html/tools/sdk/ndk/index.jd
+++ b/docs/html/tools/sdk/ndk/index.jd
@@ -2,59 +2,59 @@
 page.template=sdk
 
 
-ndk.mac64_download=android-ndk32-r10-darwin-x86_64.tar.bz2
-ndk.mac64_bytes=411610468
-ndk.mac64_checksum=3ce1fa3dbe7a188f5d2640fd2f7ca944
+ndk.mac64_download=android-ndk32-r10b-darwin-x86_64.tar.bz2
+ndk.mac64_bytes=413652124
+ndk.mac64_checksum=7ca4a84e9c56c38acdafb007e7cd33c5
 
-ndk.mac32_download=android-ndk32-r10-darwin-x86.tar.bz2
-ndk.mac32_bytes=404768263
-ndk.mac32_checksum=1824eec1f6749b6cb7bb306a3b924c33
+ndk.mac32_download=android-ndk32-r10b-darwin-x86.tar.bz2
+ndk.mac32_bytes=406998070
+ndk.mac32_checksum=db3626b2c5f3245d90e2724f7bcf4c3e
 
-ndk.linux64_download=android-ndk32-r10-linux-x86_64.tar.bz2
-ndk.linux64_bytes=420671390
-ndk.linux64_checksum=e3ff629d212a8106a43415862fa39baf
+ndk.linux64_download=android-ndk32-r10b-linux-x86_64.tar.bz2
+ndk.linux64_bytes=422237011
+ndk.linux64_checksum=5c0f301aa789a1a747d5d2aeb8c69ef3
 
-ndk.linux32_download=android-ndk32-r10-linux-x86.tar.bz2
-ndk.linux32_bytes=420078216
-ndk.linux32_checksum=8d9a5faa6e77b43bfae0f169079b21c4
+ndk.linux32_download=android-ndk32-r10b-linux-x86.tar.bz2
+ndk.linux32_bytes=421052081
+ndk.linux32_checksum=e8f55daa5c9de7ab79aaaf5d7d751b69
 
-ndk.win64_download=android-ndk32-r10-windows-x86_64.zip
-ndk.win64_bytes=529850429
-ndk.win64_checksum=b11f9239344f7c377ed5b627f0fb236e
+ndk.win64_download=android-ndk32-r10b-windows-x86_64.zip
+ndk.win64_bytes=531912027
+ndk.win64_checksum=e4dd2e0c6f38e3ad936c366bdf6b1d4e
 
-ndk.win32_download=android-ndk32-r10-windows-x86.zip
-ndk.win32_bytes=500135685
-ndk.win32_checksum=0a3c01147abba945cc4ef5837519ec97
+ndk.win32_download=android-ndk32-r10b-windows-x86.zip
+ndk.win32_bytes=502720425
+ndk.win32_checksum=9fa4f19bca7edd6eefa63fe788737987
 
 
 
-ndk.mac64_64_download=android-ndk64-r10-darwin-x86_64.tar.bz2
-ndk.mac64_64_bytes=327740247
-ndk.mac64_64_checksum=72561b27acc6192a2e81b345ea128a20
+ndk.mac64_64_download=android-ndk64-r10b-darwin-x86_64.tar.bz2
+ndk.mac64_64_bytes=346423776
+ndk.mac64_64_checksum=5bae7feed20ebf0762c0baefe6b84b6d
 
-ndk.mac32_64_download=android-ndk64-r10-darwin-x86.tar.bz2
-ndk.mac32_64_bytes=323736411
-ndk.mac32_64_checksum=5bbaf9d8051ba5d2c0fff74cfd87c374
+ndk.mac32_64_download=android-ndk64-r10b-darwin-x86.tar.bz2
+ndk.mac32_64_bytes=344052876
+ndk.mac32_64_checksum=4447049ac2b5877176b9b6b1cf3bcdb2
 
-ndk.linux64_64_download=android-ndk64-r10-linux-x86_64.tar.bz2
-ndk.linux64_64_bytes=339708042
-ndk.linux64_64_checksum=737290195583268b7fbff4aa56465ab6
+ndk.linux64_64_download=android-ndk64-r10b-linux-x86_64.tar.bz2
+ndk.linux64_64_bytes=358835298
+ndk.linux64_64_checksum=2aa12a0d9a70bcab83e42d010a685136
 
-ndk.linux32_64_download=android-ndk64-r10-linux-x86.tar.bz2
-ndk.linux32_64_bytes=338544906
-ndk.linux32_64_checksum=bea5d027baeb948cbff6af840d26b80d
+ndk.linux32_64_download=android-ndk64-r10b-linux-x86.tar.bz2
+ndk.linux32_64_bytes=358060577
+ndk.linux32_64_checksum=b77eb583626d8c7f5c11e49181fd5eac
 
-ndk.win64_64_download=android-ndk64-r10-windows-x86_64.zip
-ndk.win64_64_bytes=417411195
-ndk.win64_64_checksum=91879ec85539b45313a21b9526b911a8
+ndk.win64_64_download=android-ndk64-r10b-windows-x86_64.zip
+ndk.win64_64_bytes=437152652
+ndk.win64_64_checksum=df39185e6c5a4d72eb9fca3f9aaabc46
 
-ndk.win32_64_download=android-ndk64-r10-windows-x86.zip
-ndk.win32_64_bytes=396751892
-ndk.win32_64_checksum=f79070ace2cde9ebf6a2e2be4a61ac7a
+ndk.win32_64_download=android-ndk64-r10b-windows-x86.zip
+ndk.win32_64_bytes=417290468
+ndk.win32_64_checksum=0f0324cb11f04e8b2641e5422ee39c81
 
-ndk.debug_info_download=android-ndk-r10-cxx-stl-libs-with-debug-info.zip
-ndk.debug_info_bytes=253198908
-ndk.debug_info_checksum=c2a90c43d17dbb5f0609cc8237491788
+ndk.debug_info_download=android-ndk-r10b-cxx-stl-libs-with-debug-info.zip
+ndk.debug_info_bytes=227302317
+ndk.debug_info_checksum=bed1bb855a41bdb572a804dbf6d45aa6
 
 
 page.title=Android NDK
@@ -349,8 +349,7 @@
 <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 ndk" id="downloadForRealz" onclick="return
-onDownloadNdkForRealz(this);"></a></p>
+<p><a href="" class="button disabled ndk" id="downloadForRealz" onclick="return onDownloadNdkForRealz(this);"></a></p>
 </div>
 
 
@@ -358,15 +357,6 @@
 </div>
 </div>
 
-
-
-
-
-
-
-
-
-
  <div id="qv-wrapper">
     <div id="qv">
       <h2>In this document</h2>
@@ -419,7 +409,7 @@
 
 
 <p>With NDK revision 9 and higher, the release packages have been split to reduce download size.
-  The first download for each platform contains the default NDK toolchain. The second download
+  The first download for each platform contains the default NDK toolchain. The additional download
   contains legacy NDK toolchains for that platform, which is only required if you are not using
   the current, recommended toolchain for your NDK builds.</p>
 
@@ -427,10 +417,91 @@
 
 <p>The following sections provide information about releases of the NDK.</p>
 
+
 <div class="toggle-content opened">
  <p>
    <a href="#" onclick="return toggleContent(this)"> <img
      src="/assets/images/triangle-opened.png" class="toggle-content-img" alt=""
+   >Android NDK, Revision 10b</a> <em>(September 2014)</em>
+ </p>
+ <div class="toggle-content-toggleme">
+   <dl>
+
+        <dt>Important notes:</dt>
+     <dd>
+     <ul>
+      <li>Because of the 512MB size restriction on downloadable packages, the following 32-bit items are not in the 32-bit NDK download packages. Instead, they reside in the 64-bit ones:</li>
+      <ul>
+      <li>Android-L headers</li>
+      <li>GCC 4.9</li>
+      </ul>
+     <li>Currently, the only Renderscript support provided by the NDK is for 32-bit Renderscript with Android 4.4 (API level 19). You cannot build HelloComputeNDK (the only Renderscript sample) with any other combination of Renderscript (32- or 64-bit) and Android version.</li>
+     <li>To compile native-codec, you must use a 64-bit NDK package, which is where all the Android-L headers are located. </li>
+     </ul>
+     </dd>
+
+
+     <dt>Important bug fixes:</dt>
+     <dd>
+     <ul>
+     <li>Fixed gdb 7.6 in GCC 4.8/4.9. (Issues <a href="http://b.android.com/74112">74112</a> and <a href="http://b.android.com/74371">74371</a>.)</li>
+     <li>Fixed GCC 4.8/4.9 for x86, so that they no longer enable <code>-msse4.2</code> and <code>-mpopcnt</code> by default. (Issue <a href="http://b.android.com/73843">73843</a>.)</li>
+     </ul>
+     </dd>
+
+     <dt>Other bug fixes:</dt>
+     <dd>
+     <ul>
+     <li>Removed <code>stdio.h</code> from the <code>include-fixed/</code> directories of all versions of GCC. (Issue <a href="http://b.android.com/73728">73728</a>.)</li>
+     <li>Removed duplicate header files from the Windows packages in the <code>platforms/android-L/arch-*/usr/include/linux/netfilter*/</code> directories. (Issue <a href="https://code.google.com/p/android/issues/detail?id=73704">73704</a>.)</li>
+     <li>Fixed a problem that prevented Clang from building HelloComputeNDK.</li>
+     <li>Fixed atexit. (Issue <a href="http://b.android.com/66595">66595</a>.)</li>
+     <li>Made various fixes to the docs in <code>docs/</code> and <code>sources/third_party/googletest/README.NDK</code>. (Issue <a href="http://b.android.com/74069">74069</a>.)</li>
+     <li>Made the following fixes to the Android-L headers:</li>
+     <ol>
+     <li>Added the following functions to <code>ctype.h</code> and <code>wchar.h</code>: <code>dn_expand()</code>, <code>grantpt()</code>, <code> inet_nsap_addr()</code>, <code>inet_nsap_ntoa()</code>, <code>insque()</code>, <code>nsdispatch()</code>, <code>posix_openpt()</code>, <code>__pthread_cleanup_pop()</code>, <code>__pthread_cleanup_push()</code>, <code>remque()</code>, <code>setfsgid()</code>, <code>setfsuid()</code>, <code>splice()</code>, <code>tee()</code>, <code>twalk()</code> (Issue <a href = "http://b.android.com/73719">73719</a>), and 42 <code>*_l()</code> functions.</li>
+
+    <li>Renamed <code>cmsg_nxthdr</code> to <code>__cmsg_nxthdr</code>.</li>
+
+    <li>Removed <code>__libc_malloc_dispatch</code>.</li>
+
+    <li>Changed the <code>ptrace()</code> prototype to <code>long ptrace(int, ...);</code>.</li>
+
+    <li>Removed <code>sha1.h</code>.</li>
+
+    <li>Extended <code>android_dlextinfo</code> in <code>android/dlext.h</code>.</li>
+
+    <li>Annotated <code>__NDK_FPABI__</code> for functions receiving or returning float- or double-type values in <code>stdlib.h</code>, <code>time.h</code>, <code>wchar.h</code>, and <code>complex.h</code>.</li>
+    </ol>
+     </ul>
+     </dd>
+
+     <dt>Other changes:</dt>
+     <dd>
+     <ul>
+        <li>Updated <code>mipsel-linux-android-4.9</code> and <code>mips64el-linux-android-4.9</code>, implementing a new multilib directory layout, and providing support for gdb-7.7</li>
+        <li>Enhanced <code>cpu-features</code> to detect more arm64 features.  (Change list <a href="https://android-review.googlesource.com/#/c/100339">100339</a>.)</li>
+     </dd>
+     </ul>
+
+
+
+   </dl>
+ </div>
+</div>
+
+
+
+
+
+
+
+
+
+<div class="toggle-content closed">
+ <p>
+   <a href="#" onclick="return toggleContent(this)"> <img
+     src="/assets/images/triangle-closed.png" class="toggle-content-img" alt=""
    >Android NDK, Revision 10</a> <em>(July 2014)</em>
  </p>
  <div class="toggle-content-toggleme">
@@ -443,7 +514,7 @@
            <li>GCC 4.9 is the default compiler for 64-bit ABIs. Clang is currently version 3.4.
 <code>NDK_TOOLCHAIN_VERSION=clang</code>
       may not work for arm64-v8a and mips64.</li>
-           <li>Android API level L is the first level with 64-bit support.  Note that this API
+           <li>Android-L is the first level with 64-bit support.  Note that this API
 level is a temporary one, and only for L-preview. An actual API level number will replace it at
 L-release.</li>
            <li>This release includes now includes <code>all32</code> and <code>all64</code>
@@ -480,7 +551,7 @@
            <li>For ndk-build, enable 32-bit, GCC 4.9 building either by adding
 <code>NDK_TOOLCHAIN_VERSION=4.9</code> to <code>Application.mk</code>, or exporting it as an
 environment variable from the command line.</li>
-           <li>For a standalone toolchain, use the <code> --toolchain=</code> option in the
+           <li>For a standalone toolchain, use the <code>--toolchain=</code> option in the
 <code>make-standalone-toolchain.sh</code> script. For example: <code>--toolchain=arm-linux-androideabi-4.9.</code></li>
         </ul>
         <li>Upgraded GDB to version 7.6 in GCC 4.8/4.9 and x86*. Since GDB is still at version GDB-7.3.x in
diff --git a/docs/html/tools/support-library/features.jd b/docs/html/tools/support-library/features.jd
index 65148bf..78946ee 100644
--- a/docs/html/tools/support-library/features.jd
+++ b/docs/html/tools/support-library/features.jd
@@ -225,8 +225,7 @@
 
 <p>This library provides {@link android.support.v7.media.MediaRouter}, {@link
 android.support.v7.media.MediaRouteProvider}, and related media classes that
-support the <a href="https://developers.google.com/cast/">Google Cast
-developer preview</a>. </p>
+support <a href="https://developers.google.com/cast/docs/android_sender">Google Cast</a>. </p>
 
 <p>In general, the APIs in the v7 mediarouter library provide a means of
 controlling the routing of media channels and streams from the current device to
@@ -258,9 +257,8 @@
 
 <p class="caution">The v7 mediarouter library APIs introduced in Support Library
 r18 are subject to change in later revisions of the Support Library. At this
-time, we recommend using the library only in connection with the <a
-href="https://developers.google.com/cast/">Google Cast
-developer preview</a>. </p>
+time, we recommend using the library only in connection with <a
+href="https://developers.google.com/cast/docs/android_sender">Google Cast</a>. </p>
 
 
 <h2 id="v8">v8 Support Library</h2>
diff --git a/docs/html/tools/testing/testing_accessibility.jd b/docs/html/tools/testing/testing_accessibility.jd
index daf9b36..20948fa 100644
--- a/docs/html/tools/testing/testing_accessibility.jd
+++ b/docs/html/tools/testing/testing_accessibility.jd
@@ -179,7 +179,7 @@
 </p>
 
 <p>For more information about using TalkBack, see
-<a href="http://support.google.com/nexus/bin/answer.py?hl=en&answer=2700928">Use TalkBack</a>.</p>
+<a href="https://support.google.com/accessibility/android/topic/3529932">TalkBack</a>.</p>
 
 <h4 id="testing-ebt">Testing with Explore by Touch</h4>
 
@@ -207,8 +207,7 @@
 </ol>
 
 <p>For more information about using the Explore by Touch features, see
-<a href="http://support.google.com/nexus/bin/answer.py?hl=en&answer=2700722">Use Explore by
-Touch</a>.</p>
+<a href="https://support.google.com/accessibility/android/answer/6006598">Touch Exploration</a>.</p>
 
 <h3 id="test-navigation">Testing focus navigation</h3>
 
@@ -231,7 +230,7 @@
 
 <p>Gesture navigation is an accessibility navigation mode that allows users to navigate Android
   devices and applications using specific
-  <a href="http://support.google.com/nexus/bin/answer.py?hl=en&answer=2700718">gestures</a>. This
+  <a href="https://support.google.com/accessibility/android/answer/6006598">gestures</a>. This
   navigation mode is available on Android 4.1 (API Level 16) and higher.</p>
 
 <p class="note"><strong>Note:</strong> Accessibility gestures provide a different navigation path
@@ -248,8 +247,7 @@
 </ul>
 
 <p>For more information about using Explore by Touch accessibility gestures, see
-<a href="http://support.google.com/android/bin/topic.py?hl=en&topic=2492346">Accessibility
-gestures</a>.</p>
+<a href="https://support.google.com/accessibility/android/answer/6006598">Touch Exploration</a>.</p>
 
 <p class="note">
   <strong>Note:</strong> Accessibility services other than TalkBack may map accessibility gestures
diff --git a/docs/html/tools/tools_toc.cs b/docs/html/tools/tools_toc.cs
index 93e5976..8eb9cbf 100644
--- a/docs/html/tools/tools_toc.cs
+++ b/docs/html/tools/tools_toc.cs
@@ -24,6 +24,8 @@
           Creating a Project</a></li>
       <li><a href="<?cs var:toroot ?>sdk/installing/studio-tips.html">
           Tips and Tricks</a></li>
+      <li><a href="<?cs var:toroot ?>sdk/installing/studio-androidview.html">
+          Using the Android Project View</a></li>
       <li><a href="<?cs var:toroot ?>sdk/installing/studio-layout.html">
           Using the Layout Editor</a></li>
       <li><a href="<?cs var:toroot ?>sdk/installing/studio-build.html">
diff --git a/docs/html/training/articles/security-gms-provider.jd b/docs/html/training/articles/security-gms-provider.jd
new file mode 100644
index 0000000..0d3cf1e
--- /dev/null
+++ b/docs/html/training/articles/security-gms-provider.jd
@@ -0,0 +1,298 @@
+page.title=Updating Your Security Provider to Protect Against SSL Exploits
+page.tags="network","certificates"
+
+page.article=true
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+<h2>In this document</h2>
+<ol class="nolist">
+  <li><a href="#patching">Patching the Security Provider with
+      ProviderInstaller</a></li>
+  <li><a href="#example_sync">Patching Synchronously</a></li>
+  <li><a href="#example_async">Patching Asynchronously</a></li>
+
+</ol>
+
+
+<h2>See also</h2>
+<ul>
+  <li><a href="{@docRoot}google/play-services/">Google Play Services</a></li>
+  <li><a href="https://www.openssl.org/news/secadv_20140605.txt">OpenSSL
+   Security Advisory [05 Jun 2014]: SSL/TLS MITM vulnerability
+   (CVE-2014-0224)</a></li>
+  <li><a href="http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-0224">
+    Vulnerability Summary for CVE-2014-0224</a></li>
+</ul>
+</div>
+</div>
+
+
+<p> Android relies on a security {@link java.security.Provider Provider} to
+provide secure network communications. However, from time to time,
+vulnerabilities are found in the default security provider. To protect against
+these vulnerabilities, <a href="{@docRoot}google/play-services/">Google Play
+services</a> provides a way to automatically update a device's security provider
+to protect against known exploits. By calling Google Play services methods, your
+app can ensure that it's running on a device that has the latest updates to
+protect against known exploits.</p>
+
+<p>For example, a vulnerability was discovered in OpenSSL
+(<a href="http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-0224">CVE-2014-0224</a>)
+that can leave apps open to a "man-in-the-middle" attack that decrypts
+secure traffic without either side knowing. With Google Play services version
+5.0, a fix is available, but apps must ensure that this fix is installed. By
+using the Google Play services methods, your app can ensure that it's running
+on a device that's secured against that attack.</p>
+
+<p class="caution"><strong>Caution: </strong>Updating a device's security {@link
+java.security.Provider Provider} does <em>not</em> update {@link
+android.net.SSLCertificateSocketFactory
+android.net.SSLCertificateSocketFactory}. Rather than using this class, we
+encourage app developers to use high-level methods for interacting with
+cryptography. Most apps can use APIs like {@link
+javax.net.ssl.HttpsURLConnection}, {@link org.apache.http.client.HttpClient},
+and {@link android.net.http.AndroidHttpClient} without needing to set a custom
+{@link javax.net.ssl.TrustManager} or create an {@link
+android.net.SSLCertificateSocketFactory}.</p>
+
+<h2 id="patching">Patching the Security Provider with ProviderInstaller</h2>
+
+<p>To update a device's security provider, use the
+<a href="{@docRoot}reference/com/google/android/gms/security/ProviderInstaller.html">{@code ProviderInstaller}</a>
+class. You can verify that the security provider is up-to-date (and update it,
+if necessary) by calling
+that class's <a href="{@docRoot}reference/com/google/android/gms/security/ProviderInstaller.html##installIfNeeded(android.content.Context)">{@code installIfNeeded()}</a>
+(or <a href="{@docRoot}reference/com/google/android/gms/security/ProviderInstaller.html#installIfNeededAsync(android.content.Context, com.google.android.gms.security.ProviderInstaller.ProviderInstallListener)">{@code installIfNeededAsync()}</a>)
+method.</p>
+
+<p>When you call <a href="{@docRoot}reference/com/google/android/gms/security/ProviderInstaller.html##installIfNeeded(android.content.Context)">{@code installIfNeeded()}</a>, the
+<a href="{@docRoot}reference/com/google/android/gms/security/ProviderInstaller.html">{@code ProviderInstaller}</a>
+does the following:</p>
+
+<ul>
+  <li>If the device's {@link java.security.Provider Provider} is successfully
+    updated (or is already up-to-date), the method returns normally.</li>
+  <li>If the device's Google Play services library is out of date, the method
+    throws
+    <a href="{@docRoot}reference/com/google/android/gms/common/GooglePlayServicesRepairableException.html">{@code GooglePlayServicesRepairableException}</a>.
+    The app can then catch this exception and show
+    the user an appropriate dialog box to update Google Play services.</li>
+    <li>If a non-recoverable error occurs, the method throws
+    <a href="{@docRoot}reference/com/google/android/gms/common/GooglePlayServicesNotAvailableException.html">{@code GooglePlayServicesNotAvailableException}</a>
+    to indicate that it is unable to update the {@link java.security.Provider
+    Provider}. The app can then catch the exception and choose an appropriate
+    course of action, such as displaying the standard
+    <a href="{@docRoot}reference/com/google/android/gms/common/SupportErrorDialogFragment.html">fix-it flow diagram</a>.</li>
+</ul>
+
+<p>The
+<a href="{@docRoot}reference/com/google/android/gms/security/ProviderInstaller.html#installIfNeededAsync(android.content.Context, com.google.android.gms.security.ProviderInstaller.ProviderInstallListener)">{@code installIfNeededAsync()}</a>
+method behaves similarly, except that instead of
+throwing exceptions, it calls the appropriate callback method to indicate
+success or failure.</p>
+
+<p>If <a href="{@docRoot}reference/com/google/android/gms/security/ProviderInstaller.html##installIfNeeded(android.content.Context)">{@code installIfNeeded()}</a>
+needs to install a new {@link java.security.Provider Provider}, this can take
+anywhere from 30-50 milliseconds (on more recent devices) to 350 ms (on older
+devices). If the security provider is already up-to-date, the method takes a
+negligible amount of time. To avoid affecting user experience:</p>
+
+<ul>
+  <li>Call
+  <a href="{@docRoot}reference/com/google/android/gms/security/ProviderInstaller.html##installIfNeeded(android.content.Context)">{@code installIfNeeded()}</a>
+  from background networking threads immediately when the threads are loaded,
+  instead of waiting for the thread to try to use the network. (There's no harm
+  in calling the method multiple times, since it returns immediately if the
+  security provider doesn't need updating.)</li>
+
+  <li>If user experience will be affected by the thread blocking--for example,
+  if the call is from an activity in the UI thread--call the asynchronous
+  version of the method,
+  <a href="{@docRoot}reference/com/google/android/gms/security/ProviderInstaller.html#installIfNeededAsync(android.content.Context, com.google.android.gms.security.ProviderInstaller.ProviderInstallListener)">{@code installIfNeededAsync()}</a>.
+  (Of course, if you do this, you need to wait for the operation to finish
+  before you attempt any secure communications. The
+  <a href="{@docRoot}reference/com/google/android/gms/security/ProviderInstaller.html">{@code ProviderInstaller}</a>
+  calls your listener's <a href="{@docRoot}reference/com/google/android/gms/security/ProviderInstaller.ProviderInstallListener.html#onProviderInstalled()">{@code onProviderInstalled()}</a>
+  method to signal success.)</li>
+</ul>
+
+<p class="warning"><strong>Warning:</strong> If the
+<a href="{@docRoot}reference/com/google/android/gms/security/ProviderInstaller.html">{@code ProviderInstaller}</a>
+is unable to install an updated {@link java.security.Provider Provider},
+your device's security provider might be vulnerable  to known exploits. Your app
+should behave as if all HTTP communication is unencrypted.</p>
+
+<p>Once the {@link java.security.Provider Provider} is updated, all calls to
+security APIs (including SSL APIs) are routed through it.
+(However, this does not apply to  {@link android.net.SSLCertificateSocketFactory
+android.net.SSLCertificateSocketFactory}, which remains vulnerable to such
+exploits as
+<a href="http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-0224">CVE-2014-0224</a>.)</p>
+
+<h2 id="example_sync">Patching Synchronously</h2>
+
+<p>The simplest way to patch the security provider is to call the synchronous
+method <a href="{@docRoot}reference/com/google/android/gms/security/ProviderInstaller.html##installIfNeeded(android.content.Context)">{@code installIfNeeded()}</a>.
+This is appropriate if user experience won't be affected by the thread blocking
+while it waits for the operation to finish.</p>
+
+<p>For example, here's an implementation of a <a href="{@docRoot}training/sync-adapters">sync adapter</a> that updates the security provider. Since a sync
+adapter runs in the background, it's okay if the thread blocks while waiting
+for the security provider to be updated. The sync adapter calls
+<a href="{@docRoot}reference/com/google/android/gms/security/ProviderInstaller.html##installIfNeeded(android.content.Context)">{@code installIfNeeded()}</a> to
+update the security provider. If the method returns normally, the sync adapter
+knows the security provider is up-to-date. If the method throws an exception,
+the sync adapter can take appropriate action (such as prompting the user to
+update Google Play services).</p>
+
+<pre>/**
+ * Sample sync adapter using {&#64;link ProviderInstaller}.
+ */
+public class SyncAdapter extends AbstractThreadedSyncAdapter {
+
+  ...
+
+  // This is called each time a sync is attempted; this is okay, since the
+  // overhead is negligible if the security provider is up-to-date.
+  &#64;Override
+  public void onPerformSync(Account account, Bundle extras, String authority,
+      ContentProviderClient provider, SyncResult syncResult) {
+    try {
+      ProviderInstaller.installIfNeeded(getContext());
+    } catch (GooglePlayServicesRepairableException e) {
+
+      // Indicates that Google Play services is out of date, disabled, etc.
+
+      // Prompt the user to install/update/enable Google Play services.
+      GooglePlayServicesUtil.showErrorNotification(
+          e.getConnectionStatusCode(), getContext());
+
+      // Notify the SyncManager that a soft error occurred.
+      syncResult.stats.numIOExceptions++;
+      return;
+
+    } catch (GooglePlayServicesNotAvailableException e) {
+      // Indicates a non-recoverable error; the ProviderInstaller is not able
+      // to install an up-to-date Provider.
+
+      // Notify the SyncManager that a hard error occurred.
+      syncResult.stats.numAuthExceptions++;
+      return;
+    }
+
+    // If this is reached, you know that the provider was already up-to-date,
+    // or was successfully updated.
+  }
+}</pre>
+
+<h2 id="example_async">Patching Asynchronously</h2>
+
+<p>Updating the security provider can take as much as 350 milliseconds (on
+older devices). If you're doing the update on a thread that directly affects
+user experience, such as the UI thread, you don't want to make a synchronous
+call to update the provider, since that can result in the app or device
+freezing until the operation finishes. Instead, you should use the asynchronous
+method
+<a href="{@docRoot}reference/com/google/android/gms/security/ProviderInstaller.html#installIfNeededAsync(android.content.Context, com.google.android.gms.security.ProviderInstaller.ProviderInstallListener)">{@code installIfNeededAsync()}</a>.
+That method indicates its success or failure by calling callbacks.</p>
+
+<p>For example, here's some code that updates the security provider in an
+activity in the UI thread. The activity calls <a href="{@docRoot}reference/com/google/android/gms/security/ProviderInstaller.html#installIfNeededAsync(android.content.Context, com.google.android.gms.security.ProviderInstaller.ProviderInstallListener)">{@code installIfNeededAsync()}</a>
+to update the provider, and designates itself as the listener to receive success
+or failure notifications. If the security provider is up-to-date or is
+successfully updated, the activity's
+<a href="{@docRoot}reference/com/google/android/gms/security/ProviderInstaller.ProviderInstallListener.html#onProviderInstalled()">{@code onProviderInstalled()}</a>
+method is called, and the activity knows communication is secure. If the
+provider cannot be updated, the activity's
+<a href="{@docRoot}reference/com/google/android/gms/security/ProviderInstaller.ProviderInstallListener.html#onProviderInstallFailed(int, android.content.Intent)">{@code onProviderInstallFailed()}</a>
+method is called, and the activity can take appropriate action (such as
+prompting the user to update Google Play services).</p>
+
+<pre>/**
+ * Sample activity using {&#64;link ProviderInstaller}.
+ */
+public class MainActivity extends Activity
+    implements ProviderInstaller.ProviderInstallListener {
+
+  private static final int ERROR_DIALOG_REQUEST_CODE = 1;
+
+  private boolean mRetryProviderInstall;
+
+  //Update the security provider when the activity is created.
+  &#64;Override
+  protected void onCreate(Bundle savedInstanceState) {
+    super.onCreate(savedInstanceState);
+    ProviderInstaller.installIfNeededAsync(this, this);
+  }
+
+  /**
+   * This method is only called if the provider is successfully updated
+   * (or is already up-to-date).
+   */
+  &#64;Override
+  protected void onProviderInstalled() {
+    // Provider is up-to-date, app can make secure network calls.
+  }
+
+  /**
+   * This method is called if updating fails; the error code indicates
+   * whether the error is recoverable.
+   */
+  &#64;Override
+  protected void onProviderInstallFailed(int errorCode, Intent recoveryIntent) {
+    if (GooglePlayServicesUtil.isUserRecoverableError(errorCode)) {
+      // Recoverable error. Show a dialog prompting the user to
+      // install/update/enable Google Play services.
+      GooglePlayServicesUtil.showErrorDialogFragment(
+          errorCode,
+          this,
+          ERROR_DIALOG_REQUEST_CODE,
+          new DialogInterface.OnCancelListener() {
+            &#64;Override
+            public void onCancel(DialogInterface dialog) {
+              // The user chose not to take the recovery action
+              onProviderInstallerNotAvailable();
+            }
+          });
+    } else {
+      // Google Play services is not available.
+      onProviderInstallerNotAvailable();
+    }
+  }
+
+  &#64;Override
+  protected void onActivityResult(int requestCode, int resultCode,
+      Intent data) {
+    super.onActivityResult(requestCode, resultCode, data);
+    if (requestCode == ERROR_DIALOG_REQUEST_CODE) {
+      // Adding a fragment via GooglePlayServicesUtil.showErrorDialogFragment
+      // before the instance state is restored throws an error. So instead,
+      // set a flag here, which will cause the fragment to delay until
+      // onPostResume.
+      mRetryProviderInstall = true;
+    }
+  }
+
+  /**
+   * On resume, check to see if we flagged that we need to reinstall the
+   * provider.
+   */
+  &#64;Override
+  protected void onPostResume() {
+    super.onPostResult();
+    if (mRetryProviderInstall) {
+      // We can now safely retry installation.
+      ProviderInstall.installIfNeededAsync(this, this);
+    }
+    mRetryProviderInstall = false;
+  }
+
+  private void onProviderInstallerNotAvailable() {
+    // This is reached if the provider cannot be updated for some reason.
+    // App should consider all HTTP communication to be vulnerable, and take
+    // appropriate action.
+  }
+}
+</pre>
diff --git a/docs/html/training/efficient-downloads/redundant_redundant.jd b/docs/html/training/efficient-downloads/redundant_redundant.jd
index 4bf9af9..674298a 100644
--- a/docs/html/training/efficient-downloads/redundant_redundant.jd
+++ b/docs/html/training/efficient-downloads/redundant_redundant.jd
@@ -30,8 +30,8 @@
 <p>The most fundamental way to reduce your downloads is to download only what you need. In terms of data, that means implementing REST APIs that allow you to specify query criteria that limit the returned data by using parameters such as the time of your last update.</p>
 
 <p>Similarly, when downloading images, it's good practice to reduce the size of the images server-side, rather than downloading full-sized images that are reduced on the client.</p>
- 
-<h2 id="LocalCache">Cache Files Locally</h2> 
+
+<h2 id="LocalCache">Cache Files Locally</h2>
 
 <p>Another important technique is to avoid downloading duplicate data. You can do this by aggressive caching. Always cache static resources, including on-demand downloads such as full size images, for as long as reasonably possible. On-demand resources should be stored separately to enable you to regularly flush your on-demand cache to manage its size.</p>
 
@@ -60,11 +60,11 @@
 
 <p>Alternatively, you can use the managed / secure application cache. Note that this internal cache may be flushed when the system is running low on available storage.</p>
 
-<pre>Context.getCache();</pre>
+<pre>Context.getCacheDir();</pre>
 
 <p>Files stored in either cache location will be erased when the application is uninstalled.</p>
 
-<h2 id="ResponseCache">Use the HttpURLConnection Response Cache</h2> 
+<h2 id="ResponseCache">Use the HttpURLConnection Response Cache</h2>
 
 <p>Android 4.0 added a response cache to {@code HttpURLConnection}. You can enable HTTP response caching on supported devices using reflection as follows:</p>
 
diff --git a/docs/html/training/game-controllers/controller-input.jd b/docs/html/training/game-controllers/controller-input.jd
index c9517ba..25fcde4 100644
--- a/docs/html/training/game-controllers/controller-input.jd
+++ b/docs/html/training/game-controllers/controller-input.jd
@@ -39,14 +39,15 @@
 {@link android.app.Activity} or focused {@link android.view.View} (you should
 implement the callbacks for either the {@link android.app.Activity} or
 {@link android.view.View}, but not both): </p>
-
 <ul>
 <li>From {@link android.app.Activity}:
     <ul>
-    <li>{@link android.app.Activity#dispatchGenericMotionEvent(android.view.MotionEvent) dispatchGenericMotionEvent(android.view.MotionEvent)}
+    <li>{@link android.app.Activity#dispatchGenericMotionEvent(android.view.MotionEvent)
+      dispatchGenericMotionEvent(android.view. MotionEvent)}
         <p>Called to process generic motion events such as joystick movements.</p>
     </li>
-    <li>{@link android.app.Activity#dispatchKeyEvent(android.view.KeyEvent) dispatchKeyEvent(android.view.KeyEvent)}
+    <li>{@link android.app.Activity#dispatchKeyEvent(android.view.KeyEvent)
+      dispatchKeyEvent(android.view.KeyEvent)}
         <p>Called to process key events such as a press or release of a
           gamepad or D-pad button.</p>
     </li>
@@ -244,16 +245,18 @@
       and {@link android.view.KeyEvent#KEYCODE_MENU}<sup>*</sup></td>
   </tr>
   <tr>
-    <td>Same as Android <em>Back</em></td>
+    <td>Same as Android <em>Back</em> navigation behavior described in the
+      <a href="{@docRoot}design/patterns/navigation.html">Navigation</a> design
+      guide.</td>
     <td>{@link android.view.KeyEvent#KEYCODE_BACK KEYCODE_BACK}</td>
   </tr>
   <tr>
     <td>Navigate back to a previous item in a menu</td>
-    <td>{@link android.view.KeyEvent#KEYCODE_BUTTON_B BUTTON_B}<sup>**</sup></td>
+    <td>{@link android.view.KeyEvent#KEYCODE_BUTTON_B BUTTON_B}</td>
   </tr>
   <tr>
     <td>Confirm selection, or perform primary game action</td>
-    <td>{@link android.view.KeyEvent#KEYCODE_BUTTON_A BUTTON_A}<sup>**</sup> and
+    <td>{@link android.view.KeyEvent#KEYCODE_BUTTON_A BUTTON_A} and
 {@link android.view.KeyEvent#KEYCODE_DPAD_CENTER DPAD_CENTER}</td>
   </tr>
 </table>
@@ -261,10 +264,6 @@
 <em>* Your game should not rely on the presence of the Start, Select, or Menu
   buttons.</em>
 </p>
-<p>
-<em>** This could be the opposite button (A/B), depending on the locale that
-you are supporting.</em>
-</p>
 
 <p class="note"><strong>Tip: </strong>Consider providing a configuration screen
 in your game to allow users to personalize their own game controller mappings for
@@ -309,41 +308,22 @@
 
     private static boolean isFireKey(int keyCode) {
         // Here we treat Button_A and DPAD_CENTER as the primary action
-        // keys for the game. You may need to switch this to Button_B and
-        // DPAD_CENTER depending on the user expectations for the locale
-        // in which your game runs.
+        // keys for the game.
         return keyCode == KeyEvent.KEYCODE_DPAD_CENTER
                 || keyCode == KeyEvent.KEYCODE_BUTTON_A;
     }
 }
 </pre>
 
-<p>Follow these best practices when handling button presses:</p>
-<ul>
-<li><strong>Provide localized button mappings.</strong> Generally, if your game
-has a primary gameplay action (for example, it fires lasers, lets your avatar
-do a high jump, or confirms an item selection), you should map
-both {@link android.view.KeyEvent#KEYCODE_DPAD_CENTER DPAD_CENTER} and
-{@link android.view.KeyEvent#KEYCODE_BUTTON_A BUTTON_A} to this action. However,
-in some locales, users may expect
-{@link android.view.KeyEvent#KEYCODE_BUTTON_B BUTTON_B} to be the confirm
-button and {@link android.view.KeyEvent#KEYCODE_BUTTON_A BUTTON_A} to be the
-back button instead. If you are supporting these locales, make sure to treat
-the A and B buttons accordingly in your game. To determine the user's locale,
-call the {@link java.util.Locale#getDefault()} method.
-<li><strong>Map {@link android.view.KeyEvent#KEYCODE_BUTTON_A BUTTON_A}
-consistently across different Android versions.</strong> On Android 4.2 (API
+<p class="note"><strong>Note: </strong>On Android 4.2 (API
 level 17) and lower, the system treats
 {@link android.view.KeyEvent#KEYCODE_BUTTON_A BUTTON_A} as the Android
 <em>Back</em> key by default. If your app supports these Android
 versions, make sure to treat
 {@link android.view.KeyEvent#KEYCODE_BUTTON_A BUTTON_A} as the primary game
-action (except in the localization case mentioned
-above). To determine the current Android SDK
+action. To determine the current Android SDK
 version on the device, refer to the
-{@link android.os.Build.VERSION#SDK_INT Build.VERSION.SDK_INT} value.
-</li>
-</ul>
+{@link android.os.Build.VERSION#SDK_INT Build.VERSION.SDK_INT} value.</p>
 
 <h2 id="dpad">Process Directional Pad Input</h2>
 <p>The 4-way directional pad (D-pad) is a common physical control in many game
@@ -424,7 +404,7 @@
             // UP and DOWN direction accordingly.
             else if (Float.compare(yaxis, -1.0f) == 0) {
                 directionPressed =  Dpad.UP;
-            } else if (Float.compare(yaxis, -1.0f) == 0) {
+            } else if (Float.compare(yaxis, 1.0f) == 0) {
                 directionPressed =  Dpad.DOWN;
             }
         }
diff --git a/docs/html/training/implementing-navigation/ancestral.jd b/docs/html/training/implementing-navigation/ancestral.jd
index 12d5005..f4d7c1a 100644
--- a/docs/html/training/implementing-navigation/ancestral.jd
+++ b/docs/html/training/implementing-navigation/ancestral.jd
@@ -133,7 +133,25 @@
 navigateUpFromSameTask()}. When you call this method, it finishes the current activity and
 starts (or resumes) the appropriate parent activity.
 If the target parent activity is in the task's back stack, it is brought
-forward as defined by {@link android.content.Intent#FLAG_ACTIVITY_CLEAR_TOP}.</p>
+forward. The way it is brought forward depends on whether the parent activity
+is able to handle an {@link
+android.app.Activity#onNewIntent onNewIntent()} call:</p>
+
+<ul>
+    <li>If the parent activity has launch mode <a
+    href="{@docRoot}guide/topics/manifest/activity-element.html#lmode">{@code
+    &lt;singleTop>}</a>, or the <code>up</code> intent contains {@link
+    android.content.Intent#FLAG_ACTIVITY_CLEAR_TOP}, the parent activity is
+    brought to the top of the stack, and receives the intent through its
+    {@link android.app.Activity#onNewIntent onNewIntent()} method.</li>
+
+    <li>If the parent activity has launch mode <a
+    href="{@docRoot}guide/topics/manifest/activity-element.html#lmode">{@code
+    &lt;standard>}</a>, and the <code>up</code> intent does not contain
+    {@link android.content.Intent#FLAG_ACTIVITY_CLEAR_TOP}, the parent activity
+    is popped off the stack, and a new instance of that activity is created on
+    top of the stack to receive the intent.</li>
+</ul>
 
 <p>For example:</p>
 
@@ -157,7 +175,6 @@
 navigating <em>Up</em> should create a new task that belongs to your app, which
 requires that you create a new back stack.</p>
 
-
 <h3 id="BuildBackStack">Navigate up with a new back stack</h3>
 
 <p>If your activity provides any <a
diff --git a/docs/html/training/location/retrieve-current.jd b/docs/html/training/location/retrieve-current.jd
index 99e475f..f079040 100644
--- a/docs/html/training/location/retrieve-current.jd
+++ b/docs/html/training/location/retrieve-current.jd
@@ -167,13 +167,12 @@
                     "Google Play services is available.");
             // Continue
             return true;
-        // Google Play services was not available for some reason
+        // Google Play services was not available for some reason.
+        // resultCode holds the error code.
         } else {
-            // Get the error code
-            int errorCode = connectionResult.getErrorCode();
             // Get the error dialog from Google Play services
             Dialog errorDialog = GooglePlayServicesUtil.getErrorDialog(
-                    errorCode,
+                    resultCode,
                     this,
                     CONNECTION_FAILURE_RESOLUTION_REQUEST);
 
diff --git a/docs/html/training/notepad/index.jd b/docs/html/training/notepad/index.jd
index d1aa221..507b232 100644
--- a/docs/html/training/notepad/index.jd
+++ b/docs/html/training/notepad/index.jd
@@ -17,13 +17,9 @@
 application. The exercises explain each step in detail and provide all the 
 sample code you need to complete the application. </p>
 
-<p>When you are finished with the tutorial, you will have created a functioning
+<p><p>When you are finished with the tutorial, you will have created a functioning
 Android application and will have learned many of the most important
-concepts in Android development. If you want to add more complex features to
-your application, you can examine the code in an alternative implementation
-of a Note Pad application, in the 
-<a href="{@docRoot}resources/samples/index.html">Sample Code</a> section. </p>
-
+concepts in Android development.</p>
 
 <a name="who"></a>
 <h2>Who Should Use this Tutorial</h2>
@@ -122,17 +118,13 @@
 <li>For a lighter but broader introduction to concepts not covered in the
 tutorial,
 take a look at <a href="{@docRoot}resources/faq/commontasks.html">Common Android Tasks</a>.</li>
-<li>The Android SDK includes a variety of fully functioning sample applications
-that make excellent opportunities for further learning. You can find the sample
-applications in the <code>samples/</code> directory of your downloaded SDK, or browser them
-here, in the <a href="{@docRoot}resources/samples/index.html">Sample Code</a> section.</li>
+
 <li>This tutorial draws from the full Notepad application included in the
-<code>samples/</code> directory of the SDK, though it does not match it exactly. 
-When you are done with the tutorial,
-it is highly recommended that you take a closer look at this version of the Notepad
-application, 
-as it demonstrates a variety of interesting additions for your application, 
-such as:</li>
+<code>samples/legacy/NotePad</code> directory of the SDK, though it does not
+match it exactly. When you are done with the tutorial, it is highly recommended
+that you take a closer look at this version of the Notepad application, as it
+demonstrates a variety of interesting additions for your application, such
+as:</li>
   <ul>
     <li>Setting up a custom striped list for the list of notes.</li>
     <li>Creating a custom text edit view that overrides the <code>draw()</code>
diff --git a/docs/html/training/sync-adapters/creating-stub-provider.jd b/docs/html/training/sync-adapters/creating-stub-provider.jd
index 8f6eba0..b8190d1 100644
--- a/docs/html/training/sync-adapters/creating-stub-provider.jd
+++ b/docs/html/training/sync-adapters/creating-stub-provider.jd
@@ -190,7 +190,7 @@
     &lt;provider
         android:name="com.example.android.datasync.provider.StubProvider"
         android:authorities="com.example.android.datasync.provider"
-        android:export="false"
+        android:exported="false"
         android:syncable="true"/&gt;
     ...
     &lt;/application&gt;
diff --git a/docs/html/training/sync-adapters/creating-sync-adapter.jd b/docs/html/training/sync-adapters/creating-sync-adapter.jd
index 7c59c8c..b13ce07 100644
--- a/docs/html/training/sync-adapters/creating-sync-adapter.jd
+++ b/docs/html/training/sync-adapters/creating-sync-adapter.jd
@@ -619,7 +619,7 @@
                 android:name="com.example.android.datasync.SyncService"
                 android:exported="true"
                 android:process=":sync"&gt;
-            &lt;intent-filter&gt;com.example.android.datasync.provider
+            &lt;intent-filter&gt;
                 &lt;action android:name="android.content.SyncAdapter"/&gt;
             &lt;/intent-filter&gt;
             &lt;meta-data android:name="android.content.SyncAdapter"
diff --git a/docs/html/training/training_toc.cs b/docs/html/training/training_toc.cs
index 4407d30..4dd57ab 100644
--- a/docs/html/training/training_toc.cs
+++ b/docs/html/training/training_toc.cs
@@ -1487,6 +1487,14 @@
           >Security with HTTPS and SSL</a>
       </li>
 
+      <li>
+        <a href="<?cs var:toroot ?>training/articles/security-gms-provider.html"
+           description=
+           "How to use and update Google Play services security provider, to
+           protect against SSL exploits."
+          >Updating Your Security Provider to Protect Against SSL Exploits</a>
+      </li>
+
       <li class="nav-section">
         <div class="nav-section-header">
           <a href="<?cs var:toroot ?>training/enterprise/index.html"
diff --git a/docs/html/training/volley/index.jd b/docs/html/training/volley/index.jd
index ba5b09f..97bddae 100644
--- a/docs/html/training/volley/index.jd
+++ b/docs/html/training/volley/index.jd
@@ -20,21 +20,6 @@
   <li>Android 1.6 (API Level 4) or higher</li>
 </ul>
 
-<h2>You should also see</h2>
-<ul>
-  <li>For a production quality app that uses Volley, see the 2013 Google I/O
-  <a href="https://github.com/google/iosched">schedule app</a>. In particular, see:
-    <ul>
-      <li><a
-      href="https://github.com/google/iosched/blob/master/android/src/main/java/com/google/android/apps/iosched/util/ImageLoader.java">
-      ImageLoader</a></li>
-      <li><a
-      href="https://github.com/google/iosched/blob/master/android/src/main/java/com/google/android/apps/iosched/util/BitmapCache.java">
-      BitmapCache</a></li>
-    </ul>
-  </li>
-</ul>
-
 </div>
 </div>
 
diff --git a/docs/html/training/wearables/apps/creating.jd b/docs/html/training/wearables/apps/creating.jd
index 49f8b0e7..7252ada 100644
--- a/docs/html/training/wearables/apps/creating.jd
+++ b/docs/html/training/wearables/apps/creating.jd
@@ -112,7 +112,7 @@
   name.</li>
   <li>In the <b>Form Factors</b> window:
     <ul>
-      <li>Select <b>Phone and Tablet</b> and select <b>API 8: Android 2.2 (Froyo)</b>
+      <li>Select <b>Phone and Tablet</b> and select <b>API 9: Android 2.3 (Gingerbread)</b>
       under <b>Minimum SDK</b>.</li>
       <li>Select <b>Wear</b> and select <b>API 20: Android 4.4 (KitKat Wear)</b>
       under <b>Minimum SDK</b>.</li>
@@ -161,8 +161,8 @@
 However, these dependencies are not required, so read the following descriptions to find out if you need them or not:</p>
 
 <b>Notifications</b>
-<p>The <a href="{@docRoot}tools/support-library/features.html#v4">The
-Android v4 support library</a> (or v13, which includes v4)
+<p>The <a href="{@docRoot}tools/support-library/features.html#v4">Android
+v4 support library</a> (or v13, which includes v4)
 contains the APIs to extend your existing notifications on handhelds to support wearables.</p>
 
 <p>For notifications that appear only on
diff --git a/docs/html/training/wearables/apps/packaging.jd b/docs/html/training/wearables/apps/packaging.jd
index 480f712..b538d6e 100644
--- a/docs/html/training/wearables/apps/packaging.jd
+++ b/docs/html/training/wearables/apps/packaging.jd
@@ -62,7 +62,7 @@
     release {
       ...
       signingConfig signingConfigs.release
-    }d
+    }
   }
   ...
 }
@@ -142,4 +142,4 @@
 </p>
 
 <p>Android Studio doesn't compress your APK by default, but if you are using another build process,
-ensure that you don't doubly compress the wearable app.</p>
\ No newline at end of file
+ensure that you don't doubly compress the wearable app.</p>
diff --git a/docs/html/training/wearables/apps/voice.jd b/docs/html/training/wearables/apps/voice.jd
index 3dea5d7..4aa8031 100644
--- a/docs/html/training/wearables/apps/voice.jd
+++ b/docs/html/training/wearables/apps/voice.jd
@@ -119,7 +119,7 @@
     <td>
       <dl>
         <dt>Action</dt>
-        <dd><code>android.provider.AlarmClock.ACTION_SET_TIMER</code></dd>
+        <dd><code>android.intent.action.SET_TIMER</code></dd>
         <dt>Extras</dt>
         <dd><code>android.provider.AlarmClock.EXTRA_LENGTH</code> - an integer in the range of
         1 to 86400 (number of seconds in 24 hours) representing the length of the timer </dd>
@@ -244,7 +244,7 @@
 
 In your app, you call {@link android.app.Activity#startActivityForResult startActivityForResult()} using
 the {@link android.speech.RecognizerIntent#ACTION_RECOGNIZE_SPEECH} action. This starts the
- and then handle the result
+speech recognition activity, and you can then handle the result
 in {@link android.app.Activity#onActivityResult onActivityResult()}.
 <pre>
 private static final int SPEECH_REQUEST_CODE = 0;
@@ -263,7 +263,7 @@
 &#64;Override
 protected void onActivityResult(int requestCode, int resultCode,
         Intent data) {
-    if (requestCode == SPEECH_REQUEST && resultCode == RESULT_OK) {
+    if (requestCode == SPEECH_REQUEST_CODE && resultCode == RESULT_OK) {
         List&lt;String&gt; results = data.getStringArrayListExtra(
                 RecognizerIntent.EXTRA_RESULTS);
         String spokenText = results.get(0);
@@ -271,4 +271,4 @@
     }
     super.onActivityResult(requestCode, resultCode, data);
 }
-</pre>
\ No newline at end of file
+</pre>
diff --git a/docs/html/training/wearables/data-layer/assets.jd b/docs/html/training/wearables/data-layer/assets.jd
index 52ccbb0..5dc11cb 100644
--- a/docs/html/training/wearables/data-layer/assets.jd
+++ b/docs/html/training/wearables/data-layer/assets.jd
@@ -91,7 +91,7 @@
   for (DataEvent event : dataEvents) {
     if (event.getType() == DataEvent.TYPE_CHANGED &&
         event.getDataItem().getUri().getPath().equals("/image")) {
-      DataMapItem dataMapItem = DataMapItem.fromDataItem(dataItem); 
+      DataMapItem dataMapItem = DataMapItem.fromDataItem(event.getDataItem());
       Asset profileAsset = dataMapItem.getDataMap().getAsset("profileImage");
       Bitmap bitmap = loadBitmapFromAsset(profileAsset);
       // Do something with the bitmap
diff --git a/docs/html/training/wearables/data-layer/events.jd b/docs/html/training/wearables/data-layer/events.jd
index 0146c4e..9e8acbc 100644
--- a/docs/html/training/wearables/data-layer/events.jd
+++ b/docs/html/training/wearables/data-layer/events.jd
@@ -43,7 +43,8 @@
     &#64;Override
     public void onResult(final DataItemResult result) {
         if(result.getStatus().isSuccess()) {
-        Log.d(TAG, "Data item set: " + result.getDataItem().getUri());
+            Log.d(TAG, "Data item set: " + result.getDataItem().getUri());
+        }
     }
 });
 </pre>
@@ -101,12 +102,12 @@
 <ul>
   <li><a href="{@docRoot}reference/com/google/android/gms/wearable/WearableListenerService.html#onDataChanged(com.google.android.gms.wearable.DataEventBuffer)"><code>onDataChanged()</code></a>
 - Called when data item objects are created, changed, or deleted. An event on one side of a connection
-triggers an this callback on both sides.</li>
+triggers this callback on both sides.</li>
   <li><a href="{@docRoot}reference/com/google/android/gms/wearable/WearableListenerService.html#onMessageReceived(com.google.android.gms.wearable.MessageEvent)"><code>onMessageReceived()</code></a>
 -  A message sent from one side of a connection triggers this callback on the other side of the connection.</li>
   <li><a href="{@docRoot}reference/com/google/android/gms/wearable/WearableListenerService.html#onMessageReceived(com.google.android.gms.wearable.MessageEvent)"><code>onPeerConnected()</code></a>
   and <a href="{@docRoot}reference/com/google/android/gms/wearable/WearableListenerService.html#onPeerDisconnected(com.google.android.gms.wearable.Node)"><code>onPeerDisconnected()</code></a> -
-  Called when connection with the handheld or wearable is connected or disconnected. 
+  Called when connection with the handheld or wearable is connected or disconnected.
   Changes in connection state on one side of the connection triggers these callbacks on both sides of the connection.
   </li>
 </ul>
@@ -173,7 +174,7 @@
         }
     }
 }
-</pre>  
+</pre>
 
 <p>Here's the corresponding intent filter in the Android manifest file:</p>
 
@@ -293,7 +294,7 @@
     &#64;Override
     protected void onStop() {
         if (null != mGoogleApiClient && mGoogleApiClient.isConnected()) {
-            Wearable.NodeApi.removeListener(mGoogleApiClient, this);
+            Wearable.DataApi.removeListener(mGoogleApiClient, this);
             mGoogleApiClient.disconnect();
         }
         super.onStop();
diff --git a/docs/html/training/wearables/data-layer/messages.jd b/docs/html/training/wearables/data-layer/messages.jd
index d0d5a0c..15e552d 100644
--- a/docs/html/training/wearables/data-layer/messages.jd
+++ b/docs/html/training/wearables/data-layer/messages.jd
@@ -95,5 +95,5 @@
 <p>
 This is just a snippet that requires more implementation details. Learn about
 how to implement a full listener service or activity in
-<a href="#listening">Listening for Data Layer Events</a>.
+<a href="{@docRoot}training/wearables/data-layer/events.html">Listening for Data Layer Events</a>.
 </p>
\ No newline at end of file
diff --git a/docs/html/training/wearables/notifications/creating.jd b/docs/html/training/wearables/notifications/creating.jd
index a61fa07..9398f96 100644
--- a/docs/html/training/wearables/notifications/creating.jd
+++ b/docs/html/training/wearables/notifications/creating.jd
@@ -33,7 +33,15 @@
 </div>
 
 <h2 id="Import">Import the necessary classes</h2>
-<p>Before you begin, import the necessary classes from the support library:</p>
+
+<p>To import the necessary packages, add this line to your <code>build.gradle</code>file:</p>
+
+<pre>
+compile "com.android.support:support-v4:20.0.+"
+</pre>
+
+<p>Now that your project has access to the necessary packages, import the necessary classes from
+the support library:</p>
 
 <pre style="clear:right">
 import android.support.v4.app.NotificationCompat;
@@ -190,7 +198,7 @@
 NotificationCompat.Builder notificationBuilder =
         new NotificationCompat.Builder(this)
         .setSmallIcon(R.drawable.ic_event)
-        .setLargeIcon(BitmapFractory.decodeResource(
+        .setLargeIcon(BitmapFactory.decodeResource(
                 getResources(), R.drawable.notif_background))
         .setContentTitle(eventTitle)
         .setContentText(eventLocation)
@@ -200,9 +208,12 @@
         <b>.setStyle(bigStyle);</b>
 </pre>
 
-<p>Notice that you can add a large background image to any notification using the
+<p>Notice that you can add a large icon image to any notification using the
 {@link android.support.v4.app.NotificationCompat.Builder#setLargeIcon setLargeIcon()}
-method. For more information about designing notifications with large images, see the
+method. However, these icons appear as large background images on a wearable and do not look
+good as they are scaled up to fit the wearable screen. To add a wearable-specific background image
+to a notification, see <a href="#AddWearableFeatures">Add Wearable Features For a Notification</a>.
+For more information about designing notifications with large images, see the
 <a href="{@docRoot}design/wear/index.html">Design Principles of Android
 Wear</a>.</p>
 
@@ -236,7 +247,8 @@
 // Create a WearableExtender to add functionality for wearables
 NotificationCompat.WearableExtender wearableExtender =
         new NotificationCompat.WearableExtender()
-        .setHintHideIcon(true);
+        .setHintHideIcon(true)
+        .setBackground(mBitmap);
 
 // Create a NotificationCompat.Builder to build a standard notification
 // then extend it with the WearableExtender
@@ -249,12 +261,21 @@
 </pre>
 
 <p>The
-  {@link android.support.v4.app.NotificationCompat.WearableExtender#setHintHideIcon setHintHideIcon()}
-  method is just one example of new notification features available with
-  {@link android.support.v4.app.NotificationCompat.WearableExtender}.
-</p>
+{@link android.support.v4.app.NotificationCompat.WearableExtender#setHintHideIcon setHintHideIcon()}
+and {@link android.support.v4.app.NotificationCompat.WearableExtender#setBackground setBackground()}
+methods are just two examples of new notification features available with
+{@link android.support.v4.app.NotificationCompat.WearableExtender}.</p>
 
-<p>If you ever need to read wearable-specifc options at a later time, use the corresponding get
+<p class="note"><strong>Note:</strong> The bitmap that you use with
+{@link android.support.v4.app.NotificationCompat.WearableExtender#setBackground setBackground()}
+should have a resolution of 400x400 for non-scrolling backgrounds and 640x400 for backgrounds
+that support parallax scrolling. Place these bitmap images in the <code>res/drawable-nodpi</code>
+directory of your handheld app. Place other non-bitmap resources for wearable notifications, such
+as those used with the
+{@link android.support.v4.app.NotificationCompat.WearableExtender#setContentIcon setContentIcon()}
+method, in the <code>res/drawable-hdpi</code> directory of your handheld app.</p>
+
+<p>If you ever need to read wearable-specific options at a later time, use the corresponding get
 method for the option. This example calls the
 {@link android.support.v4.app.NotificationCompat.WearableExtender#getHintHideIcon()} method to
 get whether or not this notification hides the icon:
@@ -264,6 +285,7 @@
 boolean hintHideIcon = wearableExtender.getHintHideIcon();
 </pre>
 
+
 <h2 id="Deliver">Deliver the Notification</h2>
 <p>When you want to deliver your notifications, always use the
   {@link android.support.v4.app.NotificationManagerCompat} API instead of
@@ -292,4 +314,4 @@
 <p>The {@link android.support.v4.app.NotificationCompat.WearableExtender} APIs allow you to add
 additional pages to notifications, stack notifications, and more. Continue to the following lessons
 to learn about these features.
-</p>
\ No newline at end of file
+</p>
diff --git a/docs/html/wear/images/partners/sony.png b/docs/html/wear/images/partners/sony.png
new file mode 100644
index 0000000..e097fbb
--- /dev/null
+++ b/docs/html/wear/images/partners/sony.png
Binary files differ
diff --git a/docs/html/wear/index.jd b/docs/html/wear/index.jd
index 5dd7690..c372395 100644
--- a/docs/html/wear/index.jd
+++ b/docs/html/wear/index.jd
@@ -228,6 +228,9 @@
             <div class="col-4">
               <img src="/wear/images/partners/samsung.png" alt="Samsung">
             </div>
+            <div class="col-4">
+              <img src="/wear/images/partners/sony.png" alt="Sony">
+            </div>
           </div>
         </div> <!-- end .wrap -->
       </div>