cordova-plugin-geofence icon indicating copy to clipboard operation
cordova-plugin-geofence copied to clipboard

Improve accuracy and response time of geofencing

Open bontorhumala opened this issue 10 years ago • 5 comments
trafficstars

Great library man. However, relying in pure android geofencing seems inaccurate for radius less than 1000m (http://stackoverflow.com/questions/23708655/how-to-make-geo-fencing-alert-more-accurate-in-android).

In order to improve the accuracy and response time, I think the plugin can benefit from using hardware GPS reading as suggested on stackoverflow discussion above. I tested by creating other app - which is just an app containing a button to read GPS position. Before I pushed the button on this other app, the notification when I exit a geofence is not displayed. But after I activated the button and got reading, the plugin works and send notification.

bontorhumala avatar Jan 07 '15 07:01 bontorhumala

This is an interesting idea but I am worry that will rapidly increase battery drain. The plugin intention is to keep battery drain as lowest as possible, that is why it's using standard API.

tsubik avatar Mar 11 '15 15:03 tsubik

I have noticed it responds faster if I do a quick get current location poll after the geofences are activate. Maybe it could be a variable that if the developer wants to allow possibly more accurate readings at the cost of battery they could set some options like, allowGPSPolling with another option of GPSPollingInterval (Defaults to 10 minutes or something).

timwright35 avatar Jan 25 '16 23:01 timwright35

Yes, I found an article about that http://blog.lemberg.co.uk/fused-location-provider. We could try to do that in that way. I need to think about this a little more. Maybe initialize function should take some options object.

tsubik avatar Jan 26 '16 11:01 tsubik

Have anybody tried this? and willing to show how this can be done? it seems this repo is inactive :/

adamalexander avatar Aug 21 '19 05:08 adamalexander

Since the repo is dead. I'm just going to share what did to overcome this, for anybody who may be faced with this problem.

I used this background geolocation polling plugin. and enabled start on boot and turned off stop on app terminate. The data generated when the GPS is activated in this plugin will be utilized by Google Play Services for the Geofence API in the background. Be conservative, because battery life will be an issue if not handled well.

https://github.com/mauron85/cordova-plugin-background-geolocation

adamalexander avatar Aug 23 '19 05:08 adamalexander