问题
I need to get current location in China but current location manager is not working in china.Its not showing latitude and longitude. Please tell me how can I get this? Many Thanks
回答1:
Fact 1: All Google services are blocked in China.
Fact 2: Although it gives a feeling that AOSP is nothing to do with Google, it's really not.
The truth is that once you used NETWORK_PROVIDER to get a location, a message was send to Google location server to check out the location, and returned the location back to you. For the reason every Chinese knows about, you can't access the server, that's why when you combine NETWORK_PROVIDER and GPS_PROVIDER together, debug codes in a room, nothing get returned(GPS is not accessible in a room).
Solution:
Use android ROM modified by Chinese company like XIAOMI, MEIZU etc. These ROMs modify the framework and redirect the NETWORK_PROVIDER message to other servers.
Use some third-party location service like BAIDU location SDK.
来源:https://stackoverflow.com/questions/27244724/android-get-current-location-in-china