Question

If power is not an issue, what is the best method to track geofence events on an android device (specifically a Nexus 7). Geofence api, or active polling

The tablet is permanently fixed in a vehicle and always powered. So power saving is not a concern.

Is there any downsides to using the Geofence api? It seems to be designed to conserve power. Perhaps it is not as accurate? Would our app be more responsive to a geofence crossing if we were actively polling instead?

The position data available to the device is cell tower and GPS. No wifi.

Was it helpful?

Solution

Google Play Services Geofence API is as accurate as current known location. If battery power isn't an issue, then you can use a service in your app to keep GPS on for the whole time. In this way you don't have to implement your code which will detect enter, exit, dwell events.

However the Geofence API is limited to 100 geofences per app. If the limit is an issue then probably it is easier to not use Google Play Services and implement your code to detect geofences events. The code should be trivial having accurate GPS location all the time.

The main problem Google Play Services Geofence implementation tries to solve is battery usage.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top