Skip to content

Instantly share code, notes, and snippets.

@blangel
Created November 18, 2013 16:30
Show Gist options
  • Save blangel/7530830 to your computer and use it in GitHub Desktop.
Save blangel/7530830 to your computer and use it in GitHub Desktop.
Setup LocationClient
private static final long UPDATE_INTERVAL_MS = 8000L;
private static final long FASTEST_UPDATE_INTERVAL_MS = 4000L;
...
LocationRequest locationRequest = LocationRequest.create();
locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
locationRequest.setInterval(UPDATE_INTERVAL_MS);
locationRequest.setFastestInterval(FASTEST_UPDATE_INTERVAL_MS);
locationClient.requestLocationUpdates(locationRequest, listener, locationService.getLocationLooper());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment