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

标签 android google-maps

我想获取特定地址的纬度和经度。我该怎么做?

最佳答案

这是样本 solution对你的问题。

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

更多详情Geocoder

关于android - 如何从Android上的给定地址获取纬度和经度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6466369/

相关文章:

android - 是否无法使用来自 Facebook 的搜索查询/关键字检索帖子?

android - WindowManager.LayoutParams 构造函数参数的顺序和含义是什么?

android - Google Map Android API mapTypeControl map 选项

mysql - 从 MySQL 几何列中检索坐标

php - 如何在实时服务器中执行 json 解码?

javascript - Phonegap Android Webview 视频只播放音频

如果在所需的 Activity 中,Android 会阻止通知

JavaScript 不适用于 ICS

javascript - 根据距离显示/隐藏标记(使用 JQuery slider )

android map 应用程序在模拟器上工作但不在设备上