android reverse geocoding not working on huawei device

那年仲夏 提交于 2020-08-05 09:36:08

问题


I am trying to reverse Geocode lat,long by this piece of code

Geocoder geocoder = new Geocoder(context, Locale.ENGLISH);
try {
    List<Address> addresses = geocoder.getFromLocation(latitude, longitude, 1);
            return addresses;
    } catch (IOException e) {
            Log.e("Error : Geocoder", "Impossible to connect to Geocoder", e);
    }

Its working on all devices except Huawei.It is giving exception in Huawei device. Client reported on his huawei device, Huawei Y625 running on kitkat. I tested it on huawei H30 running kitkat and its not working also. However running on all other devices tested inc Samsung, Nexus etc.

Any help would be appreciated.


回答1:


There is a problem with some android devices and the geocoder not working:

https://code.google.com/p/android/issues/detail?id=38009

A reboot seems to fix the issue.




回答2:


Most of the Huawei mobiles will not support GMS Map Services it will support HMS Map Services only .




回答3:


You should use HMS Site Kit's geocode function. You can find details on here:

HMS Site Kit Geocode



来源:https://stackoverflow.com/questions/38182203/android-reverse-geocoding-not-working-on-huawei-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!