Saving power with location services by detecting user movement using sensors
Asked Answered
O

1

7

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?

Oedipus answered 16/7, 2015 at 13:44 Comment(5)
Hey Martin, have you find any solution to resolve power saving with location update...Nietzsche
Nope. I have not been working on this after the research I've done for this post. I've sent out a few emails to some people but it seems everyone is on vacation these days. I will publish an answer when/if I come to an conclusion. Thanks for the follow up!Oedipus
Ya, seems everyone is on vacation for this particular topic ;) ;)Nietzsche
@Oedipus - Any updates on this?Piggish
Is it possible to detect motion in other way (and wakeup from sleep) ? I have mediatek device which has no "significant motion" sensor (according to sensors detect apk), yet, it has built in feature which turn on screen on movement. How can it be ?Serriform
I
1

The LocationManager::requestLocationUpdates uses the significant motion sensor by using the high level method setSmallestDisplacement() Example:

mLocationRequest = new LocationRequest();
mLocationRequest.setInterval(20*1000);
mLocationRequest.setFastestInterval(10*1000);
mLocationRequest.setSmallestDisplacement(10F); //meters
Isochronism answered 15/3, 2016 at 10:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.