Yes, but it's *much* less likely that a foregrounded service can be
killed.  Essentially, with a foreground service you sit at the back of
the queue, not the front.  Ultimately, there's nothing you can do to
prevent your app being killed, and running everlasting services is an
Android antipattern.  (That is, of course, unless you've built your
app into the firmware, in which case you can coerce the scheduler.)

Kris

On Tue, Apr 23, 2013 at 9:41 AM, Johan Appelgren
<[email protected]> wrote:
> Even if you have a foregrounded service the process might get killed, and
> restarted if the service is configured for it. An example of this is the
> music app on my Galaxy Nexus, it gets killed every now and then if I listen
> to music and use Flipboard or Chrome beta, memory intensive apps.
>
>
> On Tuesday, April 23, 2013 2:48:33 PM UTC+2, Kristopher Micinski wrote:
>>
>> All Android apps have this behavior: eventually they get kicked out of
>> memory when the user hasn't used them in a while.  This is completely
>> normal: you aren't *supposed* to have a program that "lasts forever".
>> If you want this, you should have a foregrounded service.
>>
>> Kris
>>
>> On Tue, Apr 23, 2013 at 7:22 AM, Turim <[email protected]> wrote:
>> > I am developing a simple GPS tracker. But i have a problem. When starts
>> > the
>> > Service, i create a Thread that get de localization, time after time.
>> > The
>> > problem is after long time (about hours), the Thread is stoped. I dont
>> > know
>> > why.
>> >
>> >
>> > How do i create a service/thread long time. I need that thread never
>> > stopped, or the service be recreated.
>> >
>> > Anybody help me ?
>> >
>> >
>> > Thanks.
>> >
>> > --
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "Android Developers" group.
>> > To post to this group, send email to [email protected]
>> > To unsubscribe from this group, send email to
>> > [email protected]
>> > For more options, visit this group at
>> > http://groups.google.com/group/android-developers?hl=en
>> > ---
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "Android Developers" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an
>> > email to [email protected].
>> > For more options, visit https://groups.google.com/groups/opt_out.
>> >
>> >
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to