android location finder from latitude and longitude
How can we get address or location name from latitude and longitude in android In my application I have s开发者_StackOverflowet of latitude and longitude, But I need an API which will return me the location name corresponding to the latitude and longitude. thanks.
Through Geocoder we can get the location name according to lattitude and longitude
List<Address> addresses = new Geocoder(<CurrentActivityName>.this,Locale.getDefault()).getFromLocation(cur_lat, cur_lon, 1);
Address addr= addresses.get(0);
String Country=addr.getCountryName();
String State=addr.getSubAdminArea();
String City=addr.getLocality();
Gps will not work on emulator... u have to test this on device.
精彩评论