[android-developers] Multiple applications with WakeLock vs. one WakeLock app

2012-05-13 Thread William Kelley
I am developing a simple GPS logger that runs as a service, getting fixes in short intervals. As I've read documentation and posts in this forum, I realize I need a WakeLock to keep the service running and logging points. Right now, without a WakeLock, my service runs fine for many hours, even

Re: [android-developers] Multiple applications with WakeLock vs. one WakeLock app

2012-05-13 Thread William Kelley
in the battery use UI so they know who to blame for killing their battery. On Sun, May 13, 2012 at 2:51 PM, William Kelley williamtkel...@gmail.comwrote: I am developing a simple GPS logger that runs as a service, getting fixes in short intervals. As I've read documentation and posts

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

2012-05-11 Thread William Kelley
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

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

2012-05-11 Thread William Kelley
Just a followup: Tasker and AutomateIt both do have Prevent device from sleeping (ie WakeLock) as permissions. -- 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

Re: [android-developers] Re: Long running Android service is getting recreated over and over

2012-05-10 Thread William Kelley
On Wednesday, May 9, 2012 9:40:20 PM UTC-7, Kristopher Micinski wrote: What you're doing isn't draining the battery only because of the service, but also because of the location updates you'll be getting.. GPS fixing is definitely the main battery killer here, but there are smart ways

Re: [android-developers] Re: Long running Android service is getting recreated over and over

2012-05-10 Thread William Kelley
lbendlin and gjs, thanks for the confirmation that users do indeed want long running services sometimes. And that battery life is acceptable when running GPS almost non-stop. On Thursday, May 10, 2012 8:43:11 AM UTC-7, Kristopher Micinski wrote: What are your smart ways? No matter what, the

Re: [android-developers] Re: Long running Android service is getting recreated over and over

2012-05-10 Thread William Kelley
I don't know, I haven't experienced any problems with that yet. I have set my GPS fix interval to as low as 4 seconds and as high as a few minutes (haven't tried anything over that yet) and my device hits those marks just fine. Of course, if I am outside, the fix is usually instantaneous,

[android-developers] Long running Android service is getting recreated over and over

2012-05-09 Thread William Kelley
I have a simple Android Activity with one button to start and stop a long running Android Service (which does some simple logging). As soon as I start the service, I close the app (Activity) and the service should then run in the background indefinitely. But it doesn't. At random times, the

Re: [android-developers] Long running Android service is getting recreated over and over

2012-05-09 Thread William Kelley
So, if I want a long running process (logging GPS points over several hours), I would need to use START_STICKY and then maintain some knowledge of state between service restarts. That is, save state to disk (filename that I am writing to, specifically). And since onDestroy is not called and

Re: [android-developers] Long running Android service is getting recreated over and over

2012-05-09 Thread William Kelley
Thanks. I'm not sure why long running services are frowned upon. As long as they don't overly consume resources and are done with the user's knowledge, and indeed the user *wants* the features of a long running service, then what is the harm? If a user wants to log something for a long time,

[android-developers] Re: Long running Android service is getting recreated over and over

2012-05-09 Thread William Kelley
Thanks for all the insightful comments. Too many to reply to individually so I'll just plow through them without quoting. As to RAM: RAM is a premium and yet when I look at the process running on my phone, the smallest is using 15M, while most of the others are 20M+, some up to 60M+. I don't