Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do I need to request location updates when using Fused location Geofences?

I have successfully implemented location geofencing using the Android Developers documentation.

The problem I am having is that the geofence events are not always reliable. Sometimes they trigger as soon as I'm at the location, sometimes they take a few minutes (even with a large radius value), sometimes they don't fire at all.

I have also noticed that even though I have enabled GPS, the app is not using the GPS sensor to get my location.

Is this because without requesting updates the Fused Location provider is in a "passive" mode and relying on other apps' requests? Do I need to implement location requests as well as geofencing?

like image 948
Nick Avatar asked Jan 12 '14 17:01

Nick


1 Answers

Not sure if it answers your question completely, but I am working on app that implements geofencing and also location requests and these are my observations:

When app is active and I am receiving location updates (the location is known), geofencing behaves accurately - I get Intents almost instantly.

When app is inactive, I observe same behaviour - sometimes Intents are instant, sometimes it takes a while and sometimes it takes just too long. Of course, when there is some other app, f.e. Google Maps, requesting location, Intents are again, almost instant. But when there is no need for acurate location, it usually takes a while. Total nightmare are people with wifi/mobile data turned off and moving between buildings. Because inside, there is no GPS, and they spend outside so little time, that the phone usually does not wake up...

So, I would say this is actually expected behaviour. (Otherwise battery life would be horrible)

like image 79
daemontus Avatar answered Oct 17 '22 08:10

daemontus