This code works fine when other geo location applications(facebook, foursquare.. etc)
But with "Google Map" application, It doesn't.(d.android.com explains "PASSIVE_PROVIDER" that can be updated when other application requests locations.)

Even though I can see my location with "Google Map" application, but I can't get any event from passive provider.(I can't see passiveLocationReceiver's log message.)

2 Answers
2

requestLocationUpdates will only receive changes or "updates" to location values. Google Maps will broadcast changes in location values that are provided by the GPS Location provider.

If testing from an Emulator, try entering a new value for your mock location. Otherwise, test while walking around.

However, I have noticed too that Wi-Fi (network) locations changes are not broadcast from Google Maps like they are from other similar apps.

In your case- perhaps the GPS is not enabled, or it hasn't changed location from its current state and therefore you are not receiving any "updates" in location to this listener. (I found this topic because I was wondering why Google Maps was not broadcasting Wi-Fi location changes if anyone figures that out)

Recent Google Map and other map services utilize new version of location APIs based on Google Play Services. They don't merely rely on only GPS or Network Provider, but they use "Fused" one. For this reason, legacy PASSIVE_PROVIDER can't catch location updates with "fused" method.

You'd better to use new APIs with LocationClient and LocationRequest with PRIORITY_NO_POWER. check following codes