Last active
August 29, 2015 14:22
-
-
Save kylecorry31/c8c7cc5d9298ddf7e7cd to your computer and use it in GitHub Desktop.
Location with Google Play Services for Android.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LocationRequest mLocationRequest; | |
protected void stopLocationUpdates(){ | |
LocationServices.FusedLocationApi.removeLocationUpdates(mGoogleApiClient, this); | |
} | |
protected void createLocationRequest(){ | |
mLocationRequest = new LocationRequest(); | |
mLocationRequest.setInterval(10000); | |
mLocationRequest.setFastestInterval(10000); | |
mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); | |
} | |
protected void startLocationUpdates(){ | |
LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment