Search code examples
androidgeolocationlocationgeofencingandroid-geofence

will geofence reduce power consumption vs just checking location every x seconds?


i'm creating a location tracking app to let users plot a heat map of where they traveled throughout the day. this involves constantly gps querying the user's location, a battery-intensive operation. one way i thought to reduce the app's power consumption is to set up a geofence after a few location updates return roughly the same value, and shutting down the location updates until the user exits the geofence (signifying that they are once again on the move).

this will allow my app to only perform frequent GPS queries when the user is actually moving (triggered by them exiting a geofence).

however, i'm not quite sure if this will reduce power consumption, because if the geofence is triggered by constantly querying the user's location to see if they have moved outside the fence, it will have basically the same effect on the battery.

so my question is, how does the geofence know when the user has left/entered the area? is it based on simple periodic location queries? or is there some more clever mechanism involved? thanks!

link to current version of app: https://play.google.com/store/apps/details?id=com.russ.locationalarm&hl=en


Solution

  • The way Android is handling geofencing is quite complex. There are many differences between devices, but also between Android versions. But as a quick answer, your solution could save battery, because detecting a zone exit don't necessarily require GPS, but could use other location methods like Cell ID or Wifi, which are much less battery consuming. You also need to know that geofencing is not a 100% reliability solution, in particularly on Zone Exit events (less than 50% of zone exits detected in average), that are less reliable than Zone Enter events. Some companies like Herow, Radar, Foursquare are building SDKs that manage specifically geofencing.