[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 cstewart...@gmail.com wrote: As Nick mentioned, you'll want to look into a wake lock.  I would highly

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

[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

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

[android-developers] Re: Service stops works after 30 minutes when Android is turned off (trickles every 30 minutes for 5 minutes)

2010-05-19 Thread spachner
Hi, I found a solution by myself. At least the HTC Hero and HTC Tattoo has an option Settings/Wireless controls/Mobile networks/Enable always-on mobile which allows to disable this power feature. Unfortunately the HTC Magic does not have this option. regards spachner -- You received this

[android-developers] Re: Service stops?

2009-10-25 Thread Jason B.
I agree. If you are starting the service by binding to it with the activity, once the activity goes away the bind will go away and the OS will think there is no reason to keep the service up. If the service was started using a pending intent from the activity, the service then is started by the

[android-developers] Re: Service stops?

2009-10-24 Thread Mark Murphy
Christine wrote: I have a service that is waiting for input from an Activity. I noticed that if the service has a task scheduled via a handler, an Activity can bind and unbind repeatedly to make the service do stuff. What is a task scheduled via a handler? An activity binds to the service

[android-developers] Re: Service stops?

2009-10-24 Thread Christine
On Oct 24, 6:13 pm, Mark Murphy mmur...@commonsware.com wrote: What is a task scheduled via a handler? new Handler().postDelayed(someTask, someTime); An activity binds to the service and makes it work, but after unbind it can't bind again. Why unbind before the activity is going

[android-developers] Re: Service stops?

2009-10-24 Thread Mark Murphy
Christine wrote: What is a task scheduled via a handler? new Handler().postDelayed(someTask, someTime); I have not used Handler inside a Service, and so I have no idea whether or not that's a good idea. Why aren't you scheduling this in the Activity, and just calling to the Service when the

[android-developers] Re: Service stops?

2009-10-24 Thread Dianne Hackborn
On Sat, Oct 24, 2009 at 9:47 AM, Mark Murphy mmur...@commonsware.comwrote: new Handler().postDelayed(someTask, someTime); I have not used Handler inside a Service, and so I have no idea whether or not that's a good idea. Handler and the related message loop APIs are much much lower-level

[android-developers] Re: Service stops?

2009-10-24 Thread Christine
On Oct 24, 6:47 pm, Mark Murphy mmur...@commonsware.com wrote: Why aren't you scheduling this in the Activity, and just calling to the Service when the time has elapsed? If the answer is I want it to fire even if the Activity is gone, AlarmManager may be a better choice. Actually, the

[android-developers] Re: Service stops?

2009-10-24 Thread Christine
On Oct 24, 7:52 pm, Dianne Hackborn hack...@android.com wrote: From what I have heard so far, my suspicion is that whatever the original code is, it is really not using these things correctly at all. If you mean that I shouldn't rely on side effects, you're totally right. I'm now looking for

[android-developers] Re: Service stops?

2009-10-24 Thread Dianne Hackborn
For that kind of thing there should be no need to use bindService at all -- just call startService() for each of the things to download, and have the service use stopSelf(id) so that it is stopped once the last one is done. And there is no reason to delay stopping the service -- starting a

[android-developers] Re: Service stops running in standby mode

2009-05-27 Thread aaaa
The problem here is, imho, that cell location changes cannot be detected with a broadcast receiver, but instead we have to use a listener. A broadcast receiver would just be activated/started when the cell location has changed. The listener though has to run all the time to be able to listen. As

[android-developers] Re: Service stops running in standby mode

2009-05-25 Thread Mark Murphy
wrote: I'm trying to log the phone's cell movement. So I created a PhoneStateListener that is being called when the CellLocation has been changed. Then it informs a logging service to write that new cell information to a log file. This works as long as the screen is on. But when the

[android-developers] Re: service stops when phone goes idle

2009-01-02 Thread mnj
Hi, The issue got resolved after PARTIAL_WAKE_LOCK is acquired. Regards, Manoj On Jan 2, 1:32 pm, mnj manojgopa...@gmail.com wrote: Hi, I need to run a service at periodic intervals even after phones goes idle (i.e CPU turn off). For this I'm scheduling an alarm using Alarm Manager using