[android-developers] Re: Service stops after 10 minutes of standby

2011-03-22 Thread Doug
Android may be killing your Service in order to run something else. Try using setForeground() on the service so that it retains priority in the face of pressure from other apps. Doug On Monday, March 21, 2011 1:56:52 AM UTC-7, stefan jakober wrote: > > Hey there, > > I've got a wired problem

[android-developers] Re: Service stops after 10 minutes of standby

2011-03-22 Thread Roger Podacter
Wouldn't a wakelock be bad for battery life? It's my understanding that a wake lock keeps the phone from entering into deep sleep power saving state. I know there are other apps with services that had to overcome this exact issue of stopping after 10min of screen off time. I just don't recall what

[android-developers] Re: Service stops after 10 minutes of standby

2011-03-22 Thread lbendlin
WakeLocks are evil. Are you sure the service is actually stopping or maybe (based on your criteria) it just doesn't have a new position to tell about? On Mar 21, 11:30 pm, Chris Stewart wrote: > As Nick mentioned, you'll want to look into a wake lock.  I would highly > recommend Mark's implementa

Re: [android-developers] Re: Service stops after 10 minutes of standby

2011-03-21 Thread Chris Stewart
As Nick mentioned, you'll want to look into a wake lock. I would highly recommend Mark's implementation with WakefulIntentService ( https://github.com/commonsguy/cwac-wakeful). I'm using it in my app with no issues at all. -- Chris Stewart http://chriswstewart.com On Mon, Mar 21, 2011 at 11:1

[android-developers] Re: Service stops after 10 minutes of standby

2011-03-21 Thread Roger Podacter
I think there is something extra that needs to be added to keep your service running in deep sleep standby. Cause my service also stops running on my nexus one once the phone goes into deep sleep. My service actually takes 2 second sample readings of battery current so it would be nice to see stand

[android-developers] Re: Service stops after 10 minutes of standby

2011-03-21 Thread Nick Kulikaev
Hi, You probably need to obtain a wake lock to keep your service running if you want to stick to the design you've already made, but i guess what you are trying to do could be also done with alarm manager which can wake you up whenever you want. This can save you some battery. Nick On Mar 21, 1: