-
Here's the solution.
-
To create your mLocationRequest,
you just simply call
-
LocationRequest.create and
then to set the high accuracy priority,
-
you call LocationRequest.setPriority and
pass it a constant
-
PRIORITY_HIGH_ACCURACY which you'll
find in the location request class.
-
You've already set the interval to 1000
milliseconds so then finally, all you
-
have to do on the FusedLocationApi
is requestLocationUpdates and
-
pass it to GoogleApiClient,
to LocationRequest, and this
-
referring to this activity so that the
call backs will come to this activity.
-
All of these code should be on one line,
-
I've just broken it up into separate
lines here for easy reading.
-
Now because you were
requesting location updates,
-
you'll need to implement a call back
called on location changed which,
-
as its name suggests, will get
called whenever the location changes
-
even just a little with this interval
and this high accuracy determining that.