Skip to content

Instantly share code, notes, and snippets.

@sivakumarbdu
Created December 13, 2012 11:31
Show Gist options
  • Save sivakumarbdu/4275862 to your computer and use it in GitHub Desktop.
Save sivakumarbdu/4275862 to your computer and use it in GitHub Desktop.
Get current location - Android
public Location getCurrentLocation() {
locManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
locManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0,
this);
Location location = locManager
.getLastKnownLocation(LocationManager.GPS_PROVIDER);
return location;
}
@hy9be
Copy link

hy9be commented Mar 21, 2016

Does it have battery consuming issue?

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