Created
May 6, 2013 11:48
-
-
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.
This file contains 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
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