Tuesday, July 27, 2010

Re: [android-developers] Questions/Help with Long Running Service Please

On Tue, Jul 27, 2010 at 1:31 PM, Tommy <droidap@gmail.com> wrote:
Does anyone have any idea as to why this might be stopping at some point?

A service can be killed at any point by the system to conserve memory. 
 
Are there any tips on creating long running services like this or am I doing anything wrong in my process?

You can help keep your service alive longer by making it foreground and showing a notification, but even that is not bullet proof. Always assume your service will be killed at any point - because it can and probably will, eventually.

That being said, if you set an alarm to re-trigger the Service on each start, it should keep going, theoretically. I don't suppose you're turning your phone off? Because all alarms are lost if you do.

-------------------------------------------------------------------------------------------------
TreKing - Chicago transit tracking app for Android-powered devices

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

No comments:

Post a Comment