Friday, May 11, 2012

Re: [android-developers] When using LocationManager.requestLocationUpdates, do I need a WakeLock?



On Friday, May 11, 2012 4:57:35 AM UTC-7, ste1024 wrote:
 
Sorry for digging up this ancient topic, but an trying to find an answer to the same question.
In my app so I am able to receive location updates even if I put the device to sleep, without explicitly holding a WakeLock.
I came across what appears to be the Android 2.2 source of the GpsLocationProvider, and assuming I did not misinterpret the code, it looks like it is really able to wake up the device via the AlarmManager.

Can anyone confirm this?

I am experiencing the same thing. My GPS app runs for hours and hours getting coordinates every 6 seconds, whether it's asleep or not. Either WakeLock is not needed for the LocationManager to work non-stop or one of the other apps I have installed is using WakeLock. I'm assuming the latter, since I have Tasker and AutomateIt running, both off which are time-based services. I guess I should check their permissions for WakeLock. Or they could just be waking the CPU via the AlarmManager?

It makes me wonder if it's necessary for me to add a WakeLock to my app or just rely on the fact that other apps will keep the CPU alive for me.

--
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


Real Estate