I'm developing an android app which collect GPS sensor data in time intervals programatically (one per 5min). So it drains the battery badly. Is there any way to optimize the power consumption? Is there a way to disable or sleep GPS sensor when it is not reading? All those should be progrmmatically. There is no way to turn on/off GPS sensor programmaticaly.
Asked
Active
Viewed 86 times
1 Answers
0
In the requestLocationUpdates function, there's a frequency. Set it to 5 minutes. THat's the easiest way.
If you want even lower battery use- instead of requestLocationUpdates, use requestSingleUpdate on a timer. This will use less battery power by turning on GPS every 5 minutes, but it will take some time to get a signal lock again so it won't be exactly every 5 minutes.

Gabe Sechan
- 90,003
- 9
- 87
- 127
-
My frequency is vary time to time programmatically. So its not fixed. Time accuracy is also important. I heard that GPS have sleep state. Not phone sleep state. In startup i want to on GPS. Then read GPS according to my frequency. While reading, i want to put GPS to slpeep state after get reading and so on. In sleeping state GPS is not active. Save the power. Can i do this??? is GPS sleeping mode is available?? – lakshitha madusanka Jul 06 '16 at 06:05