Skip to content

Instantly share code, notes, and snippets.

@ayushhgoyal
Created May 6, 2013 11:48
Show Gist options
  • Save ayushhgoyal/5524690 to your computer and use it in GitHub Desktop.
Save ayushhgoyal/5524690 to your computer and use it in GitHub Desktop.
This snippet can be used to get address(approx) from a location's latitude and longitudes.
Geocoder geocoder;
List<Address> addresses;
geocoder = new Geocoder(this, Locale.getDefault());
String address = "";
try {
addresses = geocoder.getFromLocation(latitude,
longitude, 1);
address = addresses.get(0).getAddressLine(0);
Log.e("address", address);
} catch (IOException e) {
// TODO Auto-generated catch block
// e.printStackTrace();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment