Skip to content

Instantly share code, notes, and snippets.

@kylecorry31
Last active August 29, 2015 14:22
Show Gist options
  • Save kylecorry31/c8c7cc5d9298ddf7e7cd to your computer and use it in GitHub Desktop.
Save kylecorry31/c8c7cc5d9298ddf7e7cd to your computer and use it in GitHub Desktop.
Location with Google Play Services for Android.
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