Home | History | Annotate | Download | only in location
      1 page.title=Making Your App Location-Aware
      2 page.tags=location,geofence,geofencing,activity recognition,activity detection,gps
      3 
      4 trainingnavtop=true
      5 startpage=true
      6 
      7 
      8 @jd:body
      9 
     10 <div id="tb-wrapper">
     11 <div id="tb">
     12 
     13 <!-- Required platform, tools, add-ons, devices, knowledge, etc. -->
     14 <h2>Dependencies and prerequisites</h2>
     15 <ul>
     16     <li>Google Play services client library (latest version)</li>
     17     <li>Android version 2.2 (API level 8) or later</li>
     18 </ul>
     19 
     20 <!-- related docs (NOT javadocs) -->
     21 <h2>You should also read</h2>
     22 <ul>
     23     <li>
     24         <a href="{@docRoot}google/play-services/setup.html">Set Up Google Play
     25         Services SDK</a>
     26     </li>
     27 </ul>
     28 
     29 </div>
     30 </div>
     31 
     32 <p>
     33   One of the unique features of mobile applications is location awareness.
     34   Mobile users take their devices with them everywhere, and adding location
     35   awareness to your app offers users a more contextual experience. The location
     36   APIs available in Google Play services facilitate adding location awareness to
     37   your app with automated location tracking, geofencing, and activity
     38   recognition.
     39 </p>
     40 
     41 <p>The
     42   <a href="{@docRoot}reference/com/google/android/gms/location/package-summary.html">Google
     43   Play services location APIs</a> are preferred over the Android framework
     44   location APIs
     45   (<a href="{@docRoot}reference/android/location/package-summary.html">android.location</a>)
     46   as a way of adding location awareness to your app. If you are currently using
     47   the Android framework location APIs, you are strongly encouraged to switch to
     48   the Google Play services location APIs as soon as possible.
     49 </p>
     50 
     51 <p>
     52   This class shows you how to use the Google Play services location APIs in your
     53   app to get the current location, get periodic location updates, and look up
     54   addresses. The class includes sample apps and code snippets that you can use as a starting point
     55   for adding location awareness to your app.
     56 </p>
     57 
     58 <p class="note">
     59   <strong>Note:</strong> Since this class is based on the Google Play services
     60   client library, make sure you install the latest version before using the
     61   sample apps or code snippets. To learn how to set up the client library with
     62   the latest version, see
     63   <a href="{@docRoot}google/play-services/setup.html">Setup</a> in the Google
     64   Play services guide.
     65 </p>
     66 <h2>Lessons</h2>
     67 <dl>
     68   <dt>
     69     <b><a href="retrieve-current.html">Getting the Last Known Location</a></b>
     70   </dt> <dd>
     71      Learn how to retrieve the last known location of an Android device, which
     72      is usually equivalent to the user's current location.
     73   </dd> <dt>
     74     <b><a href="receive-location-updates.html">Receiving Location
     75     Updates</a></b>
     76   </dt> <dd>
     77      Learn how to request and receive periodic location updates.
     78   </dd> <dt>
     79     <b><a href="display-address.html">Displaying a Location Address</a></b>
     80   </dt> <dd>
     81     Learn how to convert a location's latitude and longitude into an address
     82     (reverse geocoding).
     83   </dd>
     84 </dl>
     85