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
-
Code please? Any error? If yes, any logcat? – Blaze Tama Dec 02 '14 at 08:22
-
2Possible duplicate : http://stackoverflow.com/questions/10038282/android-can-get-location-with-locationmanager-with-samsung-galaxy-s2-in-30-seco – mithrop Dec 02 '14 at 08:23
-
You are welcome to post some code, logs, any more... I have no information about malfunction LocationManager in China. – busylee Dec 02 '14 at 08:36
-
@mithrop I'm not able to get anycode. Thanks for your reply. – Robin Royal Dec 02 '14 at 09:12
-
@mithrop thank you but its not duplicate. – Robin Royal Dec 02 '14 at 09:17
1 Answers
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.
-
-
-
@reavenisadesk: So basically i can still make use of Google location services in China if they are using custom ROM's like Xiaomi? – Zax Jul 03 '17 at 03:22
-
Instead of Google Location Services API can't we make use of android.location API( https://developer.android.com/reference/android/location/package-summary.html) though google recommends Google location services over android.location API. – Sulav Timsina Aug 09 '19 at 16:58