android 通过地址获取经纬度
16lz
2021-01-23
这是通过google原生接口获取的经纬度
public static Address getGeoPointBystr(Context context,String str) { Address address_temp = null; if (str != null) { Geocoder gc = new Geocoder(context, Locale.CHINA); List addressList = null; try { addressList = gc.getFromLocationName(str, 1); if (!addressList.isEmpty()) { address_temp = addressList.get(0); double Latitude = address_temp.getLatitude(); double Longitude = address_temp.getLongitude(); Log.d("zxc003",str+" Latitude = "+Latitude+" Longitude = "+Longitude); } } catch (IOException e) { e.printStackTrace(); } } return address_temp;}
更多相关文章
- [置顶] Android 使用Hprose 调用Https接口
- JNI之------C调用java接口
- 【Android】Web开发之通过Apache接口处理Http请求
- Android简单获取经纬度的方法
- Android获取手机经纬度(GPS、NetWork)封装工具类
- android 经纬度 double类型 转换成 度分秒
- 【Android】简单的接口回调
- 【APP】微信接口对Android与IOS验证方式的差异