怎么根据获得的经纬度,获得所在城市的名称?? 下了高德的地图API 但是返回的太细了,细化到具体街道有什么办法根据获得的经纬度 返回所在城市的名称? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 人家的API就不知道了,你可以用google api来实现这个功能。http://www.eoeandroid.com/thread-18770-1-1.html 自己多搜下唉~这是网上的~List<Address> addList = null; Geocoder ge = new Geocoder(this); try { addList = ge.getFromLocation(26.0972567, 119.3090049, 1); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } if(addList!=null && addList.size()>0){ for(int i=0; i<addList.size(); i++){ Address ad = addList.get(i); latLongString += "\n"; latLongString += ad.getCountryName() + ";" + ad.getLocality(); } } myLocationText.setText("您当前的位置是:\n" +latLongString); 知道怎么处理了 呵呵 楼上的不行getLocality()返回的是空值哦debug查看Adress里的数据,就能找到想要的位置信息了,散分~ android如何读取大的txt文本 图片重叠显示问题 Help!!! 回声消除 ndk中.c和.cpp文件一起编译 ui设计,小问题? andriod和服务器间的josn交互 通过这个方法返回一个Cursor,Cursor关闭后我怎么才能关闭查询出这个Cursor的db呢 android sdk安装目录问题 android 卸载残留文件怎么获取??? 一台Android设备怎样控制另一台Android设备 求指点 webview 网络问题个性化提示 Surface PostBuffer 没看到图像是什么原因?
http://www.eoeandroid.com/thread-18770-1-1.html
List<Address> addList = null;
Geocoder ge = new Geocoder(this);
try {
addList = ge.getFromLocation(26.0972567, 119.3090049, 1);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if(addList!=null && addList.size()>0){
for(int i=0; i<addList.size(); i++){
Address ad = addList.get(i);
latLongString += "\n";
latLongString += ad.getCountryName() + ";" + ad.getLocality();
}
}
myLocationText.setText("您当前的位置是:\n" +latLongString);
getLocality()返回的是空值哦debug查看Adress里的数据,就能找到想要的位置信息了,散分~