summaryrefslogtreecommitdiffstats
path: root/docs/html/training/location/index.jd
blob: c4dec9928d8228c4d5730f550063f22dc8c6874a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
page.title=Making Your App Location-Aware
page.tags=location,geofence,geofencing,activity recognition,activity detection,gps

trainingnavtop=true
startpage=true


@jd:body

<div id="tb-wrapper">
<div id="tb">

<!-- Required platform, tools, add-ons, devices, knowledge, etc. -->
<h2>Dependencies and prerequisites</h2>
<ul>
    <li>Google Play services client library (latest version)</li>
    <li>Android version 2.2 (API level 8) or later</li>
</ul>

<!-- related docs (NOT javadocs) -->
<h2>You should also read</h2>
<ul>
    <li>
        <a href="{@docRoot}google/play-services/setup.html">Set Up Google Play
        Services SDK</a>
    </li>
</ul>

</div>
</div>

<p>
  One of the unique features of mobile applications is location awareness.
  Mobile users take their devices with them everywhere, and adding location
  awareness to your app offers users a more contextual experience. The location
  APIs available in Google Play services facilitate adding location awareness to
  your app with automated location tracking, geofencing, and activity
  recognition.
</p>

<p>The
  <a href="{@docRoot}reference/com/google/android/gms/location/package-summary.html">Google
  Play services location APIs</a> are preferred over the Android framework
  location APIs
  (<a href="{@docRoot}reference/android/location/package-summary.html">android.location</a>)
  as a way of adding location awareness to your app. If you are currently using
  the Android framework location APIs, you are strongly encouraged to switch to
  the Google Play services location APIs as soon as possible.
</p>

<p>
  This class shows you how to use the Google Play services location APIs in your
  app to get the current location, get periodic location updates, and look up
  addresses. The class includes sample apps and code snippets that you can use as a starting point
  for adding location awareness to your app.
</p>

<p class="note">
  <strong>Note:</strong> Since this class is based on the Google Play services
  client library, make sure you install the latest version before using the
  sample apps or code snippets. To learn how to set up the client library with
  the latest version, see
  <a href="{@docRoot}google/play-services/setup.html">Setup</a> in the Google
  Play services guide.
</p>
<h2>Lessons</h2>
<dl>
  <dt>
    <b><a href="retrieve-current.html">Getting the Last Known Location</a></b>
  </dt> <dd>
     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>
  </dt> <dd>
     Learn how to request and receive periodic location updates.
  </dd> <dt>
    <b><a href="display-address.html">Displaying a Location Address</a></b>
  </dt> <dd>
    Learn how to convert a location's latitude and longitude into an address
    (reverse geocoding).
  </dd>
  <dt>
    <b><a href="geofencing.html">Creating and Monitoring Geofences</a></b>
  </dt> <dd>
    Learn how to define one or more geographic areas as locations of interest,
    called geofences, and detect when the user is close to or inside a geofence.
  </dd>
</dl>