Last active
August 29, 2015 14:22
-
-
Save ariefbayu/12c8bef435dd5b14e94c to your computer and use it in GitHub Desktop.
SmartLocation to account Genymotion or other devices without google play services installed
This file contains hidden or 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
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()); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The actual trick is the following lines: