Merge "Android Training: Add Location Testing Lesson" into jb-mr2-docs
diff --git a/Android.mk b/Android.mk
index 8edc8c8..a6c2e9b 100644
--- a/Android.mk
+++ b/Android.mk
@@ -465,16 +465,30 @@
     frameworks/base/docs/knowntags.txt
 
 sample_dir := development/samples
+new_sample_dir := developers/samples/android
+
+# Whitelist of valid groups, used for default TOC grouping. Each sample must
+# belong to one (and only one) group. Assign samples to groups by setting
+# a sample.group var to one of these groups in the sample's _index.jd.
+sample_groups := -samplegroup Input \
+                 -samplegroup Sensors \
+                 -samplegroup Connectivity
 
 # the list here should match the list of samples included in the sdk samples package
 # (see development/build/sdk.atree)
 # remove htmlified samples for now -- samples are still available through the SDK
 web_docs_sample_code_flags := \
 		-hdf android.hasSamples 1 \
+		-samplecode $(new_sample_dir)/input/gestures/BasicGestureDetect/BasicGestureDetect \
+ 		            samples/BasicGestureDetect/ "Basic Gestures" \
 		-samplecode $(sample_dir)/AccelerometerPlay \
  		            samples/AccelerometerPlay "Accelerometer Play" \
 		-samplecode $(sample_dir)/ActionBarCompat \
- 		            samples/ActionBarCompat "Action Bar Compatibility"
+ 		            samples/ActionBarCompat "Action Bar Compatibility" \
+ 		-samplecode $(sample_dir)/BluetoothHDP \
+ 		            samples/BluetoothHDP "Bluetooth HDP Demo" \
+ 		-samplecode $(sample_dir)/BluetoothLeGatt \
+ 		            samples/BluetoothLeGatt "Bluetooth HDP Demo"
 #       -samplecode $(sample_dir)/AndroidBeamDemo \
 # 		            samples/AndroidBeamDemo "Android Beam Demo" \
 # 		-samplecode $(sample_dir)/ApiDemos \
@@ -487,8 +501,6 @@
 # 		            samples/BackupRestore "Backup and Restore" \
 #		-samplecode $(sample_dir)/BluetoothChat \
 # 		            samples/BluetoothChat "Bluetooth Chat" \
-# 		-samplecode $(sample_dir)/BluetoothHDP \
-# 		            samples/BluetoothHDP "Bluetooth HDP Demo" \
 # 		-samplecode $(sample_dir)/BusinessCard \
 # 		            samples/BusinessCard "Business Card" \
 # 		-samplecode $(sample_dir)/ContactManager \
@@ -654,13 +666,13 @@
 
 LOCAL_DROIDDOC_OPTIONS:=\
 		$(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
-                $(web_docs_sample_code_flags) \
-                -offlinemode \
+		-offlinemode \
 		-title "Android SDK" \
 		-proofread $(OUT_DOCS)/$(LOCAL_MODULE)-proofread.txt \
 		-todo $(OUT_DOCS)/$(LOCAL_MODULE)-docs-todo.html \
 		-sdkvalues $(OUT_DOCS) \
 		-hdf android.whichdoc offline
+#		$(web_docs_sample_code_flags)
 
 
 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=build/tools/droiddoc/templates-sdk
@@ -695,8 +707,9 @@
 LOCAL_DROIDDOC_OPTIONS:= \
 		$(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
 		-toroot / \
-		-hdf android.whichdoc online 
-#       $(web_docs_sample_code_flags)
+		-hdf android.whichdoc online
+#		$(sample_groups) \
+#		$(web_docs_sample_code_flags)
 
 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=build/tools/droiddoc/templates-sdk
 
@@ -720,11 +733,11 @@
 
 LOCAL_DROIDDOC_OPTIONS:= \
 		$(framework_docs_LOCAL_DROIDDOC_OPTIONS) \
-		$(web_docs_sample_code_flags) \
 		-devsite \
 		-toroot / \
 		-hdf android.whichdoc online \
 		-hdf devsite true
+#		$(web_docs_sample_code_flags)
 
 LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=build/tools/droiddoc/templates-sdk
 
diff --git a/core/java/android/view/GestureDetector.java b/core/java/android/view/GestureDetector.java
index 28c1058..6bbfe0f 100644
--- a/core/java/android/view/GestureDetector.java
+++ b/core/java/android/view/GestureDetector.java
@@ -323,7 +323,7 @@
 
     /**
      * Creates a GestureDetector with the supplied listener.
-     * You may only use this constructor from a UI thread (this is the usual situation).
+     * You may only use this constructor from a {@link android.os.Looper} thread.
      * @see android.os.Handler#Handler()
      *
      * @param context the application's context
@@ -337,14 +337,14 @@
     }
 
     /**
-     * Creates a GestureDetector with the supplied listener.
-     * You may only use this constructor from a UI thread (this is the usual situation).
+     * Creates a GestureDetector with the supplied listener that runs deferred events on the
+     * thread associated with the supplied {@link android.os.Handler}.
      * @see android.os.Handler#Handler()
      *
      * @param context the application's context
      * @param listener the listener invoked for all the callbacks, this must
      * not be null.
-     * @param handler the handler to use     
+     * @param handler the handler to use for running deferred listener events.
      *
      * @throws NullPointerException if {@code listener} is null.
      */
@@ -362,14 +362,15 @@
     }
     
     /**
-     * Creates a GestureDetector with the supplied listener.
-     * You may only use this constructor from a UI thread (this is the usual situation).
+     * Creates a GestureDetector with the supplied listener that runs deferred events on the
+     * thread associated with the supplied {@link android.os.Handler}.
      * @see android.os.Handler#Handler()
      *
      * @param context the application's context
      * @param listener the listener invoked for all the callbacks, this must
      * not be null.
-     * @param handler the handler to use
+     * @param handler the handler to use for running deferred listener events.
+     * @param unused currently not used.
      *
      * @throws NullPointerException if {@code listener} is null.
      */
diff --git a/docs/downloads/training/AndroidTestingFun.zip b/docs/downloads/training/AndroidTestingFun.zip
new file mode 100644
index 0000000..dca5812
--- /dev/null
+++ b/docs/downloads/training/AndroidTestingFun.zip
Binary files differ
diff --git a/docs/html/about/dashboards/index.jd b/docs/html/about/dashboards/index.jd
index 6e4a03c..ff19476 100644
--- a/docs/html/about/dashboards/index.jd
+++ b/docs/html/about/dashboards/index.jd
@@ -30,16 +30,20 @@
 <p>This page provides information about the relative number of devices that share a certain
 characteristic, such as Android version or screen size. This information may
 help you prioritize efforts for <a
-href="{@docRoot}training/basics/supporting-devices/index.html">supporting different devices</a>.</p>
+href="{@docRoot}training/basics/supporting-devices/index.html">supporting different devices</a>
+by revealing which devices are active in the Android and Google Play ecosystem.</p>
 
-<p>Each snapshot of data represents all the devices that visited the Google Play Store in the
-prior 14 days.</p>
+<p>This data reflects devices running the latest Google Play Store app, which is compatible
+with Android 2.2 and higher. Each snapshot of data represents all the devices that visited the
+Google Play Store in the prior 7 days.</p>
 
-<p class="note"><strong>Note:</strong> Beginning in April, 2013, these charts are now built
-using data collected from each device when the user visits the Google Play Store. Previously, the
-data was collected when the device simply checked-in to Google servers. We believe the new
-data more accurately reflects those users who are most engaged in the Android and Google Play
-ecosystem.</p>
+
+<div class="note">
+<p><strong>Note:</strong> Beginning in September, 2013, devices running versions older than Android
+2.2 do not appear in this data because those devices do not support the new Google Play Store
+app. Only the new app is able to measure the number of devices that actively visit Google Play Store
+and we believe this measurement best reflects your potential user-base.</p>
+</div>
 
 
 <h2 id="Platform">Platform Versions</h2>
@@ -57,10 +61,15 @@
 </div>
 
 
-<p style="clear:both"><em>Data collected during a 14-day period ending on August 1, 2013.
+<p style="clear:both"><em>Data collected during a 7-day period ending on September 4, 2013.
 <br/>Any versions with less than 0.1% distribution are not shown.</em>
 </p>
 
+<p class="note"><strong>Note:</strong> Because this data is gathered from the new Google Play
+Store app, which supports Android 2.2 and above, devices running older versions are not included.
+However, in August, 2013, versions older than Android 2.2 accounted for about 1% of devices that
+<em>checked in</em> to Google servers (not those that actually visited Google Play Store).
+</p>
 
 
 
@@ -83,7 +92,7 @@
 </div>
 
 
-<p style="clear:both"><em>Data collected during a 14-day period ending on August 1, 2013
+<p style="clear:both"><em>Data collected during a 7-day period ending on September 4, 2013
 <br/>Any screen configurations with less than 0.1% distribution are not shown.</em></p>
 
 
@@ -130,7 +139,7 @@
 
 
 
-<p style="clear:both"><em>Data collected during a 14-day period ending on August 1, 2013</em></p>
+<p style="clear:both"><em>Data collected during a 7-day period ending on September 4, 2013</em></p>
 
 
 
@@ -148,32 +157,17 @@
 var VERSION_DATA =
 [
   {
-    "chart": "//chart.googleapis.com/chart?cht=p&chs=500x250&chl=Eclair%7CFroyo%7CGingerbread%7CHoneycomb%7CIce%20Cream%20Sandwich%7CJelly%20Bean&chf=bg%2Cs%2C00000000&chd=t%3A1.3%2C2.5%2C33.1%2C0.1%2C22.5%2C40.5&chco=c4df9b%2C6fad0c",
+    "chart": "//chart.googleapis.com/chart?chs=500x250&cht=p&chco=c4df9b%2C6fad0c&chd=t%3A2.4%2C30.7%2C0.1%2C21.7%2C45.1&chf=bg%2Cs%2C00000000&chl=Froyo%7CGingerbread%7CHoneycomb%7CIce%20Cream%20Sandwich%7CJelly%20Bean",
     "data": [
       {
-        "api": 4,
-        "name": "Donut",
-        "perc": "0.1"
-      },
-      {
-        "api": 7,
-        "name": "Eclair",
-        "perc": "1.2"
-      },
-      {
         "api": 8,
         "name": "Froyo",
-        "perc": "2.5"
-      },
-      {
-        "api": 9,
-        "name": "Gingerbread",
-        "perc": "0.1"
+        "perc": "2.4"
       },
       {
         "api": 10,
         "name": "Gingerbread",
-        "perc": "33.0"
+        "perc": "30.7"
       },
       {
         "api": 13,
@@ -183,17 +177,17 @@
       {
         "api": 15,
         "name": "Ice Cream Sandwich",
-        "perc": "22.5"
+        "perc": "21.7"
       },
       {
         "api": 16,
         "name": "Jelly Bean",
-        "perc": "34.0"
+        "perc": "36.6"
       },
       {
         "api": 17,
         "name": "Jelly Bean",
-        "perc": "6.5"
+        "perc": "8.5"
       }
     ]
   }
@@ -209,30 +203,29 @@
     "data": {
       "Large": {
         "hdpi": "0.4",
-        "ldpi": "0.5",
-        "mdpi": "3.2",
-        "tvdpi": "1.1",
+        "ldpi": "0.6",
+        "mdpi": "3.4",
+        "tvdpi": "1.2",
         "xhdpi": "0.5"
       },
       "Normal": {
-        "hdpi": "34.5",
+        "hdpi": "33.6",
         "ldpi": "0.1",
-        "mdpi": "15.9",
-        "xhdpi": "23.9",
-        "xxhdpi": "5.7"
+        "mdpi": "15.7",
+        "xhdpi": "23.1",
+        "xxhdpi": "7.1"
       },
       "Small": {
-        "hdpi": "0.1",
-        "ldpi": "9.7"
+        "ldpi": "9.5"
       },
       "Xlarge": {
-        "hdpi": "0.2",
-        "mdpi": "4.1",
+        "hdpi": "0.3",
+        "mdpi": "4.4",
         "xhdpi": "0.1"
       }
     },
-    "densitychart": "//chart.googleapis.com/chart?cht=p&chs=400x250&chl=ldpi%7Cmdpi%7Ctvdpi%7Chdpi%7Cxhdpi%7Cxxhdpi&chf=bg%2Cs%2C00000000&chd=t%3A10.3%2C23.2%2C1.1%2C35.2%2C24.5%2C5.7&chco=c4df9b%2C6fad0c",
-    "layoutchart": "//chart.googleapis.com/chart?cht=p&chs=400x250&chl=Xlarge%7CLarge%7CNormal%7CSmall&chf=bg%2Cs%2C00000000&chd=t%3A4.4%2C5.7%2C80.2%2C9.8&chco=c4df9b%2C6fad0c"
+    "densitychart": "//chart.googleapis.com/chart?chs=400x250&cht=p&chco=c4df9b%2C6fad0c&chd=t%3A10.2%2C23.5%2C1.2%2C34.3%2C23.7%2C7.1&chf=bg%2Cs%2C00000000&chl=ldpi%7Cmdpi%7Ctvdpi%7Chdpi%7Cxhdpi%7Cxxhdpi",
+    "layoutchart": "//chart.googleapis.com/chart?chs=400x250&cht=p&chco=c4df9b%2C6fad0c&chd=t%3A4.8%2C6.1%2C79.6%2C9.5&chf=bg%2Cs%2C00000000&chl=Xlarge%7CLarge%7CNormal%7CSmall"
   }
 ];
 
@@ -294,6 +287,11 @@
     "api":17,
     "link":"<a href='/about/versions/android-4.2.html'>4.2.x</a>",
     "codename":"Jelly Bean"
+  },
+  {
+    "api":18,
+    "link":"<a href='/about/versions/android-4.3.html'>4.3</a>",
+    "codename":"Jelly Bean"
   }
 ];
 
diff --git a/docs/html/about/versions/android-4.0.jd b/docs/html/about/versions/android-4.0.jd
index 2fa180c..c026534 100644
--- a/docs/html/about/versions/android-4.0.jd
+++ b/docs/html/about/versions/android-4.0.jd
@@ -62,7 +62,7 @@
       <li><a href="#Multimedia">Multimedia</a></li>
       <li><a href="#Camera">Camera</a></li>
       <li><a href="#AndroidBeam">Android Beam (NDEF Push with NFC)</a></li>
-      <li><a href="#WiFiDirect">Wi-Fi Direct</a></li>
+      <li><a href="#WiFiDirect">Wi-Fi P2P</a></li>
       <li><a href="#Bluetooth">Bluetooth Health Devices</a></li>
       <li><a href="#A11y">Accessibility</a></li>
       <li><a href="#SpellChecker">Spell Checker Services</a></li>
@@ -617,12 +617,13 @@
 
 
 
-<h3 id="WiFiDirect">Wi-Fi Direct</h3>
+<h3 id="WiFiDirect">Wi-Fi P2P</h3>
 
-<p>Android now supports Wi-Fi Direct for peer-to-peer (P2P) connections between Android-powered
-devices and other device types without a hotspot or Internet connection. The Android framework
+<p>Android now supports Wi-Fi peer-to-peer (P2P) connections between Android-powered
+devices and other device types (in compliance with the Wi-Fi
+Alliance's Wi-Fi Direct&trade; certification program) without a hotspot or Internet connection. The Android framework
 provides a set of Wi-Fi P2P APIs that allow you to discover and connect to other devices when each
-device supports Wi-Fi Direct, then communicate over a speedy connection across distances much longer
+device supports Wi-Fi P2P, then communicate over a speedy connection across distances much longer
 than a Bluetooth connection.</p>
 
 <p>A new package, {@link android.net.wifi.p2p}, contains all the APIs for performing peer-to-peer
@@ -669,7 +670,7 @@
 <li>{@link android.Manifest.permission#ACCESS_WIFI_STATE}</li>
 <li>{@link android.Manifest.permission#CHANGE_WIFI_STATE}</li>
 <li>{@link android.Manifest.permission#INTERNET} (although your app doesn’t technically connect
-to the Internet, communicating to Wi-Fi Direct peers with standard java sockets requires Internet
+to the Internet, communicating to Wi-Fi P2P peers with standard java sockets requires Internet
 permission).</li>
 </ul>
 
@@ -696,7 +697,7 @@
 </ul>
 
 <p>See the  {@link android.net.wifi.p2p.WifiP2pManager} documentation for more information. Also
-look at the <a href="{@docRoot}resources/samples/WiFiDirectDemo/index.html">Wi-Fi Direct Demo</a>
+look at the <a href="{@docRoot}resources/samples/WiFiDirectDemo/index.html">Wi-Fi P2P Demo</a>
 sample application.</p>
 
 
diff --git a/docs/html/about/versions/android-4.1.jd b/docs/html/about/versions/android-4.1.jd
index d4b9ebf..76b90ac 100644
--- a/docs/html/about/versions/android-4.1.jd
+++ b/docs/html/about/versions/android-4.1.jd
@@ -41,7 +41,7 @@
     <ol>
       <li><a href="#AndroidBeam">Android Beam</a></li>
       <li><a href="#LocalNsd">Network service discovery</a></li>
-      <li><a href="#WiFiNsd">Wi-Fi Direct service discovery</a></li>
+      <li><a href="#WiFiNsd">Wi-Fi P2P service discovery</a></li>
       <li><a href="#NetworkUsage">Network usage</a></li>
     </ol>
   </li>
@@ -506,11 +506,11 @@
 
 
 
-<h3 id="WiFiNsd">Wi-Fi Direct service discovery</h3>
+<h3 id="WiFiNsd">Wi-Fi P2P service discovery</h3>
 
-<p>The Wi-Fi Direct APIs are enhanced in Android 4.1 to support pre-association service discovery in
+<p>The Wi-Fi P2P APIs are enhanced in Android 4.1 to support pre-association service discovery in
 the {@link android.net.wifi.p2p.WifiP2pManager}. This allows you to discover and filter nearby
-devices by services using Wi-Fi Direct before connecting to one, while Network Service
+devices by services using Wi-Fi P2P before connecting to one, while Network Service
 Discovery allows you to discover a service on an existing connected network (such as a local Wi-Fi
 network).</p>
 
diff --git a/docs/html/distribute/googleplay/policies/ads.jd b/docs/html/distribute/googleplay/policies/ads.jd
index 8920499..f2fb0f8 100644
--- a/docs/html/distribute/googleplay/policies/ads.jd
+++ b/docs/html/distribute/googleplay/policies/ads.jd
@@ -9,8 +9,8 @@
     <li><a href="#context">Context and Behavior</a></li>
     <li><a href="#disclosure" style="clear:right">Disclosure</a></li>
     <li><a href="#impersonation">Impersonation of System UI</a></li>
-    <li><a href="#adwalls">Adwalls</a></li>
-    <li><a href="#interfering" style="clear:right;">Interference with Ads and Websites</a></li>
+    <li><a href="#adwalls">Adwalls and Interstitial Ads</a></li>
+    <li><a href="#interfering" style="clear:right;">Interference with Apps and Third-Party Ads</a></li>
   </ol>
 
   <h2>More Resources</h2>
@@ -130,22 +130,20 @@
   </li>
 
   <li>
-    <strong>Make sure app origin is clear</strong>&mdash;When you display an
-    ad, it must be clear to the user that the ad has originated from your app.
-    If you show the ad in your app's UI while your app has focus, the user
-    understands the ad origin without explicit attribution. However, if you
-    display the ad outside of your app, such as in a notification, you must
-    explicitly indicate the origin.
-  </li>
-
-  <li>
     <strong>Don't make changes outside of the app without consent</strong>
    &mdash;Ads must not make changes outside of the app without the user's
-    full knowledge and consent. For example, ads should not install shortcuts,
-    bookmarks, or icons, or change default settings without user consent.
+    full knowledge and consent.
   </li>
 
   <li>
+  <div class="example-block bad" style="width:360px;margin:1em 0 0 2em;">
+    <div class="heading">Ads through system-level notifications</div>
+    <img src="{@docRoot}images/gp-policy-ads-notif-attr-violation.png">
+  </div>
+  <div class="example-block good" style="width:360px;margin:.5em 0 0 2em;">
+    <div class="heading">Notification that's part of the app's feature set</div>
+    <img src="{@docRoot}images/gp-policy-ads-notif-attr.png">
+  </div>
     <strong>Changes outside the app must be reversible</strong>&mdash;If an
     ad makes changes outside the app as described above, the changes (and
     origin app) must be evident and easily reversible. For example, the user
@@ -154,51 +152,31 @@
   </li>
 
   <li>
-    <strong>Notification ads require user opt-in</strong>&mdash;Your app
-    should not create <a href=
+    <strong>Notification ads are prohibited</strong>&mdash;Your app
+    should not create system-level <a href=
     "{@docRoot}design/patterns/notifications.html">notifications</a>
-    containing ads unless the user has specifically opted-in to this behavior
-    and is able to easily opt-out.
+    containing ads unless the notifications are part of the explicit
+    feature set of the app.
   </li>
 
   <li>
-    <strong>Use low priority for notification ads</strong>&mdash;Always
-    assign your notification ads <a href="
-    {@docRoot}reference/android/app/Notification.html#PRIORITY_LOW">low
-    priority</a> (for API level 16 and above).
+    <strong>Don't add shortcuts, bookmarks, or icons</strong>&mdash;Your app
+    and its ads must not add homescreen shortcuts, browser bookmarks, or icons
+    on the user's device as a service to third parties or for advertising 
+    purposes.
   </li>
 </ul>
 
-<div class="example-block bad" style="width:400px;margin:.5em 0 0 2em;">
-    <div class="heading">Does not fully indicate origin app</div>
-    <img src="{@docRoot}images/gp-policy-ads-notif-attr-violation.png">
-</div>
-<div class="example-block good" style="width:400px;margin:.5em 0 0 2em;">
-    <div class="heading">Indicates origin app by name and icon</div>
-    <img src="{@docRoot}images/gp-policy-ads-notif-attr.png">
-</div>
-
 <p>
-  In particular, note that notification ads must clearly identify your app as
-  the ad origin. If your app sends notification ads that do not sufficiently
-  identify your app as the origin, the app will be in violation of policy.
+  Above right is an example notification ad that violates ad policy by
+  providing ads through system level notification.
 </p>
-
 <p>
-  To identify your app as the origin, you should display the <strong>app's full
-  name and and icon</strong> in the notification to provide the clearest
-  identification and best policy compliance. Displaying a partial app name can
-  also be sufficient, provided the name unambiguously identifies your app.
+  Below right, the notification ad complies with policy because the
+  nature of the notification is part of the explicit feature set of the app,
+  and it also provides attribution of the origin app. 
 </p>
 
-<p>
-  Above right is an example notification ad that violates ad policy by not
-  providing attribution of the origin app. Below right, the notification ads
-  comply with policy by providing both the app icon and full app name (in this
-  case, "Turtle Test").
-</p>
-
-
 <h2 id="disclosure" style="clear:right">Disclosure of Ads to Users</h2>
 
 <p>
@@ -218,6 +196,14 @@
   </li>
 
   <li>
+    <div class="example-block good" style="width:213px;margin-left:.5em;">
+      <div class="heading">Disclosure in Terms</div>
+      <img src="{@docRoot}images/gp-policy-ads-terms.png">
+    </div>
+    <div class="example-block bad" style="width:213px;">
+      <div class="heading">Disclosure is hidden</div>
+      <img src="{@docRoot}images/gp-policy-ads-eula-violation.png">
+    </div>
     <strong>Make sure users know</strong>&mdash;Present your ads disclosure
     is an easy-to-see location, rather than hiding it where users are not
     likely to find it.
@@ -240,53 +226,40 @@
 </p>
 
 <p>
-  If your app adds homescreen icons and/or browser bookmarks, an acceptable
-  practice for revealing that behavior is to provide a disclosure in both the
-  app description and an opt-in EULA on app launch. This ensures that the
-  behaviors are clearly explained to the user up-front and requires the user’s
-  consent in a pop-up EULA to continue using the app.
-</p>
-
-<div class="example-block good" style="width:213px;margin-right:2em;">
-  <div class="heading">Disclosure in Terms</div>
-  <img src="{@docRoot}images/gp-policy-ads-terms.png">
-</div>
-
-<div class="example-block good" style="width:213px;">
-  <div class="heading">Disclosure in EULA</div>
-  <img src="{@docRoot}images/gp-policy-ads-eula.png">
-</div>
-
-<div class="example-block bad" style="width:213px;margin-left:0em;">
-  <div class="heading">Disclosure is hidden</div>
-  <img src="{@docRoot}images/gp-policy-ads-eula-violation.png">
-</div>
-
-<p style="clear:right">
   Above left is an example of ads disclosure that is hidden in a long EULA. The
   disclosure information itself is not clearly indicated in the document text
   and it's not visible unless the user happens to scroll down far enough in the
-  EULA. Above middle and right show two alternative approaches that
-  present the disclosure in an obvious and clear manner at the top of a
-  EULA and in a dedicated Terms agreement. 
+  EULA. 
+</p>
+<p>
+  Above right shows an approach that presents the disclosure in an obvious
+  and clear manner in a EULA and a dedicated Terms agreement. 
 </p>
 
 
 <h2 id="impersonation">Impersonation of System UI</h2>
 
-<div class="example-block bad">
-  <div class="heading">Ad impersonates system dialog</div>
-  <img src="{@docRoot}images/gp-policy-ads-impersonate-violation.png">
-</div>
+
+
+
+
+
+
 
 <p>
-  Your app must not display any ad that attempts to impersonate or represent a
+  Ads must not simulate or impersonate the user interface of any app, or
+  notification and warning elements of an operating system. Your app must not
+  display any ad that attempts to impersonate or represent a
   system function or UI component. If such an ad is displayed in your app, your
   app will be in violation of policy and subject to suspension. Here are some
   guidelines:
 </p>
 
-<ul>
+<ul>  
+  <li>
+    <strong>No fake app UI notifications</strong>&mdash;Ads should not impersonate
+    the interface of an application for advertising purposes.
+  </li>
   <li>
     <strong>No fake system dialogs or warnings</strong>&mdash;Any ad that
     presents itself as a system dialog or warning and asks for user input is in
@@ -299,23 +272,26 @@
   </li>
 </ul>
 
-<p>
-  At right is an example of a pop-up ad impersonating a system dialog, warning
-  the user about viruses. This is a violation of policy.
+<div class="example-block bad" style="width:213px;">
+  <div class="heading">Ad impersonates app UI</div>
+  <img src="{@docRoot}images/gp-policy-ads-impersonate-violation-app-ui.png">
+</div>
+<div class="example-block bad" style="width:213px;">
+  <div class="heading">Ad impersonates system warning</div>
+  <img src="{@docRoot}images/gp-policy-ads-impersonate-violation-sys-warning.png">
+</div>
+<div class="example-block bad" style="width:213px;">
+  <div class="heading">Ad impersonates system dialog</div>
+  <img src="{@docRoot}images/gp-policy-ads-impersonate-violation.png">
+</div>
+<p style="clear:both">
+  Above are examples of impersonations &mdash; a pop-up ad that impersonates a
+  system dialog, an ad that impersonates a system warning, and an ad that impersonates
+  an application UI. All of these are in violation of policy.
 </p>
 
 
-<h2 id="adwalls">Adwalls</h2>
-
-<div class="example-block good" style="width:213px;">
-  <div class="heading">Adwall lets user cancel</div>
-  <img src="{@docRoot}images/gp-policy-ads-paywall.png">
-</div>
-
-<div class="example-block bad" style="width:213px;">
-  <div class="heading">Adwall forces user action</div>
-  <img src="{@docRoot}images/gp-policy-ads-paywall-violation.png">
-</div>
+<h2 id="adwalls">Adwalls and Interstitial Ads</h2>
 
 <p>
   If your app uses adwalls to drive affiliate traffic, those adwalls must not
@@ -330,23 +306,45 @@
 
 <p>
   For this reason, <strong>all adwalls must give the user the option to
-  cancel</strong> or otherwise dismiss the ad without penalty.
+  cancel</strong> or otherwise dismiss the ad without penalty. Interstitial ads
+  may only be displayed inside of the app they came with. Forcing the user to
+  click on ads or submit personal information for advertising purposes in order
+  to fully use an app is prohibited.
 </p>
 
-<p>
-  At right is an example of an app that requires the user to click through the
+<div class="example-block bad" style="width:213px;">
+  <div class="heading">Interstitial, modal ad</div>
+  <img src="{@docRoot}images/gp-policy-ads-interstitial-violation.png">
+</div>
+
+<div class="example-block good" style="width:213px;">
+  <div class="heading">Adwall lets user cancel</div>
+  <img src="{@docRoot}images/gp-policy-ads-paywall.png">
+</div>
+
+<div class="example-block bad" style="width:213px;">
+  <div class="heading">Adwall forces user action</div>
+  <img src="{@docRoot}images/gp-policy-ads-paywall-violation.png">
+</div>
+
+<p style="clear:both">
+  At left is an example of an app that requires the user to click through the
   ad to fully use the app. This is a violation of policy.
 </p>
 
 <p>
-  The adjacent example demonstrates an adequate option to let the user dismiss
-  the ad wall easily by cancelling.
+  The center example demonstrates an adequate option to let the user dismiss
+  the ad wall easily by cancelling. This is not a violation of policy.
 </p>
 
+<p>
+  At right is an example of an interstitial, modal ad that is displayed outside
+  of the app. This is a violation of policy.
+</p>
 
-<h2 id="interfering" style="clear:right;">Interference with Third-party Ads and Websites</h2>
+<h2 id="interfering" style="clear:right;">Interfering with Apps and Third-Party Ads</h2>
 
 <p>
-  Ads associated with your app <strong>must not interfere</strong> with any
-  other ads originating in other applications.
+  Ads associated with your app <strong>must not interfere</strong> with other
+  apps or their ads.
 </p>
\ No newline at end of file
diff --git a/docs/html/distribute/googleplay/policies/spam.jd b/docs/html/distribute/googleplay/policies/spam.jd
index 602c89a..f4d303c 100644
--- a/docs/html/distribute/googleplay/policies/spam.jd
+++ b/docs/html/distribute/googleplay/policies/spam.jd
@@ -251,6 +251,11 @@
 
 <h2 id="ratings">Spam in Ratings and Reviews</h2>
 
+<div class="example-block bad" style="width:440px;">
+  <div class="heading">Inappropriate content in a review</div>
+  <img src="{@docRoot}images/gp-policy-spam-negreview.png">
+</div>
+
 <p>
   Ratings and reviews are benchmarks of app quality and users depend on them to
   be authentic and relevant. As an app developer, you should not attempt to
@@ -276,12 +281,7 @@
   more information.
 </p>
 
-<div class="example-block bad" style="width:440px;">
-  <div class="heading">Inappropriate content in a review</div>
-  <img src="{@docRoot}images/gp-policy-spam-negreview.png">
-</div>
-
-<div class="example-block bad" style="margin-top:3em;">
+<div class="example-block bad" style="margin-top:3em;width:213px;">
   <div class="heading">Soliciting ratings</div>
   <img src="{@docRoot}images/gp-policy-spam-reqrating.png">
 </div>
diff --git a/docs/html/distribute/googleplay/promote/brand.jd b/docs/html/distribute/googleplay/promote/brand.jd
index 265584f..0bda561 100644
--- a/docs/html/distribute/googleplay/promote/brand.jd
+++ b/docs/html/distribute/googleplay/promote/brand.jd
@@ -21,8 +21,8 @@
     <ul>
     <li>Android&trade; should have a trademark symbol the first time it appears in a creative.</li>
     <li>Android should always be capitalized and is never plural or possessive.</li>
-    <li>"Android" by itself cannot be used in the name of an application name or accessory product.
-Instead use "for Android."
+    <li>"Android" cannot be used in names of applications or accessory products,
+    including phones, tablets, TVs, speakers, headphones, watches, and other devices. Instead use "for Android".
       <ul>
         <li><span style="color:red">Incorrect</span>: "Android MediaPlayer"</li>
         <li><span style="color:green">Correct</span>: "MediaPlayer for Android"</li>
diff --git a/docs/html/guide/guide_toc.cs b/docs/html/guide/guide_toc.cs
index 2a31374..21d295a 100644
--- a/docs/html/guide/guide_toc.cs
+++ b/docs/html/guide/guide_toc.cs
@@ -408,7 +408,7 @@
         </ul>
       </li>
       <li><a href="<?cs var:toroot?>guide/topics/connectivity/wifip2p.html">
-            <span class="en">Wi-Fi Direct</span></a>
+            <span class="en">Wi-Fi P2P</span></a>
           </li>
       <li class="nav-section">
           <div class="nav-section-header"><a href="<?cs var:toroot?>guide/topics/connectivity/usb/index.html">
diff --git a/docs/html/guide/topics/connectivity/wifip2p.jd b/docs/html/guide/topics/connectivity/wifip2p.jd
index 2167a0f..7cadde1 100644
--- a/docs/html/guide/topics/connectivity/wifip2p.jd
+++ b/docs/html/guide/topics/connectivity/wifip2p.jd
@@ -1,5 +1,5 @@
-page.title=Wi-Fi Direct
-page.tags="wireless","WifiP2pManager"
+page.title=Wi-Fi Peer-to-Peer
+page.tags="wireless","WifiP2pManager","Wi-Fi Direct","WiFi Direct","P2P","Wi-Fi P2P","WiFi P2P"
 
 @jd:body
 
@@ -9,10 +9,10 @@
 
       <ol>
         <li><a href="#api">API Overview</a></li>
-        <li><a href="#creating-br">Creating a Broadcast Receiver for Wi-Fi Direct Intents</a></li>
+        <li><a href="#creating-br">Creating a Broadcast Receiver for Wi-Fi P2P Intents</a></li>
 
         <li>
-          <a href="#creating-app">Creating a Wi-Fi Direct Application</a>
+          <a href="#creating-app">Creating a Wi-Fi P2P Application</a>
 
           <ol>
             <li><a href="#setup">Initial setup</a></li>
@@ -25,21 +25,24 @@
           </ol>
         </li>
       </ol>
-      <h2>Related Samples</h2>
-      <ol>
-        <li><a href="{@docRoot}resources/samples/WiFiDirectDemo/index.html">Wi-Fi Direct Demo</a></li>
-      </ol>
+    <h2>See also</h2>
+    <ul>
+      <li><a href="{@docRoot}training/connect-devices-wirelessly/wifi-direct.html">Creating
+        P2P Connections with Wi-Fi</a></li>
+    </ul>
     </div>
   </div>
 
-  <p>Wi-Fi Direct allows Android 4.0 (API level 14) or later devices with the appropriate hardware
-  to connect directly to each other via Wi-Fi without an intermediate access point.
-  Using these APIs, you can discover and connect to other devices when each device supports Wi-Fi Direct,
-  then communicate over a speedy connection across distances much longer than a Bluetooth connection.
-  This is useful for applications that share data among users, such as a multiplayer game or
-  a photo sharing application.</p>
 
-  <p>The Wi-Fi Direct APIs consist of the following main parts:</p>
+<p>Wi-Fi peer-to-peer (P2P) allows Android 4.0 (API level 14) or later devices with the appropriate
+hardware to connect directly to each other via Wi-Fi without an intermediate access point (Android's
+Wi-Fi P2P framework complies with the Wi-Fi Alliance's Wi-Fi Direct&trade; certification program).
+Using these APIs, you can discover and connect to other devices when each device supports Wi-Fi P2P,
+then communicate over a speedy connection across distances much longer than a Bluetooth connection.
+This is useful for applications that share data among users, such as a multiplayer game or
+a photo sharing application.</p>
+
+  <p>The Wi-Fi P2P APIs consist of the following main parts:</p>
 
   <ul>
     <li>Methods that allow you to discover, request, and connect to peers are defined
@@ -50,7 +53,7 @@
     android.net.wifi.p2p.WifiP2pManager} methods, each method can receive a specific listener
     passed in as a parameter.</li>
 
-    <li>Intents that notify you of specific events detected by the Wi-Fi Direct framework,
+    <li>Intents that notify you of specific events detected by the Wi-Fi P2P framework,
     such as a dropped connection or a newly discovered peer.</li>
   </ul>
 
@@ -70,7 +73,7 @@
   the Wi-Fi hardware on your device to do things like discover and connect to peers. The following actions
   are available:</p>
 
-<p class="table-caption"><strong>Table 1.</strong>Wi-Fi Direct Methods</p>
+<p class="table-caption"><strong>Table 1.</strong>Wi-Fi P2P Methods</p>
 
    <table>
         <tr>
@@ -80,7 +83,7 @@
 
 	<tr>
 	  <td>{@link android.net.wifi.p2p.WifiP2pManager#initialize initialize()}</td>
-	  <td>Registers the application with the Wi-Fi framework. This must be called before calling any other Wi-Fi Direct method.</td>
+	  <td>Registers the application with the Wi-Fi framework. This must be called before calling any other Wi-Fi P2P method.</td>
 	</tr>
 
 	<tr>
@@ -126,12 +129,12 @@
 
 
  <p>{@link android.net.wifi.p2p.WifiP2pManager} methods let you pass in a listener,
-  so that the Wi-Fi Direct framework can notify your
+  so that the Wi-Fi P2P framework can notify your
   activity of the status of a call. The available listener interfaces and the
   corresponding {@link android.net.wifi.p2p.WifiP2pManager} method calls that use the listeners
   are described in the following table:</p>
 
- <p class="table-caption"><strong>Table 2.</strong> Wi-Fi Direct Listeners</p>
+ <p class="table-caption"><strong>Table 2.</strong> Wi-Fi P2P Listeners</p>
  
  <table>
     <tr>
@@ -168,12 +171,12 @@
     </tr>
   </table>
 
-<p>The Wi-Fi Direct APIs define intents that are broadcast when certain Wi-Fi Direct events happen,
+<p>The Wi-Fi P2P APIs define intents that are broadcast when certain Wi-Fi P2P events happen,
   such as when a new peer is discovered or when a device's Wi-Fi state changes. You can register
   to receive these intents in your application by <a href="#creating-br">creating a broadcast
   receiver</a> that handles these intents:</p>
 
-<p class="table-caption"><strong>Table 3.</strong> Wi-Fi Direct Intents</p>
+<p class="table-caption"><strong>Table 3.</strong> Wi-Fi P2P Intents</p>
 
     <table>
     <tr>
@@ -194,7 +197,7 @@
       </tr>
       <tr>
         <td>{@link android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_STATE_CHANGED_ACTION}</td>
-        <td>Broadcast when Wi-Fi Direct is enabled or disabled on the device.</td>
+        <td>Broadcast when Wi-Fi P2P is enabled or disabled on the device.</td>
       </tr>
       <tr>
         <td>{@link android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_THIS_DEVICE_CHANGED_ACTION}</td>
@@ -204,11 +207,11 @@
 
 
 
-  <h2 id="creating-br">Creating a Broadcast Receiver for Wi-Fi Direct Intents</h2>
+  <h2 id="creating-br">Creating a Broadcast Receiver for Wi-Fi P2P Intents</h2>
 
   <p>A broadcast receiver allows you to receive intents broadcast by the Android system,
   so that your application can respond to events that you are interested in. The basic steps
-  for creating a broadcast receiver to handle Wi-Fi Direct intents are as follows:</p>
+  for creating a broadcast receiver to handle Wi-Fi P2P intents are as follows:</p>
 
   <ol>
     <li>Create a class that extends the {@link android.content.BroadcastReceiver} class. For the
@@ -267,17 +270,17 @@
 }
 </pre>
 
-  <h2 id="creating-app">Creating a Wi-Fi Direct Application</h2>
+  <h2 id="creating-app">Creating a Wi-Fi P2P Application</h2>
 
-  <p>Creating a Wi-Fi Direct application involves creating and registering a
+  <p>Creating a Wi-Fi P2P application involves creating and registering a
   broadcast receiver for your application, discovering peers, connecting to a peer, and
   transferring data to a peer. The following sections describe how to do this.</p>
 
   <h3 id="setup">Initial setup</h3>
-  <p>Before using the Wi-Fi Direct APIs, you must ensure that your application can access
-  the hardware and that the device supports the Wi-Fi Direct protocol. If Wi-Fi Direct is supported,
+  <p>Before using the Wi-Fi P2P APIs, you must ensure that your application can access
+  the hardware and that the device supports the Wi-Fi P2P protocol. If Wi-Fi P2P is supported,
   you can obtain an instance of {@link android.net.wifi.p2p.WifiP2pManager}, create and register
-  your broadcast receiver, and begin using the Wi-Fi Direct APIs.</p>
+  your broadcast receiver, and begin using the Wi-Fi P2P APIs.</p>
   <ol>
     <li>
       <p>Request permission to use the Wi-Fi hardware on the device and also declare
@@ -292,10 +295,10 @@
 </pre>
     </li>
 
-    <li>Check to see if Wi-Fi Direct is on and supported. A good place to check this is in your
+    <li>Check to see if Wi-Fi P2P is on and supported. A good place to check this is in your
     broadcast receiver when it receives the {@link
     android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_STATE_CHANGED_ACTION} intent. Notify your
-    activity of the Wi-Fi Direct state and react accordingly:
+    activity of the Wi-Fi P2P state and react accordingly:
 <pre>
 &#064;Override
 public void onReceive(Context context, Intent intent) {
@@ -304,9 +307,9 @@
     if (WifiP2pManager.WIFI_P2P_STATE_CHANGED_ACTION.equals(action)) {
         int state = intent.getIntExtra(WifiP2pManager.EXTRA_WIFI_STATE, -1);
         if (state == WifiP2pManager.WIFI_P2P_STATE_ENABLED) {
-            // Wifi Direct is enabled
+            // Wifi P2P is enabled
         } else {
-            // Wi-Fi Direct is not enabled
+            // Wi-Fi P2P is not enabled
         }
     }
     ...
@@ -315,10 +318,10 @@
     </li>
 
     <li>In your activity's {@link android.app.Activity#onCreate onCreate()} method, obtain an instance of {@link
-    android.net.wifi.p2p.WifiP2pManager} and register your application with the Wi-Fi Direct
+    android.net.wifi.p2p.WifiP2pManager} and register your application with the Wi-Fi P2P
     framework by calling {@link android.net.wifi.p2p.WifiP2pManager#initialize initialize()}. This
     method returns a {@link android.net.wifi.p2p.WifiP2pManager.Channel}, which is used to connect
-    your application to the Wi-Fi Direct framework. You should also create an instance of your
+    your application to the Wi-Fi P2P framework. You should also create an instance of your
     broadcast receiver with the {@link
     android.net.wifi.p2p.WifiP2pManager} and {@link android.net.wifi.p2p.WifiP2pManager.Channel}
     objects along with a reference to your activity. This allows your broadcast receiver to notify
@@ -376,11 +379,11 @@
 </pre>
 
       <p>When you have obtained a {@link android.net.wifi.p2p.WifiP2pManager.Channel} and
-      set up a broadcast receiver, your application can make Wi-Fi Direct method calls and receive
-      Wi-Fi Direct intents.</p>
+      set up a broadcast receiver, your application can make Wi-Fi P2P method calls and receive
+      Wi-Fi P2P intents.</p>
     </li>
 
-    <p>You can now implement your application and use the Wi-Fi Direct features by calling the
+    <p>You can now implement your application and use the Wi-Fi P2P features by calling the
     methods in {@link android.net.wifi.p2p.WifiP2pManager}. The next sections describe how to do common actions
     such as discovering and connecting to peers.</p>
   </ol>
@@ -492,10 +495,10 @@
   </ol>
 
   <p>The following example, modified from the <a href=
-  "{@docRoot}resources/samples/WiFiDirectDemo/index.html">Wi-Fi Direct Demo</a> sample, shows you how
+  "{@docRoot}resources/samples/WiFiDirectDemo/index.html">Wi-Fi P2P Demo</a> sample, shows you how
   to create this client-server socket communication and transfer JPEG images from a client
   to a server with a service. For a complete working example, compile and run the <a href=
-  "{@docRoot}resources/samples/WiFiDirectDemo/index.html">Wi-Fi Direct Demo</a> sample.</p>
+  "{@docRoot}resources/samples/WiFiDirectDemo/index.html">Wi-Fi P2P Demo</a> sample.</p>
 <pre>
 public static class FileServerAsyncTask extends AsyncTask<Void, Void, String> {
 
diff --git a/docs/html/guide/topics/manifest/uses-feature-element.jd b/docs/html/guide/topics/manifest/uses-feature-element.jd
index af35540..95f62a5 100644
--- a/docs/html/guide/topics/manifest/uses-feature-element.jd
+++ b/docs/html/guide/topics/manifest/uses-feature-element.jd
@@ -552,8 +552,8 @@
        <td>Bluetooth</td>
        <td><code>android.hardware.bluetooth</td>
        <td>The application uses Bluetooth radio features in the device.</td>
-<td>
-</td>
+       <td>If your app uses Bluetooth Low Energy, also declare
+       {@code android.software.bluetooth_le}.</td>
     </tr>
     <tr>
        <td rowspan="5">Camera</td>
@@ -849,26 +849,49 @@
   <th>Feature</th>
   <th>Attribute Value</th> 
   <th>Description</th>
-  <th>Comments</th>
+</tr>
+<tr>
+  <td>App Widgets</td>
+  <td><code>android.software.app_widgets</code></td>
+  <td>The application uses or provides App Widgets and should be installed only on devices
+  that include a Home screen or similar location where users can embed App Widgets.</td>
+</tr>
+<tr>
+  <td>Bluetooth Low Energy</td>
+  <td><code>android.software.bluetooth_le</code></td>
+  <td><p>The application uses Bluetooth Low Energy APIs and should be installed only on devices
+  that are capable of communicating with other devices via Bluetooth Low Energy.
+   <p>This implicitly also declares the {@code android.hardware.bluetooth} feature.</td>
+</tr>
+<tr>
+  <td>Home Screen</td>
+  <td><code>android.software.home_screen</code></td>
+  <td>The application behaves as a Home screen replacement and should be installed only on
+  devices that support third-party Home screen apps.</td>
+</tr>
+<tr>
+  <td>Input Method</td>
+  <td><code>android.software.input_methods</code></td>
+  <td>The application provides a custom input method and should be installed only on devices that
+  support third-party input methods.</td>
 </tr>
 <tr>
   <td>Live Wallpaper</td>
   <td><code>android.software.live_wallpaper</code></td>
-  <td>The application uses or provides Live Wallpapers.</td>
-  <td></td>
+  <td>The application uses or provides Live Wallpapers and should be installed only on devices that
+  support Live Wallpapers.</td>
 </tr>
 <tr>
   <td rowspan="2">SIP/VOIP</td>
   <td><code>android.software.sip</code></td>
-  <td>The application uses SIP service on the device.
+  <td>The application uses SIP service on the device and should be installed only on devices that
+  support SIP.
   </td>
-  <td></td>
 </tr>
 <tr>
   <td><code>android.software.sip.voip</code></td>
-  <td>Subfeature. The application uses SIP-based VOIP service on the device.
-  </td>
-  <td>This subfeature implicitly declares the <code>android.software.sip</code> parent feature,
+  <td><p>Subfeature. The application uses SIP-based VOIP service on the device.
+  <p>This subfeature implicitly declares the <code>android.software.sip</code> parent feature,
 unless declared with <code>android:required="false"</code>.</td>
 </tr>
   </table>
diff --git a/docs/html/guide/topics/ui/how-android-draws.jd b/docs/html/guide/topics/ui/how-android-draws.jd
index 6a8cd86..168f77b 100644
--- a/docs/html/guide/topics/ui/how-android-draws.jd
+++ b/docs/html/guide/topics/ui/how-android-draws.jd
@@ -4,15 +4,19 @@
 @jd:body
 
 
-<p>When an Activity receives focus, it will be requested to draw its layout.
-The Android framework will handle the procedure for drawing, but the Activity must provide
+<p>When an {@link android.app.Activity} receives focus, it will be requested to 
+draw its layout.
+The Android framework will handle the procedure for drawing, but the 
+{@link android.app.Activity} must provide
 the root node of its layout hierarchy.</p>
 
 <p>Drawing begins with the root node of the layout. It is requested to measure and 
-draw the layout tree. Drawing is handled by walking the tree and rendering each View that
-   intersects the invalid region. In turn, each View group is responsible for requesting
-each of its children to be drawn (with the <code>{@link android.view.View#draw(Canvas) draw()}</code> method) 
-and each View is responsible for drawing itself.
+draw the layout tree. Drawing is handled by walking the tree and rendering each 
+{@link android.view.View} that intersects the invalid region. In turn, each 
+{@link android.view.ViewGroup} is responsible for requesting
+each of its children to be drawn 
+(with the {@link android.view.View#draw(Canvas) draw()} method) 
+and each {@link android.view.View} is responsible for drawing itself.
  Because the tree is traversed in-order,
    this means that parents will be drawn before (i.e., behind) their children, with
    siblings drawn in the order they appear in the tree.
@@ -20,76 +24,107 @@
 
 <div class="sidebox-wrapper">
 <div class="sidebox">
-  <p>The framework will not draw Views that are not in the invalid region, and also 
-   will take care of drawing the Views background for you.</p>
-   <p>You can force a View to draw, by calling <code>{@link android.view.View#invalidate()}</code>.
+  <p>The framework will not draw {@link android.view.View} objects that are not 
+in the invalid region, and also 
+   will take care of drawing the {@link android.view.View} background for you.</p>
+   <p>You can force a {@link android.view.View} to draw, by calling 
+{@link android.view.View#invalidate()}.
    </p>
 </div>
 </div>
 
 <p>
-   Drawing the layout is a two pass process: a measure pass and a layout pass. The measuring
-   pass is implemented in <code>{@link android.view.View#measure(int, int)}</code> and is a top-down traversal
-   of the View tree. Each View pushes dimension specifications down the tree
-   during the recursion. At the end of the measure pass, every View has stored
+   Drawing the layout is a two pass process: a measure pass and a layout pass. 
+The measuring pass is implemented in {@link android.view.View#measure(int, int)} 
+and is a top-down traversal of the {@link android.view.View} tree. Each {@link android.view.View} 
+pushes dimension specifications down the tree
+   during the recursion. At the end of the measure pass, every 
+{@link android.view.View} has stored
    its measurements. The second pass happens in
-   <code>{@link android.view.View#layout(int,int,int,int)}</code> and is also top-down. During
+   {@link android.view.View#layout(int,int,int,int)} and is also top-down. During
    this pass each parent is responsible for positioning all of its children
    using the sizes computed in the measure pass.
    </p>
    
    <p>
-   When a View's <code>measure()</code> method returns, its <code>{@link android.view.View#getMeasuredWidth()}</code> and
-   <code>{@link android.view.View#getMeasuredHeight()}</code> values must be set, along with those for all of
-   that View's descendants. A View's measured width and measured height values
-   must respect the constraints imposed by the View's parents. This guarantees
+   When a {@link android.view.View} object's 
+{@link android.view.View#measure(int, int) measure()} method 
+returns, its {@link android.view.View#getMeasuredWidth()} and
+   {@link android.view.View#getMeasuredHeight()} values must be set, along 
+   with those for all of that {@link android.view.View} object's descendants. 
+A {@link android.view.View} object's measured width and 
+measured height values must respect the constraints imposed by the 
+{@link android.view.View} object's parents. This guarantees
    that at the end of the measure pass, all parents accept all of their
-   children's measurements. A parent View may call <code>measure()</code> more than once on
+   children's measurements. A parent {@link android.view.View} may call 
+{@link android.view.View#measure(int, int) measure()} more than once on
    its children. For example, the parent may measure each child once with
    unspecified dimensions to find out how big they want to be, then call
-   <code>measure()</code> on them again with actual numbers if the sum of all the children's
-   unconstrained sizes is too big or too small (i.e., if the children don't agree among themselves
-  as to how much space they each get, the parent will intervene and set the rules on the second pass).
+   {@link android.view.View#measure(int, int) measure()} on them again with 
+actual numbers if the sum of all the children's
+   unconstrained sizes is too big or too small (that is, if the children 
+don't agree among themselves
+  as to how much space they each get, the parent will intervene and set 
+the rules on the second pass).
    </p>
    
 <div class="sidebox-wrapper">
 <div class="sidebox"><p>
-   To initiate a layout, call <code>{@link android.view.View#requestLayout}</code>. This method is typically
-   called by a View on itself when it believes that is can no longer fit within
+   To initiate a layout, call {@link android.view.View#requestLayout}. 
+This method is typically
+   called by a {@link android.view.View} on itself 
+when it believes that is can no longer fit within
    its current bounds.</p>
 </div>
 </div>
 
    <p>
    The measure pass uses two classes to communicate dimensions. The
-   {@link android.view.ViewGroup.LayoutParams} class is used by Views to tell their parents how they
-   want to be measured and positioned. The base LayoutParams class just
-   describes how big the View wants to be for both width and height. For each
+   {@link android.view.ViewGroup.LayoutParams} class is used by 
+{@link android.view.View} objects to tell their parents how they
+   want to be measured and positioned. The base 
+{@link android.view.ViewGroup.LayoutParams}  class just
+   describes how big the {@link android.view.View} wants to be for both 
+width and height. For each
    dimension, it can specify one of:</p>
    <ul>
     <li> an exact number
-    <li><var>FILL_PARENT</var>, which means the View wants to be as big as its parent
+    <li>{@link android.view.ViewGroup.LayoutParams#MATCH_PARENT MATCH_PARENT}, 
+which means the {@link android.view.View} wants to be as big as its parent
     (minus padding)</li>
-    <li><var>WRAP_CONTENT</var>, which means that the View wants to be just big enough to
+    <li>{@link android.view.ViewGroup.LayoutParams#WRAP_CONTENT WRAP_CONTENT}, 
+which means that the {@link android.view.View} wants to be just big enough to
     enclose its content (plus padding).</li>
    </ul>
-  <p>There are subclasses of LayoutParams for different subclasses of ViewGroup.
-   For example, RelativeLayout has its own subclass of LayoutParams, which includes
-   the ability to center child Views horizontally and vertically.
+  <p>There are subclasses of {@link android.view.ViewGroup.LayoutParams} for 
+different subclasses of {@link android.view.ViewGroup}.
+   For example, {@link android.widget.RelativeLayout} has its own subclass of 
+{@link android.view.ViewGroup.LayoutParams}, which includes
+   the ability to center child {@link android.view.View} objects 
+horizontally and vertically.
    </p>
    
    <p>
-   MeasureSpecs are used to push requirements down the tree from parent to
-   child. A MeasureSpec can be in one of three modes:</p>
+   {@link android.view.View.MeasureSpec MeasureSpec} objects are used to push 
+requirements down the tree from parent to
+   child. A {@link android.view.View.MeasureSpec MeasureSpec} can be in one of 
+three modes:</p>
    <ul>
-    <li><var>UNSPECIFIED</var>: This is used by a parent to determine the desired dimension
-    of a child View. For example, a LinearLayout may call <code>measure()</code> on its child
-    with the height set to <var>UNSPECIFIED</var> and a width of <var>EXACTLY</var> 240 to find out how
-    tall the child View wants to be given a width of 240 pixels.</li>
-    <li><var>EXACTLY</var>: This is used by the parent to impose an exact size on the
+    <li>{@link android.view.View.MeasureSpec#UNSPECIFIED UNSPECIFIED}: This is 
+used by a parent to determine the desired dimension
+    of a child {@link android.view.View}. For example, a 
+{@link android.widget.LinearLayout} may call 
+{@link android.view.View#measure(int, int) measure()} on its child
+    with the height set to {@link android.view.View.MeasureSpec#UNSPECIFIED UNSPECIFIED} 
+and a width of {@link android.view.View.MeasureSpec#EXACTLY EXACTLY} 240 to 
+find out how tall the child {@link android.view.View} wants to be given a 
+width of 240 pixels.</li>
+    <li>{@link android.view.View.MeasureSpec#EXACTLY EXACTLY}: This is used 
+by the parent to impose an exact size on the
     child. The child must use this size, and guarantee that all of its
     descendants will fit within this size.</li>
-    <li><var>AT_MOST</var>: This is used by the parent to impose a maximum size on the
+    <li>{@link android.view.View.MeasureSpec#AT_MOST AT MOST}: This is used by 
+the parent to impose a maximum size on the
     child. The child must guarantee that it and all of its descendants will fit
     within this size.</li>
    </ul>
diff --git a/docs/html/images/gp-policy-ads-eula-violation.png b/docs/html/images/gp-policy-ads-eula-violation.png
index e8ffa5b..204c320 100644
--- a/docs/html/images/gp-policy-ads-eula-violation.png
+++ b/docs/html/images/gp-policy-ads-eula-violation.png
Binary files differ
diff --git a/docs/html/images/gp-policy-ads-eula.png b/docs/html/images/gp-policy-ads-eula.png
deleted file mode 100644
index 68a6b95..0000000
--- a/docs/html/images/gp-policy-ads-eula.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/images/gp-policy-ads-impersonate-violation-app-ui.png b/docs/html/images/gp-policy-ads-impersonate-violation-app-ui.png
new file mode 100644
index 0000000..a2a39a9
--- /dev/null
+++ b/docs/html/images/gp-policy-ads-impersonate-violation-app-ui.png
Binary files differ
diff --git a/docs/html/images/gp-policy-ads-impersonate-violation-sys-warning.png b/docs/html/images/gp-policy-ads-impersonate-violation-sys-warning.png
new file mode 100644
index 0000000..f323b06
--- /dev/null
+++ b/docs/html/images/gp-policy-ads-impersonate-violation-sys-warning.png
Binary files differ
diff --git a/docs/html/images/gp-policy-ads-interstitial-violation.png b/docs/html/images/gp-policy-ads-interstitial-violation.png
new file mode 100644
index 0000000..4871493
--- /dev/null
+++ b/docs/html/images/gp-policy-ads-interstitial-violation.png
Binary files differ
diff --git a/docs/html/images/gp-policy-ads-notif-attr-violation.png b/docs/html/images/gp-policy-ads-notif-attr-violation.png
index af53f10..3d6393b 100644
--- a/docs/html/images/gp-policy-ads-notif-attr-violation.png
+++ b/docs/html/images/gp-policy-ads-notif-attr-violation.png
Binary files differ
diff --git a/docs/html/images/gp-policy-ads-notif-attr.png b/docs/html/images/gp-policy-ads-notif-attr.png
index 4934d21..da39cfb 100644
--- a/docs/html/images/gp-policy-ads-notif-attr.png
+++ b/docs/html/images/gp-policy-ads-notif-attr.png
Binary files differ
diff --git a/docs/html/images/gp-policy-spam-reqrating.png b/docs/html/images/gp-policy-spam-reqrating.png
index aaf9e53..20e17c1 100644
--- a/docs/html/images/gp-policy-spam-reqrating.png
+++ b/docs/html/images/gp-policy-spam-reqrating.png
Binary files differ
diff --git a/docs/html/images/training/lesson2_MyFirstTestActivityTest_result.png b/docs/html/images/training/lesson2_MyFirstTestActivityTest_result.png
new file mode 100644
index 0000000..e0e869b
--- /dev/null
+++ b/docs/html/images/training/lesson2_MyFirstTestActivityTest_result.png
Binary files differ
diff --git a/docs/html/training/activity-testing/activity-basic-testing.jd b/docs/html/training/activity-testing/activity-basic-testing.jd
new file mode 100644
index 0000000..016289d
--- /dev/null
+++ b/docs/html/training/activity-testing/activity-basic-testing.jd
@@ -0,0 +1,227 @@
+page.title=Creating and Running a Test Case
+trainingnavtop=true
+
+@jd:body
+
+<!-- This is the training bar -->
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>This lesson teaches you to</h2>
+<ol>
+  <li><a href="#testcase">Create a Test Case for Activity Testing</a>
+      <ol>
+      <li><a href="#fixture">Set Up Your Test Fixture</a></li>
+      <li><a href="#preconditions">Add Test Preconditions</a></li>
+      <li><a href="#test_method">Add Test Methods to Verify Your Activity</a></li>
+      </ol>
+  </li>
+  <li><a href="#build_run">Build and Run Your Test</a></li>
+</ol>
+
+<h2>You should also read</h2>
+<ul>
+<li><a href="{@docRoot}tools/testing/testing_android.html">Testing
+Fundamentals</a></li>
+</ul>
+
+</div>
+</div>
+<p>In order to verify that there are no regressions in the layout design and
+functional behavior in your application, it's important to
+create a test for each {@link android.app.Activity} in your application. For
+each test, you need to create the individual parts of a test case, including
+the test fixture, preconditions test method, and {@link android.app.Activity}
+test methods. You can then run your test to get a test report. If any test
+method fails, this might indicate a potential defect in your code.</p>
+<p class="note"><strong>Note:</strong> In the Test-Driven Development (TDD)
+approach, instead of writing most or all of your app code up-front and then
+running tests later in the development cycle, you would progressively write
+just enough production code to satisfy your test dependencies, update your
+test cases to reflect new functional requirements, and iterate repeatedly this
+way.</p>
+
+<h2 id="testcase">Create a Test Case</h2>
+<p>{@link android.app.Activity} tests are written in a structured way.
+Make sure to put your tests in a separate package, distinct from the code under
+test.</p>
+<p>By convention, your test package name should follow the same name as the
+application package, suffixed with <strong>".tests"</strong>. In the test package
+you created, add the Java class for your test case. By convention, your test case
+name should also follow the same name as the Java or Android class that you
+want to test, but suffixed with <strong>“Test”</strong>.</p>
+<p>To create a new test case in Eclipse:</p>
+<ol type="a">
+   <li>In the Package Explorer, right-click on the {@code /src} directory for
+your test project and select <strong>New &gt; Package</strong>.</li>
+   <li>Set the <strong>Name</strong> field to
+{@code &lt;your_app_package_name&gt;.tests} (for example,
+{@code com.example.android.testingfun.tests}) and click
+<strong>Finish</strong>.</li>
+   <li>Right-click on the test package you created, and select
+<strong>New &gt; Class</strong>.</li>
+    <li>Set the <strong>Name</strong> field to
+{@code &lt;your_app_activity_name&gt;Test} (for example,
+{@code MyFirstTestActivityTest}) and click <strong>Finish</strong>.</li>
+</ol>
+
+<h3 id="fixture">Set Up Your Test Fixture</h3>
+<p>A <em>test fixture</em> consists of objects that must be initialized for
+running one or more tests. To set up the test fixture, you can override the
+{@link junit.framework.TestCase#setUp()} and
+{@link junit.framework.TestCase#tearDown()} methods in your test. The
+test runner automatically runs {@link junit.framework.TestCase#setUp()} before
+running any other test methods, and {@link junit.framework.TestCase#tearDown()}
+at the end of each test method execution. You can use these methods to keep
+the code for test initialization and clean up separate from the tests methods.
+</p>
+<p>To set up your test fixture in Eclipse:</p>
+<ol>
+<li>In the Package Explorer, double-click on the test case that you created
+earlier to bring up the Eclipse Java editor, then modify your test case class
+to extend one of the sub-classes of {@link android.test.ActivityTestCase}.
+<p>For example:</p>
+<pre>
+public class MyFirstTestActivityTest
+        extends ActivityInstrumentationTestCase2&lt;MyFirstTestActivity&gt; {
+</pre>
+</li>
+<li>Next, add the constructor and {@link junit.framework.TestCase#setUp()}
+methods to your test case, and add variable declarations for the
+{@link android.app.Activity} that you want to test.</p>
+<p>For example:</p>
+<pre>
+public class MyFirstTestActivityTest
+        extends ActivityInstrumentationTestCase2&lt;MyFirstTestActivity&gt; {
+
+    private MyFirstTestActivity mFirstTestActivity;
+    private TextView mFirstTestText;
+
+    public MyFirstTestActivityTest() {
+        super(MyFirstTestActivity.class);
+    }
+
+    &#64;Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        mFirstTestActivity = getActivity();
+        mFirstTestText =
+                (TextView) mFirstTestActivity
+                .findViewById(R.id.my_first_test_text_view);
+    }
+}
+</pre>
+<p>The constructor is invoked by the test runner to instantiate the test
+class, while the {@link junit.framework.TestCase#setUp()} method is invoked by
+the test runner before it runs any tests in the test class.</p>
+</li>
+</ol>
+
+<p>Typically, in the {@link junit.framework.TestCase#setUp()} method, you
+should:</p>
+<ul>
+<li>Invoke the superclass constructor for
+{@link junit.framework.TestCase#setUp()}, which is required by JUnit.</li>
+<li>Initialize your test fixture state by:
+   <ul>
+   <li>Defining the instance variables that store the state of the fixture.</li>
+   <li>Creating and storing a reference to an instance of the
+{@link android.app.Activity} under test.</li>
+   <li>Obtaining a reference to any UI components in the
+{@link android.app.Activity} that you want to test.</li>
+   </ul>
+</ul>
+
+<p>You can use the
+{@link android.test.ActivityInstrumentationTestCase2#getActivity()} method to
+get a reference to the {@link android.app.Activity} under test.</p>
+
+<h3 id="preconditions">Add Test Preconditions</h3>
+<p>As a sanity check, it is good practice to verify that the test fixture has
+been set up correctly, and the objects that you want to test have been correctly
+instantiated or initialized. That way, you won’t have to see
+tests failing because something was wrong with the setup of your test fixture.
+By convention, the method for verifying your test fixture is called
+{@code testPreconditions()}.</p>
+
+<p>For example, you might want to add a {@code testPreconditons()} method like
+this to your test case:</p>
+
+<pre>
+public void testPreconditions() {
+    assertNotNull(“mFirstTestActivity is null”, mFirstTestActivity);
+    assertNotNull(“mFirstTestText is null”, mFirstTestText);
+}
+</pre>
+
+<p>The assertion methods are from the JUnit {@link junit.framework.Assert}
+class. Generally, you can use assertions to
+verify if a specific condition that you want to test is true.
+<ul>
+<li>If the condition is false, the assertion method throws an
+{@link android.test.AssertionFailedError} exception, which is then typically
+reported by the test runner. You can provide a string in the first argument of
+your assertion method to give some contextual details if the assertion fails.</li>
+<li>If the condition is true, the test passes.</li>
+</ul>
+<p>In both cases, the test runner proceeds to run the other test methods in the
+test case.</p>
+
+<h3 id="test_method">Add Test Methods to Verify Your Activity</h3>
+<p>Next, add one or more test methods to verify the layout and functional
+behavior of your {@link android.app.Activity}.</p>
+<p>For example, if your {@link android.app.Activity} includes a
+{@link android.widget.TextView}, you can add a test method like this to check
+that it has the correct label text:</p>
+<pre>
+public void testMyFirstTestTextView_labelText() {
+    final String expected =
+            mFirstTestActivity.getString(R.string.my_first_test);
+    final String actual = mFirstTestText.getText().toString();
+    assertEquals(expected, actual);
+}
+</pre>
+
+<p>The {@code testMyFirstTestTextView_labelText()} method simply checks that the
+default text of the {@link android.widget.TextView} that is set by the layout
+is the same as the expected text defined in the {@code strings.xml} resource.</p>
+<p class="note"><strong>Note:</strong> When naming test methods, you can use
+an underscore to separate what is being tested from the specific case being
+tested. This style makes it easier to see exactly what cases are being tested.</p>
+<p>When doing this type of string value comparison, it’s good practice to read
+the expected string from your resources, instead of hardcoding the string in
+your comparison code. This prevents your test from easily breaking whenever the
+string definitions are modified in the resource file.</p>
+<p>To perform the comparison, pass both the expected and actual strings as
+arguments to the
+{@link junit.framework.Assert#assertEquals(java.lang.String, java.lang.String) assertEquals()}
+method. If the values are not the same, the assertion will throw an
+{@link junit.framework.AssertionFailedError} exception.</p>
+<p>If you added a {@code testPreconditions()} method, put your test methods
+after the {@code testPreconditions()} definition in your Java class.</p>
+<p>For a complete test case example, take a look at
+{@code MyFirstTestActivityTest.java} in the sample app.</p>
+
+<h2 id="build_run">Build and Run Your Test</h2>
+<p>You can build and run your test easily from the Package Explorer in
+Eclipse.</p>
+<p>To build and run your test:</p>
+<ol>
+<li>Connect an Android device to your machine. On the device or emulator, open
+the <strong>Settings</strong> menu, select <strong>Developer options</strong>
+and make sure that USB debugging is enabled.</li>
+<li>In the Project Explorer, right-click on the test class that you created
+earlier and select <strong>Run As &gt; Android Junit Test</strong>.</li>
+<li>In the Android Device Chooser dialog, select the device that you just
+connected, then click <strong>OK</strong>.</li>
+<li>In the JUnit view, verify that the test passes with no errors or failures.</li>
+</ol>
+<p>For example, if the test case passes with no errors, the result should look
+like this:</p>
+<img src="{@docRoot}images/training/activity-testing_lesson2_MyFirstTestActivityTest_result.png" alt="" />
+<p class="img-caption">
+  <strong>Figure 1.</strong> Result of a test with no errors.
+</p>
+
+
+
diff --git a/docs/html/training/activity-testing/activity-functional-testing.jd b/docs/html/training/activity-testing/activity-functional-testing.jd
new file mode 100644
index 0000000..7c8ff1d
--- /dev/null
+++ b/docs/html/training/activity-testing/activity-functional-testing.jd
@@ -0,0 +1,166 @@
+page.title=Creating Functional Tests
+trainingnavtop=true
+@jd:body
+
+<!-- This is the training bar -->
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>This lesson teaches you to</h2>
+<ol>
+   <li><a href="#test_methods">Add Test Method to Validate Functional Behavior</a>
+   <ol>
+      <li><a href="#activitymonitor">Set Up an ActivityMonitor</a></li>
+      <li><a href="#keyinput">Send Keyboard Input Using Instrumentation</a></li>
+   </ol>
+   </li>
+</ol>
+
+<h2>Try it out</h2>
+<div class="download-box">
+ <a href="http://developer.android.com/shareables/training/AndroidTestingFun.zip"
+class="button">Download the demo</a>
+ <p class="filename">AndroidTestingFun.zip</p>
+</div>
+
+</div>
+</div>
+<p>Functional testing involves verifying that individual application
+components work together as expected by the user. For example, you can create a
+functional test to verify that an {@link android.app.Activity} correctly
+launches a target {@link android.app.Activity} when the user performs a UI
+interaction.</p>
+
+<p>To create a functional test for your {@link android.app.Activity}, your test
+class should extend {@link android.test.ActivityInstrumentationTestCase2}.
+Unlike {@link android.test.ActivityUnitTestCase},
+tests in {@link android.test.ActivityInstrumentationTestCase2} can
+communicate with the Android system and send keyboard input and click events to
+the UI.</p>
+
+<p>For a complete test case example, take a look at
+{@code SenderActivityTest.java} in the sample app.</p>
+
+<h2 id="test_methods">Add Test Method to Validate Functional Behavior</h2>
+<p id="test_goals">Your functional testing goals might include:</p>
+<ul>
+<li>Verifying that a target {@link android.app.Activity} is started when a
+UI control is pushed in the sender {@link android.app.Activity}.</li>
+<li>Verifying that the target {@link android.app.Activity} displays the
+correct data based on the user's input in the sender
+{@link android.app.Activity}.</li>
+</ul>
+<p>You might implement your test method like this:</p>
+
+<pre>
+&#64;MediumTest
+public void testSendMessageToReceiverActivity() {
+    final Button sendToReceiverButton = (Button) 
+            mSenderActivity.findViewById(R.id.send_message_button);
+
+    final EditText senderMessageEditText = (EditText) 
+            mSenderActivity.findViewById(R.id.message_input_edit_text);
+
+    // Set up an ActivityMonitor
+    ...
+
+    // Send string input value
+    ...
+
+    // Validate that ReceiverActivity is started
+    ...
+
+    // Validate that ReceiverActivity has the correct data
+    ...
+
+    // Remove the ActivityMonitor
+    ...
+}
+</pre>
+<p>The test waits for an {@link android.app.Activity} that matches this monitor,
+otherwise returns null after a timeout elapses. If {@code ReceiverActivity} was
+started, the {@link android.app.Instrumentation.ActivityMonitor ActivityMonitor}
+that you set
+up earlier receives a hit. You can use the assertion methods to verify that
+the {@code ReceiverActivity} is indeed started, and that the hit count on the
+{@link android.app.Instrumentation.ActivityMonitor ActivityMonitor} incremented
+as expected.</p>
+
+<h2 id="activitymonitor">Set up an ActivityMonitor</h2>
+<p>To monitor a single {@link android.app.Activity} in your application, you
+can register an {@link android.app.Instrumentation.ActivityMonitor ActivityMonitor}.
+The {@link android.app.Instrumentation.ActivityMonitor ActivityMonitor} is
+notified by the system whenever an {@link android.app.Activity} that matches your criteria is started.
+If a match is found, the monitor’s hit count is updated.</p>
+<p>Generally, to use an
+{@link android.app.Instrumentation.ActivityMonitor ActivityMonitor}, you should:</p>
+<ol>
+<li>Retrieve the {@link android.app.Instrumentation} instance for your test
+case by using the
+{@link android.test.InstrumentationTestCase#getInstrumentation()} method.</li>
+<li>Add an instance of {@link android.app.Instrumentation.ActivityMonitor} to
+the current instrumentation using one of the {@link android.app.Instrumentation}
+{@code addMonitor()} methods. The match criteria can be specified as an
+{@link android.content.IntentFilter} or a class name string.</li>
+<li>Wait for the {@link android.app.Activity} to start.</li>
+<li>Verify that the monitor hits were incremented.</li>
+<li>Remove the monitor.</li>
+</ol>
+<p>For example:</p>
+<pre>
+// Set up an ActivityMonitor
+ActivityMonitor receiverActivityMonitor =
+        getInstrumentation().addMonitor(ReceiverActivity.class.getName(),
+        null, false);
+
+// Validate that ReceiverActivity is started
+TouchUtils.clickView(this, sendToReceiverButton);
+ReceiverActivity receiverActivity = (ReceiverActivity) 
+        receiverActivityMonitor.waitForActivityWithTimeout(TIMEOUT_IN_MS);
+assertNotNull("ReceiverActivity is null", receiverActivity);
+assertEquals("Monitor for ReceiverActivity has not been called",
+        1, receiverActivityMonitor.getHits());
+assertEquals("Activity is of wrong type",
+        ReceiverActivity.class, receiverActivity.getClass());
+
+// Remove the ActivityMonitor
+getInstrumentation().removeMonitor(receiverActivityMonitor);
+</pre>
+
+<h2 id="keyinput">Send Keyboard Input Using Instrumentation</h2>
+<p>If your {@link android.app.Activity} has an {@link android.widget.EditText}
+field, you might want to test that users can enter values into the
+{@link android.widget.EditText} object.</p>
+<p>Generally, to send a string input value to an {@link android.widget.EditText}
+object in {@link android.test.ActivityInstrumentationTestCase2}, you should:</p>
+<ol>
+<li>Use the {@link android.app.Instrumentation#runOnMainSync(java.lang.Runnable) runOnMainSync()}
+method to run the {@link android.view.View#requestFocus()} call synchronously
+in a loop. This way, the UI thread is blocked until focus is received.</li>
+<li>Call {@link android.app.Instrumentation#waitForIdleSync()} method to wait
+for the main thread to become idle (that is, have no more events to process).</li>
+<li>Send a text string to the {@link android.widget.EditText} by calling
+{@link android.app.Instrumentation#sendStringSync(java.lang.String)
+sendStringSync()} and pass your input string as the parameter.</p>
+</ol>
+<p>For example:</p>
+<pre>
+// Send string input value
+getInstrumentation().runOnMainSync(new Runnable() {
+    &#64;Override
+    public void run() {
+        senderMessageEditText.requestFocus();
+    }
+});
+getInstrumentation().waitForIdleSync();
+getInstrumentation().sendStringSync("Hello Android!");
+getInstrumentation().waitForIdleSync();
+</pre>
+
+
+
+
+
+
+
+
diff --git a/docs/html/training/activity-testing/activity-ui-testing.jd b/docs/html/training/activity-testing/activity-ui-testing.jd
new file mode 100644
index 0000000..644f3ca
--- /dev/null
+++ b/docs/html/training/activity-testing/activity-ui-testing.jd
@@ -0,0 +1,216 @@
+page.title=Testing UI Components
+trainingnavtop=true
+
+@jd:body
+
+<!-- This is the training bar -->
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>This lesson teaches you to</h2>
+<ol>
+  <li><a href="#testcase">Create a Test Case for UI Testing with Instrumentation</a>
+  <li><a href="#test_method">Add Test Methods to Verify UI Behavior</a>
+     <ol>
+     <li><a href="#verify_button_display">Verify Button Layout Parameters</a></li>
+     <li><a href="#verify_TextView">Verify TextView Layout Parameters</a></li>
+     <li><a href="#verify_button_behavior">Verify Button Behavior</a></li>
+     </ol>
+  </li>
+  <li><a href="#annotations">Apply Test Annotations</a></li>
+</ol>
+
+<h2>Try it out</h2>
+<div class="download-box">
+ <a href="http://developer.android.com/shareables/training/AndroidTestingFun.zip"
+class="button">Download the demo</a>
+ <p class="filename">AndroidTestingFun.zip</p>
+</div>
+
+</div>
+</div>
+
+<p>Typically, your {@link android.app.Activity} includes user interface
+components (such as buttons, editable text fields, checkboxes, and pickers) to
+allow users to interact with your Android application. This lesson shows how
+you can test an {@link android.app.Activity} with a simple push-button UI. You
+can use the same general steps to test other, more sophisticated types of UI
+components.</p>
+
+<p class="note"><strong>Note:</strong> The type of UI testing in this lesson is
+called <em>white-box testing</em> because you have the
+source code for the application that you want to test. The Android
+<a href="{@docRoot}tools/testing/testing_android.html#Instrumentation">Instrumentation</a>
+framework is suitable for creating white-box tests for UI components within an
+application. An alternative type of UI testing is <em>black-box testing</em>,
+where you may not have access to the application source. This type of testing
+is useful when you want to test how your app interacts with other apps or with
+the system. Black-box testing is not covered in this training. To learn more
+about how to perform black-box testing on your Android apps, see the
+<a href="{@docRoot}tools/testing/testing_ui.html">UI Testing guide</a>.
+<p>For a complete test case example, take a look at
+{@code ClickFunActivityTest.java} in the sample app.</p>
+
+<h2 id="testcase">Create a Test Case for UI Testing with Instrumentation</h2>
+<p>When testing an {@link android.app.Activity} that has a user interface (UI),
+the {@link android.app.Activity} under test runs in the UI thread. However, the
+test application itself runs in a separate thread in the same process as the
+application under test. This means that your test app can reference objects
+from the UI thread, but if it attempts to change properties on those objects or
+send events to the UI thread, you will usually get a {@code WrongThreadException}
+error.</p>
+<p>To safely inject {@link android.content.Intent} objects into your
+{@link android.app.Activity} or run test methods on the UI thread, you can
+extend your test class to use {@link android.test.ActivityInstrumentationTestCase2}.
+To learn more about how to run test methods on the UI thread, see
+<a href="{@docRoot}tools/testing/activity_testing.html#RunOnUIThread">Testing
+on the UI thread</a>.</p>
+
+<h3 id="fixture">Set Up Your Test Fixture</h3>
+<p>When setting up the test fixture for UI testing, you should specify the
+<a href="{@docRoot}guide/topics/ui/ui-events.html#TouchMode">touch mode</a>
+in your {@link junit.framework.TestCase#setUp()} method. Setting the touch mode
+to {@code true} prevents the UI control from taking focus when you click it
+programmatically in the test method later (for example, a button UI will just
+fire its on-click listener). Make sure that you call
+{@link android.test.ActivityInstrumentationTestCase2#setActivityInitialTouchMode(boolean) setActivityInitialTouchMode()}
+before calling {@link android.test.ActivityInstrumentationTestCase2#getActivity()}.
+</p>
+<p>For example:</ap>
+<pre>
+public class ClickFunActivityTest
+        extends ActivityInstrumentationTestCase2<ClickFunActivity> {
+    ...
+    &#64;Override
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        setActivityInitialTouchMode(true);
+
+        mClickFunActivity = getActivity();
+        mClickMeButton = (Button) 
+                mClickFunActivity
+                .findViewById(R.id.launch_next_activity_button);
+        mInfoTextView = (TextView) 
+                mClickFunActivity.findViewById(R.id.info_text_view);
+    }
+}
+</pre>
+
+<h2 id="test_methods">Add Test Methods to Validate UI Behavior</h2>
+<p id="test_goals">Your UI testing goals might include:</p>
+<ul>
+<li>Verifying that a button is displayed with the correct layout when the
+{@link android.app.Activity} is launched.</li>
+<li>Verifying that a {@link android.widget.TextView} is initially hidden.</li>
+<li>Verifying that a {@link android.widget.TextView} displays the expected string
+when a button is pushed.</li>
+</ul>
+<p>The following section demonstrates how you can implement test methods
+to perform these verifications.</p>
+
+<h3 id="verify_button_display">Verify Button Layout Parameters</h3>
+<p>You might add a test method like this to verify that a button is displayed
+correctly in your {@link android.app.Activity}:</p>
+<pre>
+&#64;MediumTest
+public void testClickMeButton_layout() {
+    final View decorView = mClickFunActivity.getWindow().getDecorView();
+
+    ViewAsserts.assertOnScreen(decorView, mClickMeButton);
+
+    final ViewGroup.LayoutParams layoutParams =
+            mClickMeButton.getLayoutParams();
+    assertNotNull(layoutParams);
+    assertEquals(layoutParams.width, WindowManager.LayoutParams.MATCH_PARENT);
+    assertEquals(layoutParams.height, WindowManager.LayoutParams.WRAP_CONTENT);
+}
+</pre>
+
+<p>In the {@link android.test.ViewAsserts#assertOnScreen(android.view.View,android.view.View) assertOnScreen()}
+method call, you should pass in the root view and the view that you are
+expecting to be present on the screen. If the expected view is not found in the
+root view, the assertion method throws an {@link junit.framework.AssertionFailedError}
+exception, otherwise the test passes.</p>
+<p>You can also verify that the layout of a {@link android.widget.Button} is
+correct by getting a reference to its {@link android.view.ViewGroup.LayoutParams}
+object, then call assertion methods to verify that the
+{@link android.widget.Button} object's width and height attributes match the
+expected values.</p>
+<p>The {@code &#64;MediumTest} annotation specifies how the test is categorized,
+relative to its absolute execution time. To learn more about using test size
+annotations, see <a href="#annotations">Apply Test Annotations</a>.</p>
+
+<h3 id="verify_TextView">Verify TextView Layout Parameters</h3>
+<p>You might add a test method like this to verify that a
+{@link android.widget.TextView} initially appears hidden in
+your {@link android.app.Activity}:</p>
+<pre>
+&#64;MediumTest
+public void testInfoTextView_layout() {
+    final View decorView = mClickFunActivity.getWindow().getDecorView();
+    ViewAsserts.assertOnScreen(decorView, mInfoTextView);
+    assertTrue(View.GONE == mInfoTextView.getVisibility());
+}
+</pre>
+<p>You can call {@link android.view.Window#getDecorView()} to get a reference
+to the decor view for the {@link android.app.Activity}. The decor view is the
+top-level ViewGroup ({@link android.widget.FrameLayout}) view in the layout
+hierarchy.</p>
+
+<h3 id="verify_button_behavior">Verify Button Behavior</h3>
+<p>You can use a test method like this to verify that a
+{@link android.widget.TextView} becomes visible when a
+{@link android.widget.Button} is pushed:</p>
+
+<pre>
+&#64;MediumTest
+public void testClickMeButton_clickButtonAndExpectInfoText() {
+    String expectedInfoText = mClickFunActivity.getString(R.string.info_text);
+    TouchUtils.clickView(this, mClickMeButton);
+    assertTrue(View.VISIBLE == mInfoTextView.getVisibility());
+    assertEquals(expectedInfoText, mInfoTextView.getText());
+}
+</pre>
+
+<p>To programmatically click a {@link android.widget.Button} in your
+test, call {@link android.test.TouchUtils#clickView(android.test.InstrumentationTestCase,android.view.View) clickView()}.
+You must pass in a reference to the test case that is being run and a reference
+to the {@link android.widget.Button} to manipulate.</p>
+
+<p class="note"><strong>Note: </strong>The {@link android.test.TouchUtils}
+helper class provides convenience methods for simulating touch interactions
+with your application. You can use these methods to simulate clicking, tapping,
+and dragging of Views or the application screen.</p>
+<p class="caution"><strong>Caution: </strong>The {@link android.test.TouchUtils}
+methods are designed to send events to the UI thread safely from the test thread.
+You should not run {@link android.test.TouchUtils} directly in the UI thread or
+any test method annotated with {@code &#64;UIThread}. Doing so might
+raise the {@code WrongThreadException}.</p>
+
+<h2 id="annotations">Apply Test Annotations</h2>
+<p>The following annotations can be applied to indicate the size of a test
+method:</p>
+<dl>
+<dt>{@link
+android.test.suitebuilder.annotation.SmallTest &#64;SmallTest}</dt>
+<dd>Marks a test that should run as part of the small tests.</dd>
+<dt>{@link
+android.test.suitebuilder.annotation.MediumTest &#64;MediumTest}</dt>
+<dd>Marks a test that should run as part of the medium tests.</dd>
+<dt>{@link android.test.suitebuilder.annotation.LargeTest &#64;LargeTest}</dt>
+<dd>Marks a test that should run as part of the large tests.</dd>
+</dl>
+<p>Typically, a short running test that take only a few milliseconds should be
+marked as a {@code &#64;SmallTest}. Longer running tests (100 milliseconds or
+more) are usually marked as {@code &#64;MediumTest}s or {@code &#64;LargeTest}s,
+depending on whether the test accesses resources on the local system only or
+remote resources over a network. For guidance on using test size annotations,
+see this <a href="https://plus.sandbox.google.com/+AndroidDevelopers/posts/TPy1EeSaSg8">Android Tools Protip</a>.</p>
+<p>You can mark up your test methods with other test annotations to control
+how the tests are organized and run. For more information on other annotations,
+see the {@link java.lang.annotation.Annotation} class reference.</p>
+
+
+
+
diff --git a/docs/html/training/activity-testing/activity-unit-testing.jd b/docs/html/training/activity-testing/activity-unit-testing.jd
new file mode 100644
index 0000000..74dcda9
--- /dev/null
+++ b/docs/html/training/activity-testing/activity-unit-testing.jd
@@ -0,0 +1,134 @@
+page.title=Creating Unit Tests
+trainingnavtop=true
+@jd:body
+
+<!-- This is the training bar -->
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>This lesson teaches you to</h2>
+<ol>
+  <li><a href="#testcase">Create a Test Case for Activity Unit Testing</a>
+  <li><a href="#test_method">Validate Launch of Another Activity</a>
+</ol>
+
+<h2>Try it out</h2>
+<div class="download-box">
+ <a href="http://developer.android.com/shareables/training/AndroidTestingFun.zip"
+class="button">Download the demo</a>
+ <p class="filename">AndroidTestingFun.zip</p>
+</div>
+
+</div>
+</div>
+
+<p>An {@link android.app.Activity} unit test is an excellent way to quickly
+verify the state of an {@link android.app.Activity} and its interactions with
+other components in isolation (that is, disconnected from the rest of the
+system). A unit test generally tests the smallest possible unit of code
+(which could be a method, class, or component), without dependencies on system
+or network resources. For example, you can write a unit test to check
+that an {@link android.app.Activity} has the correct layout or that it
+triggers an {@link android.content.Intent} object correctly.</p>
+<p>Unit tests are generally not suitable for testing complex UI interaction
+events with the system. Instead, you should use
+the {@link android.test.ActivityInstrumentationTestCase2} class, as described
+in <a href="activity-ui-testing.html">Testing UI Components</a>.</p>
+<p>This lesson shows how you can write a unit test to verify that an
+{@link android.content.Intent} is triggered to launch another
+{@link android.app.Activity}.
+Since the test runs in an isolated environment, the
+{@link android.content.Intent}
+is not actually sent to the Android system, but you can inspect that the
+{@link android.content.Intent} object's payload data is accurate.</p>
+<p>For a complete test case example, take a look at
+{@code LaunchActivityTest.java} in the sample app.</p>
+
+<p class="note"><strong>Note: </strong>To test against system or external
+dependencies, you can use mock objects from a mocking
+framework and inject them into your unit tests. To learn more about the mocking
+framework provided by Android, see
+<a href="{@docRoot}tools/testing/testing_android.html#MockObjectClasses}">Mock
+Object Classes</a>.</p>
+
+<h2 id="testcase">Create a Test Case for Activity Unit Testing</h2>
+<p>The {@link android.test.ActivityUnitTestCase} class provides support for
+isolated testing of a single {@link android.app.Activity}. To create a unit
+test for your {@link android.app.Activity}, your test class should extend
+{@link android.test.ActivityUnitTestCase}.</p>
+
+<p>The {@link android.app.Activity} in an {@link android.test.ActivityUnitTestCase}
+is not automatically started by Android Instrumentation. To start the
+{@link android.app.Activity} in isolation, you need to explicitly call the
+{@link android.test.ActivityUnitTestCase#startActivity(android.content.Intent, android.os.Bundle, java.lang.Object) startActivity()}
+method, and pass in the {@link android.content.Intent} to
+launch your target {@link android.app.Activity}.</p>
+
+<p>For example:</p>
+<pre>
+public class LaunchActivityTest
+        extends ActivityUnitTestCase&lt;LaunchActivity&gt; {
+    ...
+
+    &#64;Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        mLaunchIntent = new Intent(getInstrumentation()
+                .getTargetContext(), LaunchActivity.class);
+        startActivity(mLaunchIntent, null, null);
+        final Button launchNextButton =
+                (Button) getActivity()
+                .findViewById(R.id.launch_next_activity_button);
+    }
+}
+</pre>
+
+<h2 id="test_method">Validate Launch of Another Activity</h2>
+<p id="test_goals">Your unit testing goals might include:</p>
+<ul>
+<li>Verifying that {@code LaunchActivity} fires an
+{@link android.content.Intent} when a button is pushed clicked.</li>
+<li>Verifying that the launched {@link android.content.Intent} contains the
+correct payload data.</li>
+</ul>
+
+<p>To verify if an {@link android.content.Intent} was triggered
+following the {@link android.widget.Button} click, you can use the
+{@link android.test.ActivityUnitTestCase#getStartedActivityIntent()} method.
+By using assertion methods, you can verify that the returned
+{@link android.content.Intent} is not null, and that it contains the expected
+string value to launch the next {@link android.app.Activity}. If both assertions
+evaluate to {@code true}, you've successfully verified that the
+{@link android.content.Intent} was correctly sent by your
+{@link android.app.Activity}.</p>
+
+<p>You might implement your test method like this:</p>
+<pre>
+&#64;MediumTest
+public void testNextActivityWasLaunchedWithIntent() {
+    startActivity(mLaunchIntent, null, null);
+    final Button launchNextButton =
+            (Button) getActivity()
+            .findViewById(R.id.launch_next_activity_button);
+    launchNextButton.performClick();
+
+    final Intent launchIntent = getStartedActivityIntent();
+    assertNotNull("Intent was null", launchIntent);
+    assertTrue(isFinishCalled());
+
+    final String payload =
+            launchIntent.getStringExtra(NextActivity.EXTRAS_PAYLOAD_KEY);
+    assertEquals("Payload is empty", LaunchActivity.STRING_PAYLOAD, payload);
+}
+</pre>
+<p>Because {@code LaunchActivity} runs in isolation, you cannot use the
+{@link android.test.TouchUtils} library to manipulate UI controls. To directly
+click a {@link android.widget.Button}, you can call the
+{@link android.view.View#performClick()} method instead.</p>
+
+
+
+
+
+
+
diff --git a/docs/html/training/activity-testing/index.jd b/docs/html/training/activity-testing/index.jd
new file mode 100644
index 0000000..ddede71
--- /dev/null
+++ b/docs/html/training/activity-testing/index.jd
@@ -0,0 +1,68 @@
+page.title=Testing Your Android Activity
+page.tags="testing"
+
+trainingnavtop=true
+startpage=true
+
+@jd:body
+
+<div id="tb-wrapper">
+<div id="tb">
+
+<!-- Required platform, tools, add-ons, devices, knowledge, etc. -->
+<h2>Dependencies and prerequisites</h2>
+<ul>
+  <li>Android 2.2 (API Level 8) or higher.</li>
+</ul>
+
+<h2>You Should Also Read</h2>
+<ul>
+<li><a href="{@docRoot}tools/testing/index.html">Testing
+(Developer's Guide)</a></li>
+</ul>
+
+</div>
+</div>
+
+<p>You should be writing and running tests as part of your Android application
+development cycle. Well-written tests can help you to catch bugs early in
+development and give you confidence in your code.</p>
+
+<p>A <em>test case</em> defines a set of objects and methods to run multiple
+tests independently from each other. Test cases can be organized into
+<em>test suites</em> and run programmatically, in a repeatable manner, with
+a <em>test runner</em> provided by a testing framework.</p>
+
+<p>The lessons in this class teaches you how to use the Android's custom
+testing framework that is based on the popular JUnit framework. You can
+write test cases to verify specific behavior in your application, and check for
+consistency across different Android devices. Your test cases also serve as a
+form of internal code documentation by describing the expected behavior of
+app components.</p>
+
+<h2>Lessons</h2>
+
+<!-- Create a list of the lessons in this class along with a short description
+of each lesson. These should be short and to the point. It should be clear from
+reading the summary whether someone will want to jump to a lesson or not.-->
+
+<dl>
+  <dt><b><a href="preparing-activity-testing.html">Setting Up Your Test
+Environment</a></b></dt>
+    <dd>Learn how to create your test project.</dd>
+  <dt><b><a href="activity-basic-testing.html">Creating and Running a Test 
+Case</a></b></dt>
+    <dd>Learn how to write test cases to verify the
+expected properties of your {@link android.app.Activity}, and run the test
+cases with the {@code Instrumentation} test runner provided by the Android
+framework.</dd>
+  <dt><b><a href="activity-ui-testing.html">Testing UI Components</a></b></dt>
+    <dd>Learn how to test the behavior of specific UI
+components in your {@link android.app.Activity}.</dd>
+  <dt><b><a href="activity-unit-testing.html">Creating Unit Tests</a></b></dt>
+    <dd>Learn how to how to perform unit testing to
+verify the behavior of an Activity in isolation.</dd>
+  <dt><b><a href="activity-functional-testing.html">Creating Functional Tests</a></b></dt>
+    <dd>Learn how to perform functional testing to
+verify the interaction of multiple Activities.</dd>
+
diff --git a/docs/html/training/activity-testing/preparing-activity-testing.jd b/docs/html/training/activity-testing/preparing-activity-testing.jd
new file mode 100644
index 0000000..c43c9ed
--- /dev/null
+++ b/docs/html/training/activity-testing/preparing-activity-testing.jd
@@ -0,0 +1,95 @@
+page.title=Setting Up Your Test Environment
+trainingnavtop=true
+
+@jd:body
+
+<!-- This is the training bar -->
+<div id="tb-wrapper">
+<div id="tb">
+
+<h2>This lesson teaches you to</h2>
+<ol>
+  <li><a href="#eclipse">Set Up Eclipse for Testing</a></li>
+  <li><a href="#cmdline">Set Up the Command Line Interface for Testing</a></li>
+</ol>
+
+<h2>You should also read</h2>
+<ul>
+<li><a href="{@docRoot}sdk/index.html">Getting the SDK Bundle</a></li>
+<li><a href="{@docRoot}tools/testing/testing_eclipse.html">Testing from Eclipse
+with ADT</a></li>
+<li><a href="{@docRoot}tools/testing/testing_otheride.html">Testing from Other
+IDEs</a></li>
+</ul>
+
+<h2>Try it out</h2>
+<div class="download-box">
+ <a href="http://developer.android.com/shareables/training/AndroidTestingFun.zip"
+class="button">Download the demo</a>
+ <p class="filename">AndroidTestingFun.zip</p>
+</div>
+
+</div>
+</div>
+
+<p>Before you start writing and running your tests, you should set up your test
+development environment. This lesson teaches you how to set up the Eclipse
+IDE to build and run tests, and how to
+build and run tests with the Gradle framework by using the command line
+interface.</p>
+
+<p class="note"><strong>Note:</strong> To help you get started, the lessons are
+based on Eclipse with the ADT plugin. However, for your own test development, you
+are free to use the IDE of your choice or the command-line.</p>
+
+<h2 id="eclipse">Set Up Eclipse for Testing</h2>
+<p>Eclipse with the Android Developer Tools (ADT) plugin provides an integrated
+development environment for you to create, build, and run Android application
+test cases from a graphical user interface (GUI). A convenient feature that
+Eclipse provides is the ability to auto-generate a new test project that
+corresponds with your Android application project</a>.
+
+<p>To set up your test environment in Eclipse:</p>
+
+<ol>
+<li><a href="{@docRoot}sdk/installing/bundle.html">Download and install the
+Eclipse ADT plugin</a>, if you haven’t installed it yet.</li>
+<li>Import or create the Android application project that you want to test
+against.</li>
+<li>Generate a test project that corresponds to the application project under
+test. To generate a test project for the app project that you imported:</p>
+   <ol type="a">
+   <li>In the Package Explorer, right-click on your app project, then
+select <strong>Android Tools</strong> &gt; <strong>New Test Project</strong>.</li>
+   <li>In the New Android Test Project wizard, set the property
+values for your test project then click <strong>Finish</strong>.</li>
+   </ol>
+</li>
+</ol>
+<p>You should now be able to create, build, and run test
+cases from your Eclipse environment. To learn how to perform these tasks in
+Eclipse, proceed to <a href="activity-basic-testing.html">Creating and Running 
+a Test Case</a>.</p>
+
+<h2 id="cmdline">Set Up the Command Line Interface for Testing</h2>
+<p>If you are using Gradle version 1.6 or higher as your build environment, you
+can build and run your Android application tests from the command line by using
+the Gradle Wrapper. Make sure that in your {@code gradle.build} file, the
+<a href={@docRoot}guide/topics/manifest/uses-sdk-element.html#min>minSdkVersion</a>
+attribute in the {@code defaultConfig} section is set to 8 or higher. You can
+refer to the sample {@code gradle.build} file that is
+included in the download bundle for this training class.</p>
+<p>To run your tests with the Gradle Wrapper:</p>
+<ol>
+   <li>Connect a physical Android device to your machine or launch the Android
+Emulator.</li>
+   <li>Run the following command from your project directory:
+      <pre>./gradlew build connectedCheck</pre>
+   </li>
+</ol>
+<p>To learn more about using Gradle for Android testing, see the
+<a href="//tools.android.com/tech-docs/new-build-system/user-guide#TOC-Testing">Gradle Plugin User Guide</a>.</p>
+<p>To learn more about using command line tools other than Gradle for test
+development, see
+<a href="{@docRoot}tools/testing/testing_otheride.html">Testing from Other IDEs</a>.</p>
+
diff --git a/docs/html/training/animation/crossfade.jd b/docs/html/training/animation/crossfade.jd
index 2fbb6c0..7e947f3 100644
--- a/docs/html/training/animation/crossfade.jd
+++ b/docs/html/training/animation/crossfade.jd
@@ -205,13 +205,13 @@
     // Animate the loading view to 0% opacity. After the animation ends,
     // set its visibility to GONE as an optimization step (it won't
     // participate in layout passes, etc.)
-    mHideView.animate()
+    mLoadingView.animate()
             .alpha(0f)
             .setDuration(mShortAnimationDuration)
             .setListener(new AnimatorListenerAdapter() {
                 &#64;Override
                 public void onAnimationEnd(Animator animation) {
-                    mHideView.setVisibility(View.GONE);
+                    mLoadingView.setVisibility(View.GONE);
                 }
             });
 }
diff --git a/docs/html/training/basics/actionbar/adding-buttons.jd b/docs/html/training/basics/actionbar/adding-buttons.jd
index 5fb0d59..26c9d0e 100644
--- a/docs/html/training/basics/actionbar/adding-buttons.jd
+++ b/docs/html/training/basics/actionbar/adding-buttons.jd
@@ -74,7 +74,21 @@
 Settings action should always appear in the overflow. (By default, all actions appear in the
 overflow, but it's good practice to explicitly declare your design intentions for each action.)
 
-<p>However, <strong>if your app is using the Support Library</strong> for compatibility on versions
+<p>The {@code icon} attribute requires a resource ID for an
+image. The name that follows {@code &#64;drawable/} must be the name of a bitmap image you've
+saved in your project's {@code res/drawable/} directory. For example,
+{@code "&#64;drawable/ic_action_search"} refers to {@code ic_action_search.png}.
+Likewise, the {@code title} attribute uses a string resource that's defined by an XML
+file in your project's {@code res/values/} directory, as discussed in <a
+href="{@docRoot}training/basics/firstapp/building-ui.html#Strings">Building a Simple User
+Interface</a>.
+
+<p class="note"><strong>Note:</strong> When creating icons and other bitmap images for your app,
+it's important that you provide multiple versions that are each optimized for a different screen
+density. This is discussed more in the lesson about <a
+href="{@docRoot}training/basics/supporting-devices/screens.html">Supporting Different Screens</a>.
+
+<p><strong>If your app is using the Support Library</strong> for compatibility on versions
 as low as Android 2.1, the {@code showAsAction} attribute is not available from
 the {@code android:} namespace. Instead this attribute is provided by the Support Library
 and you must define your own XML namespace and use that namespace as the attribute prefix.
diff --git a/docs/html/training/basics/actionbar/styling.jd b/docs/html/training/basics/actionbar/styling.jd
index a1cc10c..1f76e03 100644
--- a/docs/html/training/basics/actionbar/styling.jd
+++ b/docs/html/training/basics/actionbar/styling.jd
@@ -20,7 +20,7 @@
 <ul>
   <li><a href="{@docRoot}guide/topics/ui/themes.html">Styles and Themes</a></li>
   <li><a class="external-link" target="_blank"
-  href="http://jgilfelt.github.io/android-actionbarstylegenerator/">Android Action Bar Style
+  href="http://www.actionbarstylegenerator.com">Android Action Bar Style
   Generator</a></li>
 </ul>
 
@@ -146,13 +146,13 @@
     &lt;style name="CustomActionBarTheme"
            parent="&#64;style/Theme.Holo.Light.DarkActionBar">
         &lt;item name="android:actionBarStyle">&#64;style/MyActionBar&lt;/item>
-    &lt;style>
+    &lt;/style>
 
     &lt;!-- ActionBar styles -->
     &lt;style name="MyActionBar"
            parent="&#64;style/Widget.Holo.Light.ActionBar.Solid.Inverse">
         &lt;item name="android:background">&#64;drawable/actionbar_background&lt;/item>
-    &lt;style>
+    &lt;/style>
 &lt;/resources>
 </pre>
 
@@ -178,7 +178,7 @@
 
         &lt;!-- Support library compatibility -->
         &lt;item name="actionBarStyle">&#64;style/MyActionBar&lt;/item>
-    &lt;style>
+    &lt;/style>
 
     &lt;!-- ActionBar styles -->
     &lt;style name="MyActionBar"
@@ -187,7 +187,7 @@
 
         &lt;!-- Support library compatibility -->
         &lt;item name="background">&#64;drawable/actionbar_background&lt;/item>
-    &lt;style>
+    &lt;/style>
 &lt;/resources>
 </pre>
 
@@ -236,25 +236,25 @@
         &lt;item name="android:actionBarStyle">&#64;style/MyActionBar&lt;/item>
         &lt;item name="android:actionBarTabTextStyle">&#64;style/MyActionBarTabText&lt;/item>
         &lt;item name="android:actionMenuTextColor">&#64;color/actionbar_text&lt;/item>
-    &lt;style>
+    &lt;/style>
 
     &lt;!-- ActionBar styles -->
     &lt;style name="MyActionBar"
            parent="&#64;style/Widget.Holo.ActionBar">
         &lt;item name="android:titleTextStyle">&#64;style/MyActionBarTitleText&lt;/item>
-    &lt;style>
+    &lt;/style>
 
     &lt;!-- ActionBar title text -->
     &lt;style name="MyActionBarTitleText"
            parent="&#64;style/TextAppearance.Holo.Widget.ActionBar.Title">
         &lt;item name="android:textColor">&#64;color/actionbar_text&lt;/item>
-    &lt;style>
+    &lt;/style>
 
     &lt;!-- ActionBar tabs text styles -->
     &lt;style name="MyActionBarTabText"
            parent="&#64;style/Widget.Holo.ActionBar.TabText">
         &lt;item name="android:textColor">&#64;color/actionbar_text&lt;/item>
-    &lt;style>
+    &lt;/style>
 &lt;/resources>
 </pre>
 
@@ -280,7 +280,7 @@
         &lt;item name="actionBarStyle">&#64;style/MyActionBar&lt;/item>
         &lt;item name="actionBarTabTextStyle">&#64;style/MyActionBarTabText&lt;/item>
         &lt;item name="actionMenuTextColor">&#64;color/actionbar_text&lt;/item>
-    &lt;style>
+    &lt;/style>
 
     &lt;!-- ActionBar styles -->
     &lt;style name="MyActionBar"
@@ -289,21 +289,21 @@
 
         &lt;!-- Support library compatibility -->
         &lt;item name="titleTextStyle">&#64;style/MyActionBarTitleText&lt;/item>
-    &lt;style>
+    &lt;/style>
 
     &lt;!-- ActionBar title text -->
     &lt;style name="MyActionBarTitleText"
            parent="&#64;style/TextAppearance.<strong>AppCompat</strong>.Widget.ActionBar.Title">
         &lt;item name="android:textColor">&#64;color/actionbar_text&lt;/item>
         &lt;!-- The textColor property is backward compatible with the Support Library -->
-    &lt;style>
+    &lt;/style>
 
     &lt;!-- ActionBar tabs text -->
     &lt;style name="MyActionBarTabText"
            parent="&#64;style/Widget.<strong>AppCompat</strong>.ActionBar.TabText">
         &lt;item name="android:textColor">&#64;color/actionbar_text&lt;/item>
         &lt;!-- The textColor property is backward compatible with the Support Library -->
-    &lt;style>
+    &lt;/style>
 &lt;/resources>
 </pre>
 
@@ -392,14 +392,14 @@
     &lt;style name="CustomActionBarTheme"
            parent="&#64;style/Theme.Holo">
         &lt;item name="android:actionBarTabStyle">&#64;style/MyActionBarTabs&lt;/item>
-    &lt;style>
+    &lt;/style>
 
     &lt;!-- ActionBar tabs styles -->
     &lt;style name="MyActionBarTabs"
            parent="&#64;style/Widget.Holo.ActionBar.TabView">
         &lt;!-- tab indicator -->
         &lt;item name="android:background">&#64;drawable/actionbar_tab_indicator&lt;/item>
-    &lt;style>
+    &lt;/style>
 &lt;/resources>
 </pre>
 
@@ -420,7 +420,7 @@
 
         &lt;!-- Support library compatibility -->
         &lt;item name="actionBarTabStyle">&#64;style/MyActionBarTabs&lt;/item>
-    &lt;style>
+    &lt;/style>
 
     &lt;!-- ActionBar tabs styles -->
     &lt;style name="MyActionBarTabs"
@@ -430,7 +430,7 @@
 
         &lt;!-- Support library compatibility -->
         &lt;item name="background">&#64;drawable/actionbar_tab_indicator&lt;/item>
-    &lt;style>
+    &lt;/style>
 &lt;/resources>
 </pre>
 
@@ -442,7 +442,7 @@
   href="{@docRoot}guide/topics/ui/themes.html">Styles and Themes</a> guide.</li>
   <li>For even more complete styling for the action bar,
 try the <a class="external-link" target="_blank"
-  href="www://http.actionbarstylegenerator.com">Android Action Bar Style
+  href="http://www.actionbarstylegenerator.com">Android Action Bar Style
   Generator</a>.</li>
 </ul>
 </div>
\ No newline at end of file
diff --git a/docs/html/training/basics/activity-lifecycle/starting.jd b/docs/html/training/basics/activity-lifecycle/starting.jd
index dce6e30..9046599 100644
--- a/docs/html/training/basics/activity-lifecycle/starting.jd
+++ b/docs/html/training/basics/activity-lifecycle/starting.jd
@@ -220,7 +220,7 @@
 </pre>
 
 <p class="caution"><strong>Caution:</strong> Using the {@link android.os.Build.VERSION#SDK_INT} to
-prevent older system's from executing new APIs works in this way on Android 2.0 (API level
+prevent older systems from executing new APIs works in this way on Android 2.0 (API level
 5) and higher only. Older versions will encounter a runtime exception.</p>
 
 <p>Once the {@link android.app.Activity#onCreate onCreate()} finishes execution, the system
diff --git a/docs/html/training/basics/firstapp/starting-activity.jd b/docs/html/training/basics/firstapp/starting-activity.jd
index 6f7fa5d..712eabc 100644
--- a/docs/html/training/basics/firstapp/starting-activity.jd
+++ b/docs/html/training/basics/firstapp/starting-activity.jd
@@ -426,10 +426,7 @@
 
 <p>That's it, you've built your first Android app!</p>
 
-<p>To learn more about building Android apps, continue to follow the
-basic training classes. The next class is <a
-href="{@docRoot}training/basics/activity-lifecycle/index.html">Managing the Activity
-Lifecycle</a>.</p>
+<p>To learn more, follow the link below to the next class.</p>
 
 
 
diff --git a/docs/html/training/basics/supporting-devices/screens.jd b/docs/html/training/basics/supporting-devices/screens.jd
index 1114f21..e52ee70 100644
--- a/docs/html/training/basics/supporting-devices/screens.jd
+++ b/docs/html/training/basics/supporting-devices/screens.jd
@@ -23,8 +23,8 @@
     <ul>
       <li><a href="{@docRoot}training/multiscreen/index.html">Designing for Multiple
 Screens</a></li>
-      <li><a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
-Screens</a></li>
+      <li><a href="{@docRoot}guide/topics/resources/providing-resources.html">Providing
+        Resources</a></li>
       <li><a href="{@docRoot}design/style/iconography.html">Iconography design guide</a></li>
     </ul>
   </div>
diff --git a/docs/html/training/connect-devices-wirelessly/index.jd b/docs/html/training/connect-devices-wirelessly/index.jd
index f27b9c3..db79abe 100644
--- a/docs/html/training/connect-devices-wirelessly/index.jd
+++ b/docs/html/training/connect-devices-wirelessly/index.jd
@@ -17,7 +17,7 @@
 
 <h2>You should also read</h2>
 <ul>
-  <li><a href="{@docRoot}guide/topics/connectivity/wifip2p.html">Wi-Fi Direct</a></li>
+  <li><a href="{@docRoot}guide/topics/connectivity/wifip2p.html">Wi-Fi P2P</a></li>
 </ul>
 
 
@@ -37,8 +37,8 @@
 <p>This class describes the key APIs for finding and
 connecting to other devices from your application.  Specifically, it
 describes the NSD API for discovering available services and the Wi-Fi
-Direct&trade; API for doing peer-to-peer wireless connections.  This class also
-shows you how to use NSD and Wi-Fi Direct in
+Peer-to-Peer (P2P) API for doing peer-to-peer wireless connections.  This class also
+shows you how to use NSD and Wi-Fi P2P in
 combination to detect the services offered by a device and connect to the
 device when neither device is connected to a network.
 </p>
@@ -49,13 +49,13 @@
   <dd>Learn how to broadcast services offered by your own application, discover
   services offered on the local network, and use NSD to determine the connection
   details for the service you wish to connect to.</dd>
-  <dt><strong><a href="wifi-direct.html">Connecting with Wi-Fi Direct</a></strong></dt>
+  <dt><strong><a href="wifi-direct.html">Creating P2P Connections with Wi-Fi</a></strong></dt>
   <dd>Learn how to fetch a list of nearby peer devices, create an access point
-  for legacy devices, and connect to other devices capable of Wi-Fi Direct
+  for legacy devices, and connect to other devices capable of Wi-Fi P2P
   connections.</dd>
-  <dt><strong><a href="nsd-wifi-direct.html">Using Wi-Fi Direct for Service
+  <dt><strong><a href="nsd-wifi-direct.html">Using Wi-Fi P2P for Service
       Discovery</a></strong></dt>
   <dd>Learn how to discover services published by nearby devices without being
-  on the same network, using Wi-Fi Direct.</dd>
+  on the same network, using Wi-Fi P2P.</dd>
 </dl>
 
diff --git a/docs/html/training/connect-devices-wirelessly/nsd-wifi-direct.jd b/docs/html/training/connect-devices-wirelessly/nsd-wifi-direct.jd
index 5e276de..8dc5fd9 100644
--- a/docs/html/training/connect-devices-wirelessly/nsd-wifi-direct.jd
+++ b/docs/html/training/connect-devices-wirelessly/nsd-wifi-direct.jd
@@ -1,4 +1,4 @@
-page.title=Using Wi-Fi Direct for Service Discovery
+page.title=Using Wi-Fi P2P for Service Discovery
 parent.title=Connecting Devices Wirelessly
 parent.link=index.html
 
@@ -26,23 +26,23 @@
 <p>The first lesson in this class, <a href="nsd.html">Using Network Service
   Discovery</a>, showed you
 how to discover services that are connected to a local network. However, using
-Wi-Fi Direct&trad; Service Discovery allows you to discover the services of nearby devices directly,
-without being connected to a network.  You can also advertise the services
+Wi-Fi Peer-to-Peer (P2P) Service Discovery allows you to discover the services of nearby devices
+directly, without being connected to a network.  You can also advertise the services
 running on your device.  These capabilities help you communicate between apps,
 even when no local network or hotspot is available.</p>
 <p>While this set of APIs is similar in purpose to the Network Service Discovery
 APIs outlined in a previous lesson, implementing them in code is very different.
 This lesson shows you how to discover services available from other devices,
-using Wi-Fi Direct&trade;. The lesson assumes that you're already familiar with the
-<a href="{@docRoot}guide/topics/connectivity/wifip2p.html">Wi-Fi Direct</a> API.</p>
+using Wi-Fi P2P. The lesson assumes that you're already familiar with the
+<a href="{@docRoot}guide/topics/connectivity/wifip2p.html">Wi-Fi P2P</a> API.</p>
 
 
 <h2 id="manifest">Set Up the Manifest</h2>
-<p>In order to use Wi-Fi Direct, add the {@link
+<p>In order to use Wi-Fi P2P, add the {@link
 android.Manifest.permission#CHANGE_WIFI_STATE}, {@link
 android.Manifest.permission#ACCESS_WIFI_STATE},
 and {@link android.Manifest.permission#INTERNET}
-permissions to your manifest.  Even though Wi-Fi Direct doesn't require an
+permissions to your manifest.  Even though Wi-Fi P2P doesn't require an
 Internet connection, it uses standard Java sockets, and using these in Android
 requires the requested permissions.</p>
 
@@ -244,7 +244,7 @@
 and what they mean</p>
 <dl>
   <dt> {@link android.net.wifi.p2p.WifiP2pManager#P2P_UNSUPPORTED}</dt>
-  <dd> Wi-Fi Direct isn't supported on the device running the app.</dd>
+  <dd> Wi-Fi P2P isn't supported on the device running the app.</dd>
   <dt> {@link android.net.wifi.p2p.WifiP2pManager#BUSY}</dt>
   <dd> The system is to busy to process the request.</dd>
   <dt> {@link android.net.wifi.p2p.WifiP2pManager#ERROR}</dt>
diff --git a/docs/html/training/connect-devices-wirelessly/wifi-direct.jd b/docs/html/training/connect-devices-wirelessly/wifi-direct.jd
index b8ed664..98435c6 100644
--- a/docs/html/training/connect-devices-wirelessly/wifi-direct.jd
+++ b/docs/html/training/connect-devices-wirelessly/wifi-direct.jd
@@ -1,12 +1,6 @@
-page.title=Connecting with Wi-Fi Direct
-parent.title=Connecting Devices Wirelessly
-parent.link=index.html
+page.title=Creating P2P Connections with Wi-Fi
 
 trainingnavtop=true
-previous.title=Using Network Service Discovery
-previous.link=nsd.html
-next.title=Service Discovery with Wi-Fi Direct
-next.link=nsd-wifi-direct.html
 
 @jd:body
 
@@ -21,25 +15,30 @@
       <li><a href="#fetch">Fetch the List of Peers</a></li>
       <li><a href="#connect">Connect to a Peer</a></li>
     </ol>
+    <h2>You should also read</h2>
+    <ul>
+      <li><a href="{@docRoot}guide/topics/connectivity/wifip2p.html">Wi-Fi Peer-to-Peer</a></li>
+    </ul>
   </div>
 </div>
 
-<p>The Wi-Fi Direct&trade; APIs allow applications to connect to nearby devices without
-needing to connect to a network or hotspot.  This allows your application to quickly
+<p>The Wi-Fi peer-to-peer (P2P) APIs allow applications to connect to nearby devices without
+needing to connect to a network or hotspot (Android's Wi-Fi P2P framework complies with the Wi-Fi
+Alliance's Wi-Fi Direct&trade; certification program).  Wi-Fi P2P allows your application to quickly
 find and interact with nearby devices, at a range beyond the capabilities of Bluetooth.
 </p>
 <p>
-This lesson shows you how to find and connect to nearby devices using Wi-Fi Direct.
+This lesson shows you how to find and connect to nearby devices using Wi-Fi P2P.
 </p>
 <h2 id="permissions">Set Up Application Permissions</h2>
-<p>In order to use Wi-Fi Direct, add the {@link
+<p>In order to use Wi-Fi P2P, add the {@link
 android.Manifest.permission#CHANGE_WIFI_STATE}, {@link
 android.Manifest.permission#ACCESS_WIFI_STATE},
 and {@link android.Manifest.permission#INTERNET}
-permissions to your manifest.   Wi-Fi Direct doesn't require an internet connection,
+permissions to your manifest.   Wi-Fi P2P doesn't require an internet connection,
 but it does use standard Java sockets, which require the {@link
 android.Manifest.permission#INTERNET} permission.
-So you need the following permissions to use Wi-Fi Direct.</p>
+So you need the following permissions to use Wi-Fi P2P.</p>
 
 <pre>
 &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
@@ -59,13 +58,13 @@
 </pre>
 
 <h2 id="receiver">Set Up a Broadcast Receiver and Peer-to-Peer Manager</h2>
-<p>To use Wi-Fi Direct, you need to listen for broadcast intents that tell your
+<p>To use Wi-Fi P2P, you need to listen for broadcast intents that tell your
 application when certain events have occurred.  In your application, instantiate
 an {@link
 android.content.IntentFilter} and set it to listen for the following:</p>
 <dl>
   <dt>{@link android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_STATE_CHANGED_ACTION}</dt>
-  <dd>Indicates whether Wi-Fi Peer-To-Peer (P2P) is enabled</dd>
+  <dd>Indicates whether Wi-Fi P2P is enabled</dd>
   <dt>{@link android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_PEERS_CHANGED_ACTION}</dt>
   <dd>Indicates that the available peer list has changed.</dd>
   <dt>{@link android.net.wifi.p2p.WifiP2pManager#WIFI_P2P_CONNECTION_CHANGED_ACTION}</dt>
@@ -80,7 +79,7 @@
     super.onCreate(savedInstanceState);
     setContentView(R.layout.main);
 
-    //  Indicates a change in the Wi-Fi Peer-to-Peer status.
+    //  Indicates a change in the Wi-Fi P2P status.
     intentFilter.addAction(WifiP2pManager.WIFI_P2P_STATE_CHANGED_ACTION);
 
     // Indicates a change in the list of available peers.
@@ -101,7 +100,7 @@
 android.net.wifi.p2p.WifiP2pManager#initialize(Context, Looper, WifiP2pManager.ChannelListener) initialize()}
 method.  This method returns a {@link
 android.net.wifi.p2p.WifiP2pManager.Channel} object, which you'll use later to
-connect your app to the Wi-Fi Direct Framework.</p>
+connect your app to the Wi-Fi P2P framework.</p>
 
 <pre>
 &#64;Override
@@ -126,7 +125,7 @@
     public void onReceive(Context context, Intent intent) {
         String action = intent.getAction();
         if (WifiP2pManager.WIFI_P2P_STATE_CHANGED_ACTION.equals(action)) {
-            // Determine if Wifi Direct mode is enabled or not, alert
+            // Determine if Wifi P2P mode is enabled or not, alert
             // the Activity.
             int state = intent.getIntExtra(WifiP2pManager.EXTRA_WIFI_STATE, -1);
             if (state == WifiP2pManager.WIFI_P2P_STATE_ENABLED) {
@@ -177,7 +176,7 @@
 
 
 <h2 id="discover">Initiate Peer Discovery</h2>
-<p>To start searching for nearby devices with Wi-Fi Direct, call {@link
+<p>To start searching for nearby devices with Wi-Fi P2P, call {@link
 android.net.wifi.p2p.WifiP2pManager#discoverPeers(WifiP2pManager.Channel,
 WifiP2pManager.ActionListener) discoverPeers()}.  This method takes the
 following arguments:</p>
@@ -218,7 +217,7 @@
 <h2 id="fetch">Fetch the List of Peers</h2>
 <p>Now write the code that fetches and processes the list of peers.  First
 implement the {@link android.net.wifi.p2p.WifiP2pManager.PeerListListener}
-interface, which provides information about the peers that Wi-Fi Direct has
+interface, which provides information about the peers that Wi-Fi P2P has
 detected.  The following code snippet illustrates this.</p>
 
 <pre>
diff --git a/docs/html/training/id-auth/authenticate.jd b/docs/html/training/id-auth/authenticate.jd
index 3084bea..65dbc39 100644
--- a/docs/html/training/id-auth/authenticate.jd
+++ b/docs/html/training/id-auth/authenticate.jd
@@ -79,7 +79,7 @@
 
 <p>To get an auth token you first need to request the
 {@link android.Manifest.permission#ACCOUNT_MANAGER}
-to yourmanifest file. To actually do anything useful with the
+to your manifest file. To actually do anything useful with the
 token, you'll also need to add the {@link android.Manifest.permission#INTERNET}
 permission.</p>
 
diff --git a/docs/html/training/testing.jd b/docs/html/training/testing.jd
new file mode 100644
index 0000000..c55370d
--- /dev/null
+++ b/docs/html/training/testing.jd
@@ -0,0 +1,7 @@
+page.title=Best Practices for Testing
+page.trainingcourse=true
+
+@jd:body
+
+<p>These classes and articles provide information about how to
+test your Android application.</p>
diff --git a/docs/html/training/training_toc.cs b/docs/html/training/training_toc.cs
index 4c2ed7c..0c4f9df 100644
--- a/docs/html/training/training_toc.cs
+++ b/docs/html/training/training_toc.cs
@@ -68,6 +68,30 @@
 
       <li class="nav-section">
         <div class="nav-section-header">
+          <a href="<?cs var:toroot ?>training/basics/supporting-devices/index.html"
+             description=
+             "How to build your app with alternative resources that provide an
+             optimized user experience on multiple device form factors using a single APK."
+            >Supporting Different Devices</a>
+        </div>
+        <ul>
+          <li><a href="<?cs var:toroot ?>training/basics/supporting-devices/languages.html">
+            Supporting Different Languages
+          </a>
+          </li>
+          <li><a href="<?cs var:toroot ?>training/basics/supporting-devices/screens.html">
+            Supporting Different Screens
+          </a>
+          </li>
+          <li><a href="<?cs var:toroot ?>training/basics/supporting-devices/platforms.html">
+            Supporting Different Platform Versions
+          </a>
+          </li>
+        </ul>
+      </li>
+
+      <li class="nav-section">
+        <div class="nav-section-header">
           <a href="<?cs var:toroot ?>training/basics/activity-lifecycle/index.html"
              description=
              "How Android activities live and die and how to create
@@ -96,30 +120,6 @@
 
       <li class="nav-section">
         <div class="nav-section-header">
-          <a href="<?cs var:toroot ?>training/basics/supporting-devices/index.html"
-             description=
-             "How to build your app with alternative resources that provide an
-             optimized user experience on multiple device form factors using a single APK."
-            >Supporting Different Devices</a>
-        </div>
-        <ul>
-          <li><a href="<?cs var:toroot ?>training/basics/supporting-devices/languages.html">
-            Supporting Different Languages
-          </a>
-          </li>
-          <li><a href="<?cs var:toroot ?>training/basics/supporting-devices/screens.html">
-            Supporting Different Screens
-          </a>
-          </li>
-          <li><a href="<?cs var:toroot ?>training/basics/supporting-devices/platforms.html">
-            Supporting Different Platform Versions
-          </a>
-          </li>
-        </ul>
-      </li>
-
-      <li class="nav-section">
-        <div class="nav-section-header">
           <a href="<?cs var:toroot ?>training/basics/fragments/index.html"
              description=
              "How to build a user interface for your app that is flexible enough
@@ -405,7 +405,7 @@
           <a href="<?cs var:toroot ?>training/connect-devices-wirelessly/index.html"
              description=
              "How to find and connect to local devices using Network Service
-             Discovery and Wi-Fi Direct in order to create peer-to-peer connections."
+             Discovery and how to create peer-to-peer connections with Wi-Fi."
              >Connecting Devices Wirelessly</a>
         </div>
         <ul>
@@ -414,7 +414,7 @@
           </a>
           </li>
           <li><a href="<?cs var:toroot ?>training/connect-devices-wirelessly/wifi-direct.html">
-            Connecting with Wi-Fi Direct
+            Creating P2P Connections with Wi-Fi
           </a>
           </li>
           <li><a href="<?cs var:toroot ?>training/connect-devices-wirelessly/nsd-wifi-direct.html">
@@ -1209,6 +1209,45 @@
   </li>
   <!-- End security and user info -->
 
+  <li class="nav-section">
+    <div class="nav-section-header">
+      <a href="<?cs var:toroot ?>training/testing.html">
+      <span class="small">Best Practices for</span><br/>
+              Testing
+      </a>
+    </div>
+    <ul>
+      <li class="nav-section">
+      <div class="nav-section-header"><a href="<?cs var:toroot ?>training/activity-testing/index.html"
+         description="How to test Activities in your Android applications.">
+            Testing Your Activity
+          </a></div>
+        <ul>
+          <li><a href="<?cs var:toroot ?>training/activity-testing/preparing-activity-testing.html">
+            <span class="en">Setting Up Your Test Environment</span>
+          </a>
+          </li>
+          <li><a href="<?cs var:toroot ?>training/activity-testing/activity-basic-testing.html">
+            <span class="en">Creating and Running a Test Case</span>
+          </a>
+          </li>
+          <li><a href="<?cs var:toroot ?>training/activity-testing/activity-ui-testing.html">
+            <span class="en">Testing UI Components</span>
+          </a>
+          </li>
+          <li><a href="<?cs var:toroot ?>training/activity-testing/activity-unit-testing.html">
+            <span class="en">Creating Unit Tests</span>
+          </a>
+          </li>
+          <li><a href="<?cs var:toroot ?>training/activity-testing/activity-functional-testing.html">
+            <span class="en">Creating Functional Tests</span>
+          </a>
+          </li>
+        </ul>
+      </li>
+    </ul>
+  </li>
+  <!-- End best Testing -->
 
   <li class="nav-section">
     <div class="nav-section-header">