[android-developers] why am I receiving location updates without WakeLock if the device is put to sleep?
In developing an app that needs to get periodic location fixes, I ran across several issues that are unclear to me.
The application currently does not use any WakeLocks.
Yet even if the device is put to sleep (e.g. via pressing the power button), I seem to be able to get location fixes.
I have built a counter into the app that increments on each location fix.
I reset the counter, press the power button power to put the device to sleep, move it to a differen location and let it sit there for several minutes.
After several minutes I come back, wake up the device and check the counter. And it often is not zero, but shows that multiple location updates were received while it was supposed to be "sleeping".
Location provider is network, update distance and interval are 1 meter / 1 minute.
The device (HTC Desire HD with Android 2.3.5) has no SIM card. WiFi is enabled and the device is _not_ connected via USB
(USB debugging is enabled, though).
So my first question is: why does this happen without a WakeLocks being held?
Also on the topic of WakeLocks, assuming the first issue has been cleared up and I really have to use WakeLocks:
Can I have something that periodically wakes up the CPU to get a new location fix, keeps the device awake while we try to get the fix
(or until a max. timeout has been reached), then goes back to sleep, then wakes up later, gets the next fix, sleeps, etc.?
Or do I have to hold the WakeLocks all time (which I can imagine has adverse effects on battery life)?
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home