Merge "docs: studio device emulator updates" into lmp-docs
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index fb10e17..6d524eb 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -4000,7 +4000,7 @@
      *
      * Unlike the other styles provided here, MediaStyle can also modify the standard-size
      * {@link Notification#contentView}; by providing action indices to
-     * {@link #setShowActionsInCompactView(int...)} you can promote up to 2 actions to be displayed
+     * {@link #setShowActionsInCompactView(int...)} you can promote up to 3 actions to be displayed
      * in the standard view alongside the usual content.
      *
      * Notifications created with MediaStyle will have their category set to
diff --git a/docs/html/design/patterns/notifications.jd b/docs/html/design/patterns/notifications.jd
index f5cd2a7..fdd435c 100644
--- a/docs/html/design/patterns/notifications.jd
+++ b/docs/html/design/patterns/notifications.jd
@@ -15,6 +15,14 @@
   </div>
 </a>
 
+<!-- video box -->
+<a class="notice-developers-video" href="https://www.youtube.com/watch?v=Uiq2kZ2JHVY">
+<div>
+    <h3>Video</h3>
+    <p>DevBytes: Notifications in the Android L Developer Preview</p>
+</div>
+</a>
+
 <style>
   .col-5, .col-6, .col-7 {
     margin-left:0px;
diff --git a/docs/html/google/play-services/setup.jd b/docs/html/google/play-services/setup.jd
index 413000f..cb3fa17 100644
--- a/docs/html/google/play-services/setup.jd
+++ b/docs/html/google/play-services/setup.jd
@@ -62,7 +62,7 @@
   <li>Add a new build rule under <code>dependencies</code> for the latest version of
 <code>play-services</code>. For example:
 <pre class="no-pretty-print">
-apply plugin: 'android'
+apply plugin: 'com.android.application'
 ...
 
 dependencies {
diff --git a/docs/html/sdk/exploring.jd b/docs/html/sdk/exploring.jd
deleted file mode 100644
index b34c1cf..0000000
--- a/docs/html/sdk/exploring.jd
+++ /dev/null
@@ -1,10 +0,0 @@
-page.title=Exploring the SDK
-excludeFromSuggestions=true
-walkthru=1
-
-@jd:body
-
-
-
-
-
diff --git a/docs/html/sdk/index.jd b/docs/html/sdk/index.jd
index e56f3f5..5d73d72 100644
--- a/docs/html/sdk/index.jd
+++ b/docs/html/sdk/index.jd
@@ -1,48 +1,49 @@
 page.title=Download Android Studio and SDK Tools
-page.tags=download
+page.tags=sdk, android studio
 page.template=sdk
 header.hide=1
 page.metaDescription=Download the official Android IDE and developer tools to build apps for Android phones, tablets, wearables, TVs, and more.
 
-studio.version=1.0.0
+studio.version=1.0.1
 
-studio.linux_bundle_download=android-studio-ide-135.1629389-linux.zip
-studio.linux_bundle_bytes=243909934
-studio.linux_bundle_checksum=601a302f10cf8a22ba4216e0884a035bdfec38b3
+studio.linux_bundle_download=android-studio-ide-135.1641136-linux.zip
+studio.linux_bundle_bytes=243917559
+studio.linux_bundle_checksum=7c8f2d0cec21b98984cdba45ab5a25f26d67f23a
 
-studio.mac_bundle_download=android-studio-ide-135.1629389.dmg
-studio.mac_bundle_bytes=245757810
-studio.mac_bundle_checksum=0d9e0e230ece9f2e696b1b076c36ee1e73edcf3c
+studio.mac_bundle_download=android-studio-ide-1641136.dmg
+studio.mac_bundle_bytes=245729073
+studio.mac_bundle_checksum=49506ba2cf6b56be4f7d07e6a00c4ec3ba2249d5
 
-studio.win_bundle_exe_download=android-studio-bundle-135.1629389.exe
-studio.win_bundle_exe_bytes=868337656
+studio.win_bundle_exe_download=android-studio-bundle-135.1641136.exe
+studio.win_bundle_exe_bytes=868344232
 studio.win_bundle_exe_checksum=1931dbaeadb52f5e0a8ba6e2ae60d9df20b2076b
 
-studio.win_notools_exe_download=android-studio-ide-135.1629389.exe
-studio.win_notools_exe_bytes=262099808
-studio.win_notools_exe_checksum=bfc6e9397f72969bcb3db80c9abe3a205540c8ab
+studio.win_notools_exe_download=android-studio-ide-135.1641136.exe
+studio.win_notools_exe_bytes=260272840
+studio.win_notools_exe_checksum=464d1c5497ab3d1bdef441365791ab36c89cd5ae
 
-studio.win_bundle_download=android-studio-ide-135.1629389-windows.zip
-studio.win_bundle_bytes=246241434
-studio.win_bundle_checksum=6951e678a41b94b6172276727537db8590be7270
+studio.win_bundle_download=android-studio-ide-135.1641136-windows.zip
+studio.win_bundle_bytes=246249059
+studio.win_bundle_checksum=6d6856aca83f6ff747ca40b10f70edfbbcccd91c
 
 
 
-sdk.linux_download=android-sdk_r24-linux.tgz
-sdk.linux_bytes=141308131
-sdk.linux_checksum=3cc1fcec302a8478e240e42b94dd2de73b9d0cc9
+sdk.linux_download=android-sdk_r24.0.2-linux.tgz
+sdk.linux_bytes=140097024
+sdk.linux_checksum=b6fd75e8b06b0028c2427e6da7d8a09d8f956a86
 
-sdk.mac_download=android-sdk_r24-macosx.zip
-sdk.mac_bytes=88535806
-sdk.mac_checksum=89b256c82e6ab432881fa7d726bdd0541c656616
+sdk.mac_download=android-sdk_r24.0.2-macosx.zip
+sdk.mac_bytes=87262823
+sdk.mac_checksum=3ab5e0ab0db5e7c45de9da7ff525dee6cfa97455
 
-sdk.win_download=android-sdk_r24-windows.zip
-sdk.win_bytes=140738187
-sdk.win_checksum=8d20f800cbace1b92873ebba1e16ff134a2b062b
+sdk.win_download=android-sdk_r24.0.2-windows.zip
+sdk.win_bytes=139473113
+sdk.win_checksum=51269c8336f936fc9b9538f9b9ca236b78fb4e4b
 
-sdk.win_installer=installer_r24-windows.exe
-sdk.win_installer_bytes=92179689
-sdk.win_installer_checksum=71ec3d91a4239b44128bf43add888bc357776be9
+sdk.win_installer=installer_r24.0.2-windows.exe
+sdk.win_installer_bytes=91428280
+sdk.win_installer_checksum=edac14e1541e97d68821fa3a709b4ea8c659e676
+
 
 
 
@@ -89,7 +90,7 @@
     display:block;
     padding:0;
     white-space: nowrap;
-    text-indent: 10000px;
+    text-indent: -10000px;
     font-size:0px;
     background: url(../images/tools/studio-logo.png);
     background-image: -webkit-image-set(url(../images/tools/studio-logo.png) 1x, url(../images/tools/studio-logo_2x.png) 2x);
diff --git a/docs/html/sdk/installing/index.jd b/docs/html/sdk/installing/index.jd
index 14d274f0..9a02382 100644
--- a/docs/html/sdk/installing/index.jd
+++ b/docs/html/sdk/installing/index.jd
@@ -1,4 +1,5 @@
 page.title=Installing the Android SDK
+excludeFromSuggestions=true
 
 page.tags=sdk tools
 helpoutsWidget=true
diff --git a/docs/html/tools/building/configuring-gradle.jd b/docs/html/tools/building/configuring-gradle.jd
index 2e15473..5af2096 100644
--- a/docs/html/tools/building/configuring-gradle.jd
+++ b/docs/html/tools/building/configuring-gradle.jd
@@ -44,7 +44,7 @@
 <code>BuildSystemExample</code> project looks like this:</p>
 
 <pre>
-apply plugin: 'android'
+apply plugin: 'com.android.application'
 
 android {
     compileSdkVersion 19
@@ -72,7 +72,7 @@
 }
 </pre>
 
-<p><code>apply plugin: 'android'</code> applies the Android plugin for Gradle to this build.
+<p><code>apply plugin: 'com.android.application'</code> applies the Android plugin for Gradle to this build.
 This adds Android-specific build tasks to the top-level build tasks and makes the
 <code>android {...}</code> element available to specify Android-specific build options.</p>
 
diff --git a/docs/html/tools/help/adt.jd b/docs/html/tools/help/adt.jd
index 0130524..8abe1b4 100644
--- a/docs/html/tools/help/adt.jd
+++ b/docs/html/tools/help/adt.jd
@@ -509,10 +509,10 @@
 revision of the Android SDK Tools. If such dependencies exist, you will need to
 update the SDK Tools package of the SDK after installing the new revision of
 ADT. To update the SDK Tools package, use the Android SDK Manager, as
-described in <a href="{@docRoot}sdk/exploring.html">Exploring the SDK</a>.</p>
+described in <a href="{@docRoot}sdk/installing/adding-packages.html">Adding SDK Packages</a>.</p>
 
 <p>To learn about new features of each ADT revision and also any dependencies on
-the SDK Tools, see the listings in the <a href="#notes">Revisions</a>
+the SDK Tools, see the listings in the <a href="{@docRoot}tools/revisions/index.html">Revisions</a>
 section. To determine the version currently installed, open the
 Eclipse Installed Software window using <strong>Help</strong>
 &gt; <strong>Software Updates</strong> and refer to the version listed for
diff --git a/docs/html/tools/help/monkey.jd b/docs/html/tools/help/monkey.jd
index b6300a7..941f5d9 100644
--- a/docs/html/tools/help/monkey.jd
+++ b/docs/html/tools/help/monkey.jd
@@ -12,7 +12,7 @@
 <a name="overview"></a>
 <h2>Overview</h2>
 
-<p>The Monkey is a command-line tool that that you can run on any emulator
+<p>The Monkey is a command-line tool that you can run on any emulator
 instance or on a device.  It sends a pseudo-random stream of 
 user events into the system, which acts as a stress test on the application software you are 
 developing.</p>
diff --git a/docs/html/tools/revisions/studio.jd b/docs/html/tools/revisions/studio.jd
index 422beaa..3806933 100644
--- a/docs/html/tools/revisions/studio.jd
+++ b/docs/html/tools/revisions/studio.jd
@@ -39,9 +39,32 @@
 <p>The sections below provide notes about successive releases of
 Android Studio, as denoted by revision number. </p>
 
+
 <div class="toggle-content opened">
   <p><a href="#" onclick="return toggleContent(this)">
     <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img"
+      alt=""/>Android Studio v1.0.1</a> <em>(December 2014)</em>
+  </p>
+
+  <div class="toggle-content-toggleme">
+    <p>Various fixes and enhancements:</p>
+    <ul>
+      <li>Fixed AVD Manager and <strong>device.xml</strong> file lock issue. </li>
+      <li>Fixed the emulator log on Windows systems. </li>
+      <li>Fixed issue with creating AVDs with Android Studio and Android SDK installed on different
+      drives on Windows systems.</li>
+      <li>Sets the default update channel for new downloads to <strong>Stable</strong>. If you
+      installed the 1.0.0 version of Android Studio and would like stable, production-ready version
+      updates, use <strong>File > Settings > Updates</strong> to change to the <strong>Stable</strong>
+      update channel.
+      </li>
+  </div>
+</div>
+
+
+<div class="toggle-content closed">
+  <p><a href="#" onclick="return toggleContent(this)">
+    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
       alt=""/>Android Studio v1.0</a> <em>(December 2014)</em>
   </p>
 
diff --git a/docs/html/tools/sdk/tools-notes.jd b/docs/html/tools/sdk/tools-notes.jd
index ed48887..e50b7ac 100644
--- a/docs/html/tools/sdk/tools-notes.jd
+++ b/docs/html/tools/sdk/tools-notes.jd
@@ -25,6 +25,33 @@
 <div class="toggle-content opened">
   <p><a href="#" onclick="return toggleContent(this)">
     <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img"
+      alt=""/>SDK Tools, Revision 24.0.2</a> <em>(December 2014)</em>
+  </p>
+
+  <div class="toggle-content-toggleme">
+
+    <dl>
+    <dt>Dependencies:</dt>
+
+    <dd>
+      <ul>
+        <li>Android SDK Platform-tools revision 19 or later.</li>
+      </ul>
+    </dd>
+
+    <dt>General Notes:</dt>
+    <dd>
+      <ul>
+        <li>Fixed issue with creating projects and activities from templates using Eclipse ADT.</li>
+      </ul>
+    </dd>
+  </div>
+</div>
+
+
+<div class="toggle-content closed">
+  <p><a href="#" onclick="return toggleContent(this)">
+    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
       alt=""/>SDK Tools, Revision 24.0.1</a> <em>(December 2014)</em>
   </p>
 
@@ -898,7 +925,7 @@
             <li>Added a flag that sets <em>jumbo mode</em> for DEX files, which allows a larger
               number of strings in the DEX files. Enable this mode by adding the following line to
               the {@code project.properties} file of your project:
-              <pre>set dex.force.jumbo=true</pre></li>
+              <pre>dex.force.jumbo=true</pre></li>
             <li>Improved the build time by pre-dexing libraries (both JAR files and library
               projects).</li>
             <li>Updated the build to generate {@code R} resource classes for library projects
diff --git a/docs/html/tools/support-library/setup.jd b/docs/html/tools/support-library/setup.jd
index 845cf76..8112071 100644
--- a/docs/html/tools/support-library/setup.jd
+++ b/docs/html/tools/support-library/setup.jd
@@ -300,7 +300,7 @@
   overrides the manifest settings.  </p>
 
 <pre>
-apply plugin: 'android'
+apply plugin: 'com.android.application'
 
 android {
     ...
diff --git a/docs/html/training/location/index.jd b/docs/html/training/location/index.jd
index f0024e2..059a1e9 100644
--- a/docs/html/training/location/index.jd
+++ b/docs/html/training/location/index.jd
@@ -67,9 +67,10 @@
 <h2>Lessons</h2>
 <dl>
   <dt>
-    <b><a href="retrieve-current.html">Retrieving the Current Location</a></b>
+    <b><a href="retrieve-current.html">Getting the Last Known Location</a></b>
   </dt> <dd>
-     Learn how to retrieve the user's current location.
+     Learn how to retrieve the last known location of an Android device, which
+     is usually equivalent to the user's current location.
   </dd> <dt>
     <b><a href="receive-location-updates.html">Receiving Location
     Updates</a></b>
diff --git a/docs/html/training/location/receive-location-updates.jd b/docs/html/training/location/receive-location-updates.jd
index e6e8c51..208dc17 100644
--- a/docs/html/training/location/receive-location-updates.jd
+++ b/docs/html/training/location/receive-location-updates.jd
@@ -1,612 +1,417 @@
 page.title=Receiving Location Updates
 trainingnavtop=true
 @jd:body
+
 <div id="tb-wrapper">
-<div id="tb">
+  <div id="tb">
 
-<h2>This lesson teaches you to</h2>
-<ol>
-    <li><a href="#Permissions">Request Location Permission</a></li>
-    <li><a href="#PlayServices">Check for Google Play Services</a></li>
-    <li><a href="#DefineCallbacks">Define Location Services Callbacks</a></li>
-    <li><a href="#UpdateParameters">Specify Update Parameters</a></li>
-    <li><a href="#StartUpdates">Start Location Updates</a></li>
-    <li><a href="#StopUpdates">Stop Location Updates</a></li>
-</ol>
+  <h2>This lesson teaches you how to</h2>
+  <ol>
+    <li><a href="#connect">Connect to Location Services</a></li>
+    <li><a href="#location-request">Set Up a Location Request</a></li>
+    <li><a href="#updates">Request Location Updates</a></li>
+    <li><a href="#callback">Define the Location Update Callback</a></li>
+    <li><a href="#stop-updates">Stop Location Updates</a></li>
+    <li><a href="#save-state">Save the State of the Activity</a></li>
+  </ol>
 
-<h2>You should also read</h2>
-<ul>
+  <h2>You should also read</h2>
+  <ul>
     <li>
-        <a href="{@docRoot}google/play-services/setup.html">Setup Google Play Services SDK</a>
+      <a href="{@docRoot}google/play-services/setup.html">Setting up Google Play
+      Services</a>
     </li>
     <li>
-        <a href="retrieve-current.html">Retrieving the Current Location</a>
+      <a href="retrieve-current.html">Getting the Last Known Location</a>
     </li>
- </ul>
+   </ul>
 
-<h2>Try it out</h2>
+  <h2>Try it out</h2>
 
-<div class="download-box">
-  <a href="http://developer.android.com/shareables/training/LocationUpdates.zip" class="button">Download the sample</a>
-  <p class="filename">LocationUpdates.zip</p>
+    <ul>
+      <li>
+        <a href="https://github.com/googlesamples/android-play-location/tree/master/LocationUpdates" class="external-link">LocationUpdates</a>
+      </li>
+    </ul>
+  </div>
 </div>
 
-</div>
-</div>
+<p>If your app can continuously track location, it can deliver more relevant
+  information to the user. For example, if your app helps the user find their
+  way while walking or driving, or if your app tracks the location of assets, it
+  needs to get the location of the device at regular intervals. As well as the
+  geographical location (latitude and longitude), you may want to give the user
+  further information such as the bearing (horizontal direction of travel),
+  altitude, or velocity of the device. This information, and more, is available
+  in the {@link android.location.Location} object that your app can retrieve
+  from the
+  <a href="{@docRoot}reference/com/google/android/gms/location/FusedLocationProviderApi.html">fused
+  location provider</a>.</p>
 
-<p>
-    If your app does navigation or tracking, you probably want to get the user's
-    location at regular intervals. While you can do this with
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationClient.html#getLastLocation()">LocationClient.getLastLocation()</a></code>,
-    a more direct approach is to request periodic updates from Location Services. In
-    response, Location Services automatically updates your app with the best available location,
-    based on the currently-available location providers such as WiFi and GPS.
-</p>
-<p>
-    To get periodic location updates from Location Services, you send a request using a location
-    client. Depending on the form of the request, Location Services either invokes a callback
-    method and passes in a {@link android.location.Location} object, or issues an
-    {@link android.content.Intent} that contains the location in its extended data. The accuracy and
-    frequency of the updates are affected by the location permissions you've requested and the
-    parameters you pass to Location Services with the request.
-</p>
-<!-- Request permission -->
-<h2 id="Permissions">Specify App Permissions</h2>
-<p>
-    Apps that use Location Services must request location permissions. Android has two location
-    permissions, {@link android.Manifest.permission#ACCESS_COARSE_LOCATION ACCESS_COARSE_LOCATION}
-    and {@link android.Manifest.permission#ACCESS_FINE_LOCATION ACCESS_FINE_LOCATION}. The
-    permission you choose affects the accuracy of the location updates you receive.
-    For example, If you request only coarse location permission, Location Services obfuscates the
-    updated location to an accuracy that's roughly equivalent to a city block.
-</p>
-<p>
-    Requesting {@link android.Manifest.permission#ACCESS_FINE_LOCATION ACCESS_FINE_LOCATION} implies
-    a request for {@link android.Manifest.permission#ACCESS_COARSE_LOCATION ACCESS_COARSE_LOCATION}.
-</p>
-<p>
-    For example, to add the coarse location permission to your manifest, insert the following as a
-    child element of
-    the
-<code><a href="{@docRoot}guide/topics/manifest/manifest-element.html">&lt;manifest&gt;</a></code>
-    element:
-</p>
+<p>While you can get a device's location with
+  <a href="{@docRoot}reference/com/google/android/gms/location/FusedLocationProviderApi.html#getLastLocation(com.google.android.gms.common.api.GoogleApiClient)">{@code getLastLocation()}</a>,
+  as illustrated in the lesson on
+  <a href="retrieve-current.html">Getting the Last Known Location</a>,
+  a more direct approach is to request periodic updates from the fused location
+  provider. In response, the API updates your app periodically with the best
+  available location, based on the currently-available location providers such
+  as WiFi and GPS (Global Positioning System). The accuracy of the location is
+  determined by the providers, the location permissions you've requested, and
+  the options you set in the location request.</p>
+
+<p>This lesson shows you how to request regular updates about a device's
+  location using the
+  <a href="{@docRoot}reference/com/google/android/gms/location/FusedLocationProviderApi.html#requestLocationUpdates(com.google.android.gms.common.api.GoogleApiClient, com.google.android.gms.location.LocationRequest, com.google.android.gms.location.LocationListener)">{@code requestLocationUpdates()}</a>
+  method in the fused location provider.
+
+<h2 id="connect">Connect to Location Services</h2>
+
+<p>Location services for apps are provided through Google Play services and the
+  fused location provider. In order to use these services, you connect your app
+  using the Google API Client and then request location updates. For details on
+  connecting with the
+  <a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html">{@code GoogleApiClient}</a>,
+  follow the instructions in
+  <a href="retrieve-current.html">Getting the Last Known Location</a>, including
+  requesting the current location.</p>
+
+<p>The last known location of the device provides a handy base from which to
+  start, ensuring that the app has a known location before starting the
+  periodic location updates. The lesson on
+  <a href="retrieve-current.html">Getting the Last Known Location</a> shows you
+  how to get the last known location by calling
+  <a href="{@docRoot}reference/com/google/android/gms/location/FusedLocationProviderApi.html#getLastLocation(com.google.android.gms.common.api.GoogleApiClient)">{@code getLastLocation()}</a>.
+  The snippets in the following sections assume that your app has already
+  retrieved the last known location and stored it as a
+  {@link android.location.Location} object in the global variable
+  {@code mCurrentLocation}.</p>
+
+<p>Apps that use location services must request location permissions. In this
+  lesson you require fine location detection, so that your app can get as
+  precise a location as possible from the available location providers. Request
+  this permission with the
+  {@code uses-permission} element in your app manifest, as shown in the
+  following example:</p>
+
 <pre>
-&lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/&gt;
-</pre>
-<!-- Check for Google Play services -->
-<h2 id="PlayServices">Check for Google Play Services</h2>
-<p>
-    Location Services is part of the Google Play services APK. Since it's hard to anticipate the
-    state of the user's device, you should always check that the APK is installed before you attempt
-    to connect to Location Services. To check that the APK is installed, call
-<code><a href="{@docRoot}reference/com/google/android/gms/common/GooglePlayServicesUtil.html#isGooglePlayServicesAvailable(android.content.Context)">GooglePlayServicesUtil.isGooglePlayServicesAvailable()</a></code>,
-    which returns one of the
-    integer result codes listed in the API reference documentation. If you encounter an error,
-    call
-<code><a href="{@docRoot}reference/com/google/android/gms/common/GooglePlayServicesUtil.html#getErrorDialog(int, android.app.Activity, int)">GooglePlayServicesUtil.getErrorDialog()</a></code>
-    to retrieve localized dialog that prompts users to take the correct action, then display
-    the dialog in a {@link android.support.v4.app.DialogFragment}. The dialog may allow the
-    user to correct the problem, in which case Google Play services may send a result back to your
-    activity. To handle this result, override the method
-    {@link android.support.v4.app.FragmentActivity#onActivityResult onActivityResult()}
+&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.google.android.gms.location.sample.locationupdates" &gt;
 
-</p>
-<p class="note">
-    <strong>Note:</strong> To make your app compatible with
-    platform version 1.6 and later, the activity that displays the
-    {@link android.support.v4.app.DialogFragment} must subclass
-    {@link android.support.v4.app.FragmentActivity} instead of {@link android.app.Activity}. Using
-    {@link android.support.v4.app.FragmentActivity} also allows you to call
-    {@link android.support.v4.app.FragmentActivity#getSupportFragmentManager
-    getSupportFragmentManager()} to display the {@link android.support.v4.app.DialogFragment}.
-</p>
-<p>
-    Since you usually need to check for Google Play services in more than one place in your code,
-    define a method that encapsulates the check, then call the method before each connection
-    attempt. The following snippet contains all of the code required to check for Google
-    Play services:
-</p>
-<pre>
-public class MainActivity extends FragmentActivity {
-    ...
-    // Global constants
-    /*
-     * Define a request code to send to Google Play services
-     * This code is returned in Activity.onActivityResult
-     */
-    private final static int
-            CONNECTION_FAILURE_RESOLUTION_REQUEST = 9000;
-    ...
-    // Define a DialogFragment that displays the error dialog
-    public static class ErrorDialogFragment extends DialogFragment {
-        // Global field to contain the error dialog
-        private Dialog mDialog;
-        // Default constructor. Sets the dialog field to null
-        public ErrorDialogFragment() {
-            super();
-            mDialog = null;
-        }
-        // Set the dialog to display
-        public void setDialog(Dialog dialog) {
-            mDialog = dialog;
-        }
-        // Return a Dialog to the DialogFragment.
-        &#64;Override
-        public Dialog onCreateDialog(Bundle savedInstanceState) {
-            return mDialog;
-        }
-    }
-    ...
-    /*
-     * Handle results returned to the FragmentActivity
-     * by Google Play services
-     */
-    &#64;Override
-    protected void onActivityResult(
-            int requestCode, int resultCode, Intent data) {
-        // Decide what to do based on the original request code
-        switch (requestCode) {
-            ...
-            case CONNECTION_FAILURE_RESOLUTION_REQUEST :
-            /*
-             * If the result code is Activity.RESULT_OK, try
-             * to connect again
-             */
-                switch (resultCode) {
-                    case Activity.RESULT_OK :
-                    /*
-                     * Try the request again
-                     */
-                    ...
-                    break;
-                }
-            ...
-        }
-        ...
-    }
-    ...
-    private boolean servicesConnected() {
-        // Check that Google Play services is available
-        int resultCode =
-                GooglePlayServicesUtil.
-                        isGooglePlayServicesAvailable(this);
-        // If Google Play services is available
-        if (ConnectionResult.SUCCESS == resultCode) {
-            // In debug mode, log the status
-            Log.d("Location Updates",
-                    "Google Play services is available.");
-            // Continue
-            return true;
-        // Google Play services was not available for some reason
-        } else {
-            // Get the error code
-            int errorCode = connectionResult.getErrorCode();
-            // Get the error dialog from Google Play services
-            Dialog errorDialog = GooglePlayServicesUtil.getErrorDialog(
-                    errorCode,
-                    this,
-                    CONNECTION_FAILURE_RESOLUTION_REQUEST);
-            // If Google Play services can provide an error dialog
-            if (errorDialog != null) {
-                // Create a new DialogFragment for the error dialog
-                ErrorDialogFragment errorFragment =
-                        new ErrorDialogFragment();
-                // Set the dialog in the DialogFragment
-                errorFragment.setDialog(errorDialog);
-                // Show the error dialog in the DialogFragment
-                errorFragment.show(
-                        getSupportFragmentManager(),
-                        "Location Updates");
-            }
-        }
-    }
-    ...
-}
+  &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/&gt;
+&lt;/manifest&gt;
 </pre>
-<p>
-    Snippets in the following sections call this method to verify that Google Play services is
-    available.
-</p>
-<!--
-    Define Location Services Callbacks
- -->
-<h2 id="DefineCallbacks">Define Location Services Callbacks</h2>
-<p>
-    Before you request location updates, you must first implement the interfaces that Location
-    Services uses to communicate connection status to your app:
-</p>
+
+<h2 id="location-request">Set Up a Location Request</h2>
+
+<p>To store parameters for requests to the fused location provider, create a
+  <a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html">{@code LocationRequest}</a>.
+  The parameters determine the levels of accuracy requested. For details of all
+  the options available in the location request, see the
+  <a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html">{@code LocationRequest}</a>
+  class reference. This lesson sets the update interval, fastest update
+  interval, and priority, as described below:</p>
+
 <dl>
-    <dt>
-<code><a href="{@docRoot}reference/com/google/android/gms/common/GooglePlayServicesClient.ConnectionCallbacks.html">ConnectionCallbacks</a></code>
-    </dt>
-    <dd>
-        Specifies methods that Location Services calls when a location client is connected or
-        disconnected.
-    </dd>
-    <dt>
-<code><a href="{@docRoot}reference/com/google/android/gms/common/GooglePlayServicesClient.OnConnectionFailedListener.html">OnConnectionFailedListener</a></code>
-    </dt>
-    <dd>
-        Specifies a method that Location Services calls if an error occurs while attempting to
-        connect the location client. This method uses the previously-defined {@code showErrorDialog}
-        method to display an error dialog that attempts to fix the problem using Google Play
-        services.
-    </dd>
+  <dt>
+    Update interval
+  </dt>
+  <dd>
+    <a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#setInterval(long)">{@code setInterval()}</a>
+    - This method sets the rate in milliseconds at which your app prefers to
+    receive location updates. Note that the location updates may be faster than
+    this rate if another app is receiving updates at a faster rate, or slower
+    than this rate, or there may be no updates at all (if the device has no
+    connectivity, for example).
+  </dd>
+  <dt>
+    Fastest update interval
+  </dt>
+  <dd>
+    <a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#setFastestInterval(long)">{@code setFastestInterval()}</a>
+    - This method sets the <strong>fastest</strong> rate in milliseconds at which
+    your app can handle location updates. You need to set this rate because
+    other apps also affect the rate at which updates are sent. The Google Play
+    services location APIs send out updates at the fastest rate that any app
+    has requested with
+    <a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#setInterval(long)">{@code setInterval()}</a>.
+    If this rate is faster
+    than your app can handle, you may encounter problems with UI flicker or data
+    overflow. To prevent this, call
+    <a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#setFastestInterval(long)">{@code setFastestInterval()}</a>
+    to set an upper limit to the update rate.
+  </dd>
+  <dt>Priority</dt>
+  <dd>
+    <p>
+      <a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#setPriority(int)">{@code setPriority()}</a>
+      - This method sets the priority of the request, which gives the Google Play
+      services location services a strong hint about which location sources to use.
+      The following values are supported:</p>
+      <ul>
+        <li>
+          <a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#PRIORITY_BALANCED_POWER_ACCURACY">{@code PRIORITY_BALANCED_POWER_ACCURACY}</a>
+          - Use this setting to request location precision to within a city
+          block, which is an accuracy of approximately 100 meters. This is
+          considered a coarse level of accuracy, and is likely to consume less
+          power. With this setting, the location services are likely to use WiFi
+          and cell tower positioning. Note, however, that the choice of location
+          provider depends on many other factors, such as which sources are
+          available.</li>
+        <li>
+          <a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#PRIORITY_HIGH_ACCURACY">{@code PRIORITY_HIGH_ACCURACY}</a>
+          - Use this setting to request the most precise location possible. With
+          this setting, the location services are more likely to use GPS
+          (Global Positioning System) to determine the location.</li>
+        <li><a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#PRIORITY_LOW_POWER">{@code PRIORITY_LOW_POWER}</a>
+          - Use this setting to request city-level precision, which is
+          an accuracy of approximately 10 kilometers. This is considered a
+          coarse level of accuracy, and is likely to consume less power.</li>
+        <li><a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#PRIORITY_NO_POWER">{@code PRIORITY_NO_POWER}</a>
+          - Use this setting if you need negligible impact on power consumption,
+          but want to receive location updates when available. With this
+          setting, your app does not trigger any location updates, but
+          receives locations triggered by other apps.</li>
+      </ul>
+  </dd>
 </dl>
-<p>
-    The following snippet shows how to specify the interfaces and define the methods:
-</p>
+
+<p>Create the location request and set the parameters as shown in this
+  code sample:</p>
+
 <pre>
-public class MainActivity extends FragmentActivity implements
-        GooglePlayServicesClient.ConnectionCallbacks,
-        GooglePlayServicesClient.OnConnectionFailedListener {
-    ...
-    /*
-     * Called by Location Services when the request to connect the
-     * client finishes successfully. At this point, you can
-     * request the current location or start periodic updates
-     */
-    &#64;Override
-    public void onConnected(Bundle dataBundle) {
-        // Display the connection status
-        Toast.makeText(this, "Connected", Toast.LENGTH_SHORT).show();
-    }
-    ...
-    /*
-     * Called by Location Services if the connection to the
-     * location client drops because of an error.
-     */
-    &#64;Override
-    public void onDisconnected() {
-        // Display the connection status
-        Toast.makeText(this, "Disconnected. Please re-connect.",
-                Toast.LENGTH_SHORT).show();
-    }
-    ...
-    /*
-     * Called by Location Services if the attempt to
-     * Location Services fails.
-     */
-    &#64;Override
-    public void onConnectionFailed(ConnectionResult connectionResult) {
-        /*
-         * Google Play services can resolve some errors it detects.
-         * If the error has a resolution, try sending an Intent to
-         * start a Google Play services activity that can resolve
-         * error.
-         */
-        if (connectionResult.hasResolution()) {
-            try {
-                // Start an Activity that tries to resolve the error
-                connectionResult.startResolutionForResult(
-                        this,
-                        CONNECTION_FAILURE_RESOLUTION_REQUEST);
-                /*
-                * Thrown if Google Play services canceled the original
-                * PendingIntent
-                */
-            } catch (IntentSender.SendIntentException e) {
-                // Log the error
-                e.printStackTrace();
-            }
-        } else {
-            /*
-             * If no resolution is available, display a dialog to the
-             * user with the error.
-             */
-            showErrorDialog(connectionResult.getErrorCode());
-        }
-    }
-    ...
+protected void createLocationRequest() {
+    LocationRequest mLocationRequest = new LocationRequest();
+    mLocationRequest.setInterval(10000);
+    mLocationRequest.setFastestInterval(5000);
+    mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
 }
 </pre>
-<h3>Define the location update callback</h3>
-<p>
-    Location Services sends location updates to your app either as an {@link android.content.Intent}
-    or as an argument passed to a callback method you define. This lesson shows you how to get the
-    update using a callback method, because that pattern works best for most use cases. If you want
-    to receive updates in the form of an {@link android.content.Intent}, read the lesson
-    <a href="activity-recognition.html">Recognizing the User's Current Activity</a>, which
-    presents a similar pattern.
-</p>
-<p>
-    The callback method that Location Services invokes to send a location update to your app is
-    specified in the
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationListener.html">LocationListener</a></code>
-    interface, in the method
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationListener.html#onLocationChanged(android.location.Location)">onLocationChanged()</a></code>.
-    The incoming argument is a {@link android.location.Location} object containing the location's
-    latitude and longitude. The following snippet shows how to specify the interface and define
-    the method:
-</p>
+
+<p>The priority of
+  <a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#PRIORITY_HIGH_ACCURACY">{@code PRIORITY_HIGH_ACCURACY}</a>,
+  combined with the
+  {@link android.Manifest.permission#ACCESS_FINE_LOCATION ACCESS_FINE_LOCATION}
+  permission setting that you've defined in the app manifest, and a fast update
+  interval of 5000 milliseconds (5 seconds), causes the fused location
+  provider to return location updates that are accurate to within a few feet.
+  This approach is appropriate for mapping apps that display the location in
+  real time.</p>
+
+<p class="note"><strong>Performance hint:</strong> If your app accesses the
+  network or does other long-running work after receiving a location update,
+  adjust the fastest interval to a slower value. This adjustment prevents your
+  app from receiving updates it can't use. Once the long-running work is done,
+  set the fastest interval back to a fast value.</p>
+
+<h2 id="updates">Request Location Updates</h2>
+
+<p>Now that you've set up a location request containing your app's requirements
+  for the location updates, you can start the regular updates by calling
+  <a href="{@docRoot}reference/com/google/android/gms/location/FusedLocationProviderApi.html#requestLocationUpdates(com.google.android.gms.common.api.GoogleApiClient, com.google.android.gms.location.LocationRequest, com.google.android.gms.location.LocationListener)">{@code requestLocationUpdates()}</a>.
+  Do this in the
+  <a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.ConnectionCallbacks.html#onConnected(android.os.Bundle)">{@code onConnected()}</a>
+  callback provided by Google API Client, which is called when the client is
+  ready.</p>
+
+<p>Depending on the form of the request, the fused location provider either
+  invokes the
+  <a href="{@docRoot}reference/com/google/android/gms/location/LocationListener.html">{@code LocationListener.onLocationChanged()}</a>
+  callback method and passes it a {@link android.location.Location} object, or
+  issues a
+  <a href="{@docRoot}reference/android/app/PendingIntent.html">{@code PendingIntent}</a>
+  that contains the location in its extended data. The accuracy and frequency of
+  the updates are affected by the location permissions you've requested and the
+  options you set in the location request object.</p>
+
+<p>This lesson shows you how to get the update using the
+  <a href="{@docRoot}reference/com/google/android/gms/location/LocationListener.html">{@code LocationListener}</a>
+  callback approach. Call
+  <a href="{@docRoot}reference/com/google/android/gms/location/FusedLocationProviderApi.html#requestLocationUpdates(com.google.android.gms.common.api.GoogleApiClient, com.google.android.gms.location.LocationRequest, com.google.android.gms.location.LocationListener)">{@code requestLocationUpdates()}</a>,
+  passing it your instance of the
+  <a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html">{@code GoogleApiClient}</a>,
+  the
+  <a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html">{@code LocationRequest}</a>
+  object,
+  and a <a href="{@docRoot}reference/com/google/android/gms/location/LocationListener.html">{@code LocationListener}</a>.
+  Define a {@code startLocationUpdates()} method, called from the
+  <a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.ConnectionCallbacks.html#onConnected(android.os.Bundle)">{@code onConnected()}</a>
+  callback, as shown in the following code sample:</p>
+
 <pre>
-public class MainActivity extends FragmentActivity implements
-        GooglePlayServicesClient.ConnectionCallbacks,
-        GooglePlayServicesClient.OnConnectionFailedListener,
-        LocationListener {
+&#64;Override
+public void onConnected(Bundle connectionHint) {
     ...
-    // Define the callback method that receives location updates
+    if (mRequestingLocationUpdates) {
+        startLocationUpdates();
+    }
+}
+
+protected void startLocationUpdates() {
+    LocationServices.FusedLocationApi.requestLocationUpdates(
+            mGoogleApiClient, mLocationRequest, this);
+}
+</pre>
+
+<p>Notice that the above code snippet refers to a boolean flag,
+  {@code mRequestingLocationUpdates}, used to track whether the user has
+  turned location updates on or off. For more about retaining the value of this
+  flag across instances of the activity, see
+  <a href="#save-state">Save the State of the Activity</a>.
+
+<h2 id="callback">Define the Location Update Callback</h2>
+
+<p>The fused location provider invokes the
+  <a href="{@docRoot}reference/com/google/android/gms/location/LocationListener.html#onLocationChanged(android.location.Location)">{@code LocationListener.onLocationChanged()}</a>
+  callback method. The incoming argument is a {@link android.location.Location}
+  object containing the location's latitude and longitude. The following snippet
+  shows how to implement the
+  <a href="{@docRoot}reference/com/google/android/gms/location/LocationListener.html">{@code LocationListener}</a>
+  interface and define the method, then get the timestamp of the location update
+  and display the latitude, longitude and timestamp on your app's user
+  interface:</p>
+
+<pre>
+public class MainActivity extends ActionBarActivity implements
+        ConnectionCallbacks, OnConnectionFailedListener, LocationListener {
+    ...
     &#64;Override
     public void onLocationChanged(Location location) {
-        // Report to the UI that the location was updated
-        String msg = "Updated Location: " +
-                Double.toString(location.getLatitude()) + "," +
-                Double.toString(location.getLongitude());
-        Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
+        mCurrentLocation = location;
+        mLastUpdateTime = DateFormat.getTimeInstance().format(new Date());
+        updateUI();
     }
-    ...
-}
-</pre>
-<p>
-    Now that you have the callbacks prepared, you can set up the request for location updates.
-    The first step is to specify the parameters that control the updates.
-</p>
-<!-- Specify update parameters -->
-<h2 id="UpdateParameters">Specify Update Parameters</h2>
-<p>
-    Location Services allows you to control the interval between updates and the location accuracy
-    you want, by setting the values in a
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html">LocationRequest</a></code>
-    object and then sending this object as part of your request to start updates.
-</p>
-<p>
-    First, set the following interval parameters:
-</p>
-<dl>
-    <dt>
-        Update interval
-    </dt>
-    <dd>
-        Set by
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#setInterval(long)">LocationRequest.setInterval()</a></code>.
-        This method sets the rate in milliseconds at which your app prefers to receive location
-        updates. If no other apps are receiving updates from Location Services, your app will
-        receive updates at this rate.
-    </dd>
-    <dt>
-        Fastest update interval
-    </dt>
-    <dd>
-        Set by
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#setFastestInterval(long)">LocationRequest.setFastestInterval()</a></code>.
-        This method sets the <b>fastest</b> rate in milliseconds at which your app can handle
-        location updates. You need to set this rate because other apps also affect the rate
-        at which updates are sent. Location Services sends out updates at the fastest rate that any
-        app requested by calling
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#setInterval(long)">LocationRequest.setInterval()</a></code>.
-        If this rate is faster than your app can handle, you may encounter problems with UI flicker
-        or data overflow. To prevent this, call
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#setFastestInterval(long)">LocationRequest.setFastestInterval()</a></code>
-        to set an upper limit to the update rate.
-        <p>
-            Calling
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#setFastestInterval(long)">LocationRequest.setFastestInterval()</a></code>
-            also helps to save power. When you request a preferred update rate by calling
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#setInterval(long)">LocationRequest.setInterval()</a></code>,
-            and a maximum rate by calling
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#setFastestInterval(long)">LocationRequest.setFastestInterval()</a></code>,
-            then your app gets the same update rate as the fastest rate in the system. If other
-            apps have requested a faster rate, you get the benefit of a faster rate. If no other
-            apps have a faster rate request outstanding, your app receives updates at the rate you specified
-        with
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#setInterval(long)">LocationRequest.setInterval()</a></code>.
-        </p>
-    </dd>
-</dl>
-<p>
-    Next, set the accuracy parameter. In a foreground app, you need constant location updates with
-    high accuracy, so use the setting
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationRequest.html#PRIORITY_HIGH_ACCURACY">LocationRequest.PRIORITY_HIGH_ACCURACY</a></code>.
-</p>
-<p>
-    The following snippet shows how to set the update interval and accuracy in
-    {@link android.support.v4.app.FragmentActivity#onCreate onCreate()}:
-</p>
-<pre>
-public class MainActivity extends FragmentActivity implements
-        GooglePlayServicesClient.ConnectionCallbacks,
-        GooglePlayServicesClient.OnConnectionFailedListener,
-        LocationListener {
-    ...
-    // Global constants
-    ...
-    // Milliseconds per second
-    private static final int MILLISECONDS_PER_SECOND = 1000;
-    // Update frequency in seconds
-    public static final int UPDATE_INTERVAL_IN_SECONDS = 5;
-    // Update frequency in milliseconds
-    private static final long UPDATE_INTERVAL =
-            MILLISECONDS_PER_SECOND * UPDATE_INTERVAL_IN_SECONDS;
-    // The fastest update frequency, in seconds
-    private static final int FASTEST_INTERVAL_IN_SECONDS = 1;
-    // A fast frequency ceiling in milliseconds
-    private static final long FASTEST_INTERVAL =
-            MILLISECONDS_PER_SECOND * FASTEST_INTERVAL_IN_SECONDS;
-    ...
-    // Define an object that holds accuracy and frequency parameters
-    LocationRequest mLocationRequest;
-    ...
-    &#64;Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        // Create the LocationRequest object
-        mLocationRequest = LocationRequest.create();
-        // Use high accuracy
-        mLocationRequest.setPriority(
-                LocationRequest.PRIORITY_HIGH_ACCURACY);
-        // Set the update interval to 5 seconds
-        mLocationRequest.setInterval(UPDATE_INTERVAL);
-        // Set the fastest update interval to 1 second
-        mLocationRequest.setFastestInterval(FASTEST_INTERVAL);
-        ...
-    }
-    ...
-}
-</pre>
-<p class="note">
-   <strong>Note:</strong> If your app accesses the network or does other long-running work after
-   receiving a location update, adjust the fastest interval to a slower value. This prevents your
-   app from receiving updates it can't use. Once the long-running work is done, set the fastest
-   interval back to a fast value.
-</p>
-<!-- Start Location Updates -->
-<h2 id="StartUpdates">Start Location Updates</h2>
-<p>
-    To send the request for location updates, create a location client in
-    {@link android.support.v4.app.FragmentActivity#onCreate onCreate()}, then connect it and make
-    the request by calling
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationClient.html#requestLocationUpdates(com.google.android.gms.location.LocationRequest, com.google.android.gms.location.LocationListener)">requestLocationUpdates()</a></code>.
-    Since your client must be connected for your app to receive updates, you should
-    connect the client in
-    {@link android.support.v4.app.FragmentActivity#onStart onStart()}. This ensures that you always
-    have a valid, connected client while your app is visible. Since you need a connection before you
-    can request updates, make the update request in
-<code><a href="{@docRoot}reference/com/google/android/gms/common/GooglePlayServicesClient.ConnectionCallbacks.html#onConnected(android.os.Bundle)">ConnectionCallbacks.onConnected()</a></code>
-</p>
-<p>
-    Remember that the user may want to turn off location updates for various reasons. You should
-    provide a way for the user to do this, and you should ensure that you don't start updates in
-    {@link android.support.v4.app.FragmentActivity#onStart onStart()} if updates were previously
-    turned off. To track the user's preference, store it in your app's
-    {@link android.content.SharedPreferences} in
-    {@link android.support.v4.app.FragmentActivity#onPause onPause()} and retrieve it in
-    {@link android.support.v4.app.FragmentActivity#onResume onResume()}.
-</p>
-<p>
-    The following snippet shows how to set up the client in
-    {@link android.support.v4.app.FragmentActivity#onCreate onCreate()}, and how to connect it
-    and request updates in {@link android.support.v4.app.FragmentActivity#onStart onStart()}:
-</p>
-<pre>
-public class MainActivity extends FragmentActivity implements
-        GooglePlayServicesClient.ConnectionCallbacks,
-        GooglePlayServicesClient.OnConnectionFailedListener,
-        LocationListener {
-    ...
-    // Global variables
-    ...
-    LocationClient mLocationClient;
-    boolean mUpdatesRequested;
-    ...
-    &#64;Override
-    protected void onCreate(Bundle savedInstanceState) {
-        ...
-        // Open the shared preferences
-        mPrefs = getSharedPreferences("SharedPreferences",
-                Context.MODE_PRIVATE);
-        // Get a SharedPreferences editor
-        mEditor = mPrefs.edit();
-        /*
-         * Create a new location client, using the enclosing class to
-         * handle callbacks.
-         */
-        mLocationClient = new LocationClient(this, this, this);
-        // Start with updates turned off
-        mUpdatesRequested = false;
-        ...
-    }
-    ...
-    &#64;Override
-    protected void onPause() {
-        // Save the current setting for updates
-        mEditor.putBoolean("KEY_UPDATES_ON", mUpdatesRequested);
-        mEditor.commit();
-        super.onPause();
-    }
-    ...
-    &#64;Override
-    protected void onStart() {
-        ...
-        mLocationClient.connect();
-    }
-    ...
-    &#64;Override
-    protected void onResume() {
-        /*
-         * Get any previous setting for location updates
-         * Gets "false" if an error occurs
-         */
-        if (mPrefs.contains("KEY_UPDATES_ON")) {
-            mUpdatesRequested =
-                    mPrefs.getBoolean("KEY_UPDATES_ON", false);
 
-        // Otherwise, turn off location updates
-        } else {
-            mEditor.putBoolean("KEY_UPDATES_ON", false);
-            mEditor.commit();
-        }
+    private void updateUI() {
+        mLatitudeTextView.setText(String.valueOf(mCurrentLocation.getLatitude()));
+        mLongitudeTextView.setText(String.valueOf(mCurrentLocation.getLongitude()));
+        mLastUpdateTimeTextView.setText(mLastUpdateTime);
     }
-    ...
-    /*
-     * Called by Location Services when the request to connect the
-     * client finishes successfully. At this point, you can
-     * request the current location or start periodic updates
-     */
-    &#64;Override
-    public void onConnected(Bundle dataBundle) {
-        // Display the connection status
-        Toast.makeText(this, "Connected", Toast.LENGTH_SHORT).show();
-        // If already requested, start periodic updates
-        if (mUpdatesRequested) {
-            mLocationClient.requestLocationUpdates(mLocationRequest, this);
-        }
-    }
-    ...
 }
 </pre>
-<p>
-    For more information about saving preferences, read
-<a href="{@docRoot}training/basics/data-storage/shared-preferences.html">Saving Key-Value Sets</a>.
-</p>
-<!--
-    Stop Location Updates
- -->
-<h2 id="StopUpdates">Stop Location Updates</h2>
-<p>
-    To stop location updates, save the state of the update flag in
-    {@link android.support.v4.app.FragmentActivity#onPause onPause()}, and stop updates in
-    {@link android.support.v4.app.FragmentActivity#onStop onStop()} by calling
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationClient.html#removeLocationUpdates(com.google.android.gms.location.LocationListener)">removeLocationUpdates(LocationListener)</a></code>.
-    For example:
-</p>
+
+<h2 id="stop-updates">Stop Location Updates</h2>
+
+<p>Consider whether you want to stop the location updates when the activity is
+  no longer in focus, such as when the user switches to another app or to a
+  different activity in the same app. This can be handy to reduce power
+  consumption, provided the app doesn't need to collect information even when
+  it's running in the background. This section shows how you can stop the
+  updates in the activity's
+  {@link android.app.Activity#onPause onPause()} method.</p>
+
+<p>To stop location updates, call
+  <a href="{@docRoot}reference/com/google/android/gms/location/FusedLocationProviderApi.html#removeLocationUpdates(com.google.android.gms.common.api.GoogleApiClient, com.google.android.gms.location.LocationListener)">{@code removeLocationUpdates()}</a>,
+  passing it your instance of the
+  <a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html">{@code GoogleApiClient}</a>
+  object and a
+  <a href="{@docRoot}reference/com/google/android/gms/location/LocationListener.html">{@code LocationListener}</a>,
+  as shown in the following code sample:</p>
+
 <pre>
-public class MainActivity extends FragmentActivity implements
-        GooglePlayServicesClient.ConnectionCallbacks,
-        GooglePlayServicesClient.OnConnectionFailedListener,
-        LocationListener {
-    ...
-    /*
-     * Called when the Activity is no longer visible at all.
-     * Stop updates and disconnect.
-     */
-    &#64;Override
-    protected void onStop() {
-        // If the client is connected
-        if (mLocationClient.isConnected()) {
-            /*
-             * Remove location updates for a listener.
-             * The current Activity is the listener, so
-             * the argument is "this".
-             */
-            removeLocationUpdates(this);
-        }
-        /*
-         * After disconnect() is called, the client is
-         * considered "dead".
-         */
-        mLocationClient.disconnect();
-        super.onStop();
-    }
-    ...
+&#64;Override
+protected void onPause() {
+    super.onPause();
+    stopLocationUpdates();
+}
+
+protected void stopLocationUpdates() {
+    LocationServices.FusedLocationApi.removeLocationUpdates(
+            mGoogleApiClient, this);
 }
 </pre>
-<p>
-    You now have the basic structure of an app that requests and receives periodic location updates.
-    You can combine the features described in this lesson with the geofencing, activity recognition,
-    or reverse geocoding features described in other lessons in this class.
-</p>
-<p>
-    The next lesson, <a href="display-address.html">Displaying a Location Address</a>, shows you how
-    to use the current location to display the current street address.
-</p>
+
+<p>Use a boolean, {@code mRequestingLocationUpdates}, to track
+  whether location updates are currently turned on. In the activity's
+  {@link android.app.Activity#onResume onResume()} method, check
+  whether location updates are currently active, and activate them if not:</p>
+
+<pre>
+&#64;Override
+public void onResume() {
+    super.onResume();
+    if (mGoogleApiClient.isConnected() && !mRequestingLocationUpdates) {
+        startLocationUpdates();
+    }
+}
+</pre>
+
+<h2 id="save-state">Save the State of the Activity</h2>
+
+<p>A change to the device's configuration, such as a change in screen
+  orientation or language, can cause the current activity to be destroyed. Your
+  app must therefore store any information it needs to recreate the activity.
+  One way to do this is via an instance state stored in a
+  {@link android.os.Bundle} object.</p>
+
+<p>The following code sample shows how to use the activity's
+  <a href="{@docRoot}reference/android/app/Activity.html#onSaveInstanceState(android.os.Bundle)">{@code onSaveInstanceState()}</a>
+  callback to save the instance state:</p>
+
+<pre>
+public void onSaveInstanceState(Bundle savedInstanceState) {
+    savedInstanceState.putBoolean(REQUESTING_LOCATION_UPDATES_KEY,
+            mRequestingLocationUpdates);
+    savedInstanceState.putParcelable(LOCATION_KEY, mCurrentLocation);
+    savedInstanceState.putString(LAST_UPDATED_TIME_STRING_KEY, mLastUpdateTime);
+    super.onSaveInstanceState(savedInstanceState);
+}
+</pre>
+
+<p>Define an {@code updateValuesFromBundle()} method to restore
+  the saved values from the previous instance of the activity, if they're
+  available. Call the method from the activity's
+  {@link android.app.Activity#onCreate onCreate()} method, as shown in the
+  following code sample:</p>
+
+<pre>
+&#64;Override
+public void onCreate(Bundle savedInstanceState) {
+    ...
+    updateValuesFromBundle(savedInstanceState);
+}
+
+private void updateValuesFromBundle(Bundle savedInstanceState) {
+    if (savedInstanceState != null) {
+        // Update the value of mRequestingLocationUpdates from the Bundle, and
+        // make sure that the Start Updates and Stop Updates buttons are
+        // correctly enabled or disabled.
+        if (savedInstanceState.keySet().contains(REQUESTING_LOCATION_UPDATES_KEY)) {
+            mRequestingLocationUpdates = savedInstanceState.getBoolean(
+                    REQUESTING_LOCATION_UPDATES_KEY);
+            setButtonsEnabledState();
+        }
+
+        // Update the value of mCurrentLocation from the Bundle and update the
+        // UI to show the correct latitude and longitude.
+        if (savedInstanceState.keySet().contains(LOCATION_KEY)) {
+            // Since LOCATION_KEY was found in the Bundle, we can be sure that
+            // mCurrentLocationis not null.
+            mCurrentLocation = savedInstanceState.getParcelable(LOCATION_KEY);
+        }
+
+        // Update the value of mLastUpdateTime from the Bundle and update the UI.
+        if (savedInstanceState.keySet().contains(LAST_UPDATED_TIME_STRING_KEY)) {
+            mLastUpdateTime = savedInstanceState.getString(
+                    LAST_UPDATED_TIME_STRING_KEY);
+        }
+        updateUI();
+    }
+}
+</pre>
+
+<p>For more about saving instance state, see the
+  <a href="{@docRoot}reference/android/app/Activity.html#ConfigurationChanges">Android
+  Activity</a> class reference.</p>
+
+<p class="note"><strong>Note:</strong> For a more persistent storage, you can
+  store the user's preferences in your app's
+  {@link android.content.SharedPreferences}. Set the shared preference in
+  your activity's {@link android.app.Activity#onPause onPause()} method, and
+  retrieve the preference in {@link android.app.Activity#onResume onResume()}.
+  For more information about saving preferences, read
+  <a href="{@docRoot}training/basics/data-storage/shared-preferences.html">Saving
+  Key-Value Sets</a>.</p>
+
+<p>The next lesson,
+  <a href="display-address.html">Displaying a Location Address</a>, shows
+  you how to display the street address for a given location.</p>
diff --git a/docs/html/training/location/retrieve-current.jd b/docs/html/training/location/retrieve-current.jd
index f079040..5bac3fa 100644
--- a/docs/html/training/location/retrieve-current.jd
+++ b/docs/html/training/location/retrieve-current.jd
@@ -1,386 +1,162 @@
-page.title=Retrieving the Current Location
+page.title=Getting the Last Known Location
 trainingnavtop=true
 @jd:body
+
 <div id="tb-wrapper">
-<div id="tb">
+  <div id="tb">
 
-<h2>This lesson teaches you to</h2>
-<ol>
-    <li><a href="#AppPermissions">Specify App Permissions</a></li>
-    <li><a href="#CheckServices">Check for Google Play services</a></li>
-    <li><a href="#DefineCallbacks">Define Location Services Callbacks</a></li>
-    <li><a href="#ConnectClient">Connect the Location Client</a></li>
-    <li><a href="#GetLocation">Get the Current Location</a></li>
-</ol>
+    <h2>This lesson teaches you how to</h2>
+    <ol>
+      <li><a href="#setup">Set Up Google Play Services</a></li>
+      <li><a href="#permissions">Specify App Permissions</a></li>
+      <li><a href="#play-services">Connect to Google Play Services</a></li>
+      <li><a href="#last-known">Get the Last Known Location</a></li>
+    </ol>
 
-<h2>You should also read</h2>
-<ul>
-    <li>
-        <a href="{@docRoot}google/play-services/setup.html">Setup Google Play Services SDK</a>
-    </li>
-</ul>
+    <h2>You should also read</h2>
+    <ul>
+      <li>
+        <a href="{@docRoot}google/play-services/setup.html">Setting up Google Play
+        Services</a>
+      </li>
+    </ul>
 
-<h2>Try it out</h2>
-
-<div class="download-box">
-  <a href="http://developer.android.com/shareables/training/LocationUpdates.zip" class="button">Download the sample</a>
-  <p class="filename">LocationUpdates.zip</p>
+    <h2>Try it out</h2>
+    <ul>
+      <li>
+        <a href="https://github.com/googlesamples/android-play-location/tree/master/BasicLocationSample" class="external-link">BasicLocationSample</a>
+      </li>
+    </ul>
+  </div>
 </div>
 
-</div>
-</div>
+<p>Using the Google Play services location APIs, your app can request the last
+  known location of the user's device. In most cases, you are interested in the
+  user's current location, which is usually equivalent to the last known
+  location of the device.</p>
 
-<p>
-    Location Services automatically maintains the user's current location, so all your app has to do
-    is retrieve it as needed. The location's accuracy is based on the location permissions you've
-    requested and location sensors that are currently active for the device.
-<p>
-    Location Services sends the current location to your app through a location client, which is
-    an instance of the Location Services class
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationClient.html">LocationClient</a></code>.
-    All requests for location information go through this client.
-</p>
-<p class="note">
-    <strong>Note:</strong> Before you start the lesson, be sure that your development environment
-    and test device are set up correctly. To learn more about this, read the
-    <a href="{@docRoot}google/play-services/setup.html">Setup</a> section in the Google Play
-    services guide.
-</p>
-<!--
-    Specify App Permissions
- -->
-<h2 id="AppPermissions">Specify App Permissions</h2>
-<p>
-    Apps that use Location Services must request location permissions. Android has two location
-    permissions: {@link android.Manifest.permission#ACCESS_COARSE_LOCATION ACCESS_COARSE_LOCATION}
-    and {@link android.Manifest.permission#ACCESS_FINE_LOCATION ACCESS_FINE_LOCATION}. The
-    permission you choose controls the accuracy of the current location. If you request only coarse
-    location permission, Location Services obfuscates the returned location to an accuracy
-    that's roughly equivalent to a city block.
-</p>
-<p>
-    Requesting {@link android.Manifest.permission#ACCESS_FINE_LOCATION ACCESS_FINE_LOCATION} implies
-    a request for {@link android.Manifest.permission#ACCESS_COARSE_LOCATION ACCESS_COARSE_LOCATION}.
-</p>
-<p>
-    For example, to add {@link android.Manifest.permission#ACCESS_COARSE_LOCATION
-    ACCESS_COARSE_LOCATION}, insert the following as a child element of the
-    <code><a href="{@docRoot}guide/topics/manifest/manifest-element.html">&lt;manifest&gt;</a></code>
-    element:
-</p>
-<pre>
-&lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/&gt;
-</pre>
-<!--
-    Check for Google Play Services
- -->
-<h2 id="CheckServices">Check for Google Play Services</h2>
-<p>
-    Location Services is part of the Google Play services APK. Since it's hard to anticipate the
-    state of the user's device, you should always check that the APK is installed before you attempt
-    to connect to Location Services. To check that the APK is installed, call
-<code><a href="{@docRoot}reference/com/google/android/gms/common/GooglePlayServicesUtil.html#isGooglePlayServicesAvailable(android.content.Context)">GooglePlayServicesUtil.isGooglePlayServicesAvailable()</a></code>,
-    which returns one of the
-    integer result codes listed in the reference documentation for
-<code><a href="{@docRoot}reference/com/google/android/gms/common/ConnectionResult.html">ConnectionResult</a></code>.
-    If you encounter an error, call
-<code><a href="{@docRoot}reference/com/google/android/gms/common/GooglePlayServicesUtil.html#getErrorDialog(int, android.app.Activity, int)">GooglePlayServicesUtil.getErrorDialog()</a></code>
-    to retrieve localized dialog that prompts users to take the correct action, then display
-    the dialog in a {@link android.support.v4.app.DialogFragment}. The dialog may allow the
-    user to correct the problem, in which case Google Play services may send a result back to your
-    activity. To handle this result, override the method
-    {@link android.support.v4.app.FragmentActivity#onActivityResult onActivityResult()}.
-</p>
-<p>
-    Since you usually need to check for Google Play services in more than one place in your code,
-    define a method that encapsulates the check, then call the method before each connection
-    attempt. The following snippet contains all of the code required to check for Google
-    Play services:
-</p>
-<pre>
-public class MainActivity extends FragmentActivity {
-    ...
-    // Global constants
-    /*
-     * Define a request code to send to Google Play services
-     * This code is returned in Activity.onActivityResult
-     */
-    private final static int
-            CONNECTION_FAILURE_RESOLUTION_REQUEST = 9000;
-    ...
-    // Define a DialogFragment that displays the error dialog
-    public static class ErrorDialogFragment extends DialogFragment {
-        // Global field to contain the error dialog
-        private Dialog mDialog;
-        // Default constructor. Sets the dialog field to null
-        public ErrorDialogFragment() {
-            super();
-            mDialog = null;
-        }
-        // Set the dialog to display
-        public void setDialog(Dialog dialog) {
-            mDialog = dialog;
-        }
-        // Return a Dialog to the DialogFragment.
-        &#64;Override
-        public Dialog onCreateDialog(Bundle savedInstanceState) {
-            return mDialog;
-        }
-    }
-    ...
-    /*
-     * Handle results returned to the FragmentActivity
-     * by Google Play services
-     */
-    &#64;Override
-    protected void onActivityResult(
-            int requestCode, int resultCode, Intent data) {
-        // Decide what to do based on the original request code
-        switch (requestCode) {
-            ...
-            case CONNECTION_FAILURE_RESOLUTION_REQUEST :
-            /*
-             * If the result code is Activity.RESULT_OK, try
-             * to connect again
-             */
-                switch (resultCode) {
-                    case Activity.RESULT_OK :
-                    /*
-                     * Try the request again
-                     */
-                    ...
-                    break;
-                }
-            ...
-        }
-     }
-    ...
-    private boolean servicesConnected() {
-        // Check that Google Play services is available
-        int resultCode =
-                GooglePlayServicesUtil.
-                        isGooglePlayServicesAvailable(this);
-        // If Google Play services is available
-        if (ConnectionResult.SUCCESS == resultCode) {
-            // In debug mode, log the status
-            Log.d("Location Updates",
-                    "Google Play services is available.");
-            // Continue
-            return true;
-        // Google Play services was not available for some reason.
-        // resultCode holds the error code.
-        } else {
-            // Get the error dialog from Google Play services
-            Dialog errorDialog = GooglePlayServicesUtil.getErrorDialog(
-                    resultCode,
-                    this,
-                    CONNECTION_FAILURE_RESOLUTION_REQUEST);
+<p>Specifically, use the
+  <a href="{@docRoot}reference/com/google/android/gms/location/FusedLocationProviderApi.html">fused
+  location provider</a> to retrieve the device's last known location. The fused
+  location provider is one of the location APIs in Google Play services. It
+  manages the underlying location technology and provides a simple API so that
+  you can specify requirements at a high level, like high accuracy or low power.
+  It also optimizes the device's use of battery power.</p>
 
-            // If Google Play services can provide an error dialog
-            if (errorDialog != null) {
-                // Create a new DialogFragment for the error dialog
-                ErrorDialogFragment errorFragment =
-                        new ErrorDialogFragment();
-                // Set the dialog in the DialogFragment
-                errorFragment.setDialog(errorDialog);
-                // Show the error dialog in the DialogFragment
-                errorFragment.show(getSupportFragmentManager(),
-                        "Location Updates");
-            }
-        }
-    }
-    ...
-}
-</pre>
-<p>
-    Snippets in the following sections call this method to verify that Google Play services is
-    available.
-</p>
-<!--
-    Define Location Services Callbacks
- -->
-<h2 id="DefineCallbacks">Define Location Services Callbacks</h2>
-<p>
-    To get the current location, create a location client, connect it
-    to Location Services, and then call its
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationClient.html#getLastLocation()">getLastLocation()</a></code>
-    method. The return value  is the best, most recent location, based on the permissions your
-    app requested and the currently-enabled location sensors.
-<p>
-<p>
-    Before you create the location client, implement the interfaces that Location Services uses to
-    communicate with your app:
-</p>
-<dl>
-    <dt>
-<code><a href="{@docRoot}reference/com/google/android/gms/common/GooglePlayServicesClient.ConnectionCallbacks.html">ConnectionCallbacks</a></code>
-    </dt>
-    <dd>
-        Specifies methods that Location Services calls when a location client is connected or
-        disconnected.
-    </dd>
-    <dt>
-<code><a href="{@docRoot}reference/com/google/android/gms/common/GooglePlayServicesClient.OnConnectionFailedListener.html">OnConnectionFailedListener</a></code>
-    </dt>
-    <dd>
-        Specifies a method that Location Services calls if an error occurs while attempting to
-        connect the location client. This method uses the previously-defined {@code showErrorDialog}
-        method to display an error dialog that attempts to fix the problem using Google Play
-        services.
-    </dd>
-</dl>
-<p>
-    The following snippet shows how to specify the interfaces and define the methods:
-</p>
-<pre>
-public class MainActivity extends FragmentActivity implements
-        GooglePlayServicesClient.ConnectionCallbacks,
-        GooglePlayServicesClient.OnConnectionFailedListener {
-    ...
-    /*
-     * Called by Location Services when the request to connect the
-     * client finishes successfully. At this point, you can
-     * request the current location or start periodic updates
-     */
-    &#64;Override
-    public void onConnected(Bundle dataBundle) {
-        // Display the connection status
-        Toast.makeText(this, "Connected", Toast.LENGTH_SHORT).show();
+<p>This lesson shows you how to make a single request for the location of a
+  device using the
+  <a href="{@docRoot}reference/com/google/android/gms/location/FusedLocationProviderApi.html#getLastLocation(com.google.android.gms.common.api.GoogleApiClient)">{@code getLastLocation()}</a>
+  method in the fused location provider.
 
-    }
+<h2 id="setup">Set Up Google Play Services</h2>
+
+<p>To access the fused location provider, your app's development project must
+  include Google Play services. Download and install the Google Play services
+  component via the <a href="{@docRoot}tools/help/sdk-manager.html">SDK
+  Manager</a> and add the library to your project. For details, see the guide to
+  <a href="{@docRoot}google/play-services/setup.html">Setting Up Google Play
+  Services</a>.</p>
+
+<h2 id="permissions">Specify App Permissions</h2>
+
+<p>Apps that use location services must request location permissions. Android
+  offers two location permissions:
+  {@link android.Manifest.permission#ACCESS_COARSE_LOCATION ACCESS_COARSE_LOCATION}
+  and
+  {@link android.Manifest.permission#ACCESS_FINE_LOCATION ACCESS_FINE_LOCATION}.
+  The permission you choose determines the accuracy of the location returned by
+  the API. If you specify
+  {@link android.Manifest.permission#ACCESS_COARSE_LOCATION ACCESS_COARSE_LOCATION},
+  the API returns a location with an accuracy approximately equivalent to a city
+  block.</p>
+
+<p>This lesson requires only coarse location. Request this permission with the
+  {@code uses-permission} element in your app manifest, as shown in the
+  following example:
+
+<pre>
+&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.google.android.gms.location.sample.basiclocationsample" &gt;
+  
+  &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/&gt;
+&lt;/manifest&gt;
+</pre>
+
+<h2 id="play-services">Connect to Google Play Services</h2>
+
+<p>To connect to the API, you need to create an instance of the
+  Google Play services API client. For details about using the client, see
+  the guide to
+  <a href="{@docRoot}google/auth/api-client.html#Starting">Accessing Google
+  APIs</a>.
+</p>
+
+<p>In your activity's {@link android.app.Activity#onCreate onCreate()} method,
+  create an instance of Google API Client using
+  <a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.Builder.html">{@code GoogleApiClient.Builder}</a>.
+  Use the builder to add the
+  <a href="{@docRoot}reference/com/google/android/gms/location/LocationServices.html">{@code LocationServices}</a>
+  API.</p>
+
+<p>The sample app defines a {@code buildGoogleApiClient()} method, called from
+  the activity's {@link android.app.Activity#onCreate onCreate()} method,
+  which includes the following code.</p>
+
+<pre>
+protected synchronized void buildGoogleApiClient() {
+    mGoogleApiClient = new GoogleApiClient.Builder(this)
+        .addConnectionCallbacks(this)
+        .addOnConnectionFailedListener(this)
+        .addApi(LocationServices.API)
+        .build();
+}
+</pre>
+
+<h2 id="last-known">Get the Last Known Location</h2>
+
+<p>Once you have connected to Google Play services and the location services
+  API, you can get the last known location of a user's device. When your app is
+  connected to these you can use the fused location provider's
+  <a href="{@docRoot}reference/com/google/android/gms/location/FusedLocationProviderApi.html#getLastLocation(com.google.android.gms.common.api.GoogleApiClient)">{@code getLastLocation()}</a>
+  method to retrieve the device location. The precision of the location returned
+  by this call is determined by the permission setting you put in your app
+  manifest, as described in the <a href="#permissions">Specify App
+  Permissions</a> section of this document.</p>
+
+<p>To request the last known location, call the
+  <a href="{@docRoot}reference/com/google/android/gms/location/FusedLocationProviderApi.html#getLastLocation(com.google.android.gms.common.api.GoogleApiClient)">{@code getLastLocation()}</a>
+  method, passing it your instance of the
+  <a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html">{@code GoogleApiClient}</a>
+  object. Do this in the
+  <a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.ConnectionCallbacks.html#onConnected(android.os.Bundle)">{@code onConnected()}</a>
+  callback provided by Google API Client, which is called when the client is
+  ready. The following code sample illustrates the request and a simple
+  handling of the response:</p>
+
+<pre>
+public class MainActivity extends ActionBarActivity implements
+        ConnectionCallbacks, OnConnectionFailedListener {
     ...
-    /*
-     * Called by Location Services if the connection to the
-     * location client drops because of an error.
-     */
     &#64;Override
-    public void onDisconnected() {
-        // Display the connection status
-        Toast.makeText(this, "Disconnected. Please re-connect.",
-                Toast.LENGTH_SHORT).show();
-    }
-    ...
-    /*
-     * Called by Location Services if the attempt to
-     * Location Services fails.
-     */
-    &#64;Override
-    public void onConnectionFailed(ConnectionResult connectionResult) {
-        /*
-         * Google Play services can resolve some errors it detects.
-         * If the error has a resolution, try sending an Intent to
-         * start a Google Play services activity that can resolve
-         * error.
-         */
-        if (connectionResult.hasResolution()) {
-            try {
-                // Start an Activity that tries to resolve the error
-                connectionResult.startResolutionForResult(
-                        this,
-                        CONNECTION_FAILURE_RESOLUTION_REQUEST);
-                /*
-                 * Thrown if Google Play services canceled the original
-                 * PendingIntent
-                 */
-            } catch (IntentSender.SendIntentException e) {
-                // Log the error
-                e.printStackTrace();
-            }
-        } else {
-            /*
-             * If no resolution is available, display a dialog to the
-             * user with the error.
-             */
-            showErrorDialog(connectionResult.getErrorCode());
+    public void onConnected(Bundle connectionHint) {
+        mLastLocation = LocationServices.FusedLocationApi.getLastLocation(
+                mGoogleApiClient);
+        if (mLastLocation != null) {
+            mLatitudeText.setText(String.valueOf(mLastLocation.getLatitude()));
+            mLongitudeText.setText(String.valueOf(mLastLocation.getLongitude()));
         }
     }
-    ...
 }
 </pre>
-<!--
-    Connect the Location Client
- -->
-<h2 id="ConnectClient">Connect the Location Client</h2>
-<p>
-    Now that the callback methods are in place, create the location client and connect it to
-    Location Services.
-</p>
-<p>
-    You should create the location client in {@link android.support.v4.app.FragmentActivity#onCreate
-    onCreate()}, then connect it in
-    {@link android.support.v4.app.FragmentActivity#onStart onStart()}, so that Location Services
-    maintains the current location while your activity is fully visible. Disconnect the client in
-    {@link android.support.v4.app.FragmentActivity#onStop onStop()}, so that when your app is not
-    visible, Location Services is not maintaining the current location. Following this pattern of
-    connection and disconnection helps save battery power. For example:
-</p>
-<p class="note">
-    <strong>Note:</strong> The current location is only maintained while a location client is
-    connected to Location Service. Assuming that no other apps are connected to Location Services,
-    if you disconnect the client and then sometime later call
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationClient.html#getLastLocation()">getLastLocation()</a></code>,
-    the result may be out of date.
-</p>
-<pre>
-public class MainActivity extends FragmentActivity implements
-        GooglePlayServicesClient.ConnectionCallbacks,
-        GooglePlayServicesClient.OnConnectionFailedListener {
-    ...
-    &#64;Override
-    protected void onCreate(Bundle savedInstanceState) {
-        ...
-        /*
-         * Create a new location client, using the enclosing class to
-         * handle callbacks.
-         */
-        mLocationClient = new LocationClient(this, this, this);
-        ...
-    }
-    ...
-    /*
-     * Called when the Activity becomes visible.
-     */
-    &#64;Override
-    protected void onStart() {
-        super.onStart();
-        // Connect the client.
-        mLocationClient.connect();
-    }
-    ...
-    /*
-     * Called when the Activity is no longer visible.
-     */
-    &#64;Override
-    protected void onStop() {
-        // Disconnecting the client invalidates it.
-        mLocationClient.disconnect();
-        super.onStop();
-    }
-    ...
-}
-</pre>
-<!--
-    Get the Current Location
- -->
-<h2 id="GetLocation">Get the Current Location</h2>
-<p>
-    To get the current location, call
-<code><a href="{@docRoot}reference/com/google/android/gms/location/LocationClient.html#getLastLocation()">getLastLocation()</a></code>.
-    For example:
-</p>
-<pre>
-public class MainActivity extends FragmentActivity implements
-        GooglePlayServicesClient.ConnectionCallbacks,
-        GooglePlayServicesClient.OnConnectionFailedListener {
-    ...
-    // Global variable to hold the current location
-    Location mCurrentLocation;
-    ...
-    mCurrentLocation = mLocationClient.getLastLocation();
-    ...
-}
-</pre>
-<p>
-    The next lesson, <a href="receive-location-updates.html">Receiving Location Updates</a>, shows
-    you how to receive periodic location updates from Location Services.
-</p>
+
+<p>The
+  <a href="{@docRoot}reference/com/google/android/gms/location/FusedLocationProviderApi.html#getLastLocation(com.google.android.gms.common.api.GoogleApiClient)">{@code getLastLocation()}</a>
+  method returns a
+  <a href="{@docRoot}reference/android/location/Location.html">{@code Location}</a>
+  object from which you can retrieve the latitude and longitude coordinates of a
+  geographic location. The location object returned may be null in rare cases
+  when the location is not available.</p>
+
+<p>The next lesson,
+  <a href="receive-location-updates.html">Receiving Location Updates</a>, shows
+  you how to receive periodic location updates.</p>
diff --git a/docs/html/training/material/drawables.jd b/docs/html/training/material/drawables.jd
index fd21e3d..820a004 100644
--- a/docs/html/training/material/drawables.jd
+++ b/docs/html/training/material/drawables.jd
@@ -83,6 +83,16 @@
 
 <h2 id="VectorDrawables">Create Vector Drawables</h2>
 
+<!-- video box -->
+<a class="notice-developers-video"
+   href="https://www.youtube.com/watch?v=wlFVIIstKmA"
+   style="margin-top:18px">
+<div>
+    <h3>Video</h3>
+    <p>Android Vector Graphics</p>
+</div>
+</a>
+
 <p>In Android 5.0 (API Level 21) and above, you can define vector drawables, which scale without
 losing definition. You need only one asset file for a vector image, as opposed to an asset file for
 each screen density in the case of bitmap images. To create a vector image, you define the details
diff --git a/docs/html/training/multiscreen/screendensities.jd b/docs/html/training/multiscreen/screendensities.jd
index 7817830..fcb65cc 100644
--- a/docs/html/training/multiscreen/screendensities.jd
+++ b/docs/html/training/multiscreen/screendensities.jd
@@ -15,8 +15,8 @@
 
 
 <!-- This is the training bar -->
-<div id="tb-wrapper"> 
-<div id="tb"> 
+<div id="tb-wrapper">
+<div id="tb">
 
 <h2>This lesson teaches you to</h2>
 <ol>
@@ -33,16 +33,15 @@
 </ul>
 
 <h2>Try it out</h2>
- 
-<div class="download-box"> 
+
+<div class="download-box">
 <a href="http://developer.android.com/shareables/training/NewsReader.zip" class="button">Download
   the sample app</a>
-<p class="filename">NewsReader.zip</p> 
-</div> 
- 
- 
-</div> 
-</div> 
+<p class="filename">NewsReader.zip</p>
+</div>
+
+</div>
+</div>
 
 <p>This lesson shows you how to support different screen densities
 by providing different resources and using resolution-independent units of
@@ -54,19 +53,29 @@
 absolute pixels to define distances or sizes. Defining layout dimensions with
 pixels is a problem because different screens have different pixel densities,
 so the same number of pixels may correspond to different physical sizes on
-different devices. Therefore, when specifying dimensions, always use either 
+different devices. Therefore, when specifying dimensions, always use either
 <code>dp</code> or <code>sp</code> units. A <code>dp</code> is a density-independent pixel
 that corresponds to the physical size of a pixel at 160 dpi. An <code>sp</code> is the same
 base unit, but is scaled by the user's preferred text size (it’s a
 scale-independent pixel), so you should use this measurement unit when defining
 text size (but never for layout sizes).</p>
 
-<p>For example, when you specify spacing between two views, use <code>dp</code> 
+ <!-- video box -->
+<a class="notice-developers-video left" href="https://www.youtube.com/watch?v=zhszwkcay2A">
+<div>
+    <h3>Video</h3>
+    <p>DesignBytes: Density-independent Pixels</p>
+</div>
+</a>
+
+<br style="clear:left">
+
+<p>For example, when you specify spacing between two views, use <code>dp</code>
 rather than <code>px</code>:</p>
 
 <pre>
-&lt;Button android:layout_width="wrap_content" 
-    android:layout_height="wrap_content" 
+&lt;Button android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
     android:text="&#64;string/clickme"
     android:layout_marginTop="20dp" /&gt;
 </pre>
@@ -74,8 +83,8 @@
 <p>When specifying text size, always use <code>sp</code>:</p>
 
 <pre>
-&lt;TextView android:layout_width="match_parent" 
-    android:layout_height="wrap_content" 
+&lt;TextView android:layout_width="match_parent"
+    android:layout_height="wrap_content"
     android:textSize="20sp" /&gt;
 </pre>
 
diff --git a/docs/html/training/training_toc.cs b/docs/html/training/training_toc.cs
index f3b2693..2489b91 100644
--- a/docs/html/training/training_toc.cs
+++ b/docs/html/training/training_toc.cs
@@ -694,7 +694,7 @@
         <ul>
           <li>
             <a href="<?cs var:toroot ?>training/location/retrieve-current.html">
-            Retrieving the Current Location
+            Getting the Last Known Location
             </a>
           </li>
           <li>
diff --git a/docs/html/training/tv/playback/index.jd b/docs/html/training/tv/playback/index.jd
index 31c7524..5427d48 100644
--- a/docs/html/training/tv/playback/index.jd
+++ b/docs/html/training/tv/playback/index.jd
@@ -17,9 +17,20 @@
     <li><a href="{@docRoot}design/tv/index.html">
       Design for TV</a></li>
   </ul>
+
 </div>
 </div>
 
+  <!-- video box -->
+<a class="notice-developers-video" href="https://www.youtube.com/watch?v=72K1VhjoL98">
+<div>
+    <h3>Video</h3>
+    <p>DevBytes: Android TV &mdash; Using the Leanback library</p>
+</div>
+</a>
+
+
+
 <p>
   Browsing and playing media files is frequently part of the user experience provided by a TV app.
   Building such an experience from scratch, while making sure that it is fast, fluid, and attractive
diff --git a/media/java/android/media/tv/TvInputManager.java b/media/java/android/media/tv/TvInputManager.java
index 78714d2..e692084 100644
--- a/media/java/android/media/tv/TvInputManager.java
+++ b/media/java/android/media/tv/TvInputManager.java
@@ -127,10 +127,10 @@
      * <receiver android:name=".TvInputReceiver">
      *     <intent-filter>
      *         <action android:name=
-     *                 "android.media.tv.TvInputManager.ACTION_QUERY_CONTENT_RATING_SYSTEMS" />
+     *                 "android.media.tv.action.QUERY_CONTENT_RATING_SYSTEMS" />
      *     </intent-filter>
      *     <meta-data
-     *             android:name="android.media.tv.TvInputManager.META_DATA_CONTENT_RATING_SYSTEMS"
+     *             android:name="android.media.tv.metadata.CONTENT_RATING_SYSTEMS"
      *             android:resource="@xml/tv_content_rating_systems" />
      * </receiver>}</pre></p>
      * In the above example, the <code>@xml/tv_content_rating_systems</code> resource refers to an