I'm working on an app that tracks the user's whereabouts. In order to save battery, I want to implement an idle zone that makes the location manager pull less frequently (or even stop) on the GPS location. Once the user starts moving again (detected by either accelerometer and/or significant movement), the location service will pull on the default interval.
One approach is to define the idle zone as the minDistance
parameter in LocationManager::requestLocationUpdates
, but other users around here suggests that it does not have any impact on the battery drain, and the documentation states that it is difficult for the location manager to save battery using this criteria:
However it is more difficult for location providers to save power using the minDistance parameter, so minTime should be the primary tool to conserving battery life.
Google also suggests using the significant motion sensor for detecting when the user location changes:
At the high level, the significant motion detector is used to reduce the power consumption of location determination. When the localization algorithms detect that the device is static, they can switch to a low power mode, where they rely on significant motion to wake the device up when the user is changing location.
Does this mean the location manager uses the significant motion sensor if it is present by default, or do I need to activate or implement something to make the location service use it?
And what about the accelerometers? A large part of my question lies in whether using the accelerometer to detect when the user starts moving would save any power, as using the accelerometer would be another sensor that would require power and callback handling. Some accelerometer sensors are listed as low-powered by Google, while some are not (including the significant movement sensor).
Would it be possible to save any battery power by putting the GPS to sleep and then use sensors to detect user movement which would wake up the GPS again?