Skip to content

Instantly share code, notes, and snippets.

@ariefbayu
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ariefbayu/12c8bef435dd5b14e94c to your computer and use it in GitHub Desktop.
Save ariefbayu/12c8bef435dd5b14e94c to your computer and use it in GitHub Desktop.
SmartLocation to account Genymotion or other devices without google play services installed
SmartLocation.with(getApplicationContext()).location()
.oneFix()
.config(LocationParams.NAVIGATION)
.provider(new LocationGooglePlayServicesWithFallbackProvider(getApplicationContext()))
.start(new OnLocationUpdatedListener() {
@Override
public void onLocationUpdated(Location location) {
latitude = location.getLatitude();
longitude = location.getLongitude();
loadMapImage(getApplicationContext(),
location.getLatitude(),
location.getLongitude());
}
});
@ariefbayu
Copy link
Author

The actual trick is the following lines:

.config(LocationParams.NAVIGATION)
.provider(new LocationGooglePlayServicesWithFallbackProvider(getApplicationContext()))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment