如何从Android上的给定地址获取经度和经度?

Jyo*_*sna 1 android google-maps

我想获得特定地址的纬度和经度.我怎样才能做到这一点 ?

Muh*_*han 8

这是您问题的示例解决方案.

要么

List<Address> foundGeocode = null;
/* find the addresses  by using getFromLocationName() method with the given address*/
foundGeocode = new Geocoder(this).getFromLocationName("address here", 1);
foundGeocode.get(0).getLatitude(); //getting latitude
foundGeocode.get(0).getLongitude();//getting longitude
Run Code Online (Sandbox Code Playgroud)

有关详细信息Geocoder