0

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

Robin Royal
  • 1,788
  • 1
  • 18
  • 29

1 Answers1

2

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:

  1. 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.

  2. Use some third-party location service like BAIDU location SDK.

  • so google play services location manager will not work in China? – MobileMon Jun 04 '16 at 21:27
  • @MobileMon gps works fine but network does not work well. –  Jun 05 '16 at 04:15
  • @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