1

How can we get address or location name from latitude and longitude in android In my application I have set of latitude and longitude, But I need an API which will return me the location name corresponding to the latitude and longitude. thanks.

4

2 回答 2

5

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();
于 2011-01-19T06:41:54.920 回答
0

Gps 将无法在模拟器上运行...您必须在设备上进行测试。

于 2011-08-01T12:54:58.917 回答