【问题标题】:How to Obtain The User Address By Knowing their Longitude and Latitude如何通过知道用户的经纬度来获取用户地址
【发布时间】:2011-08-04 17:46:17
【问题描述】:

我在 android 应用程序中使用 LocationManager 来获取用户当前坐标。它对我来说很好,但第二步我想向用户显示格式化的地址,而不是以 logn 和 lat 格式显示它。 你能帮帮我吗?

【问题讨论】:

    标签: android-location


    【解决方案1】:

    试试这个:

    Geocoder geocoder = new Geocoder(context);
    List<Address> address = geocoder.getFromLocation(Latitude, Longitude, 1);       
    

    【讨论】:

    • 谢谢 Dmitry,但是当我在模拟器中使用它时,它告诉我“服务不可用”。
    • 您必须将模拟器与 Google API 一起使用。创建一个新的 AVD 并选择您使用的相同平台但使用 Google API 并在此模拟器中运行该应用程序。您可以使用Geocoder.isPresent() 检查设备是否具有正确的 API。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-04
    • 2010-09-14
    • 1970-01-01
    • 1970-01-01
    • 2018-01-20
    相关资源
    最近更新 更多