Why do you want to use startForeground()?  What is it giving you?  If you
want your code to run in the background, it is probably not what you want.

On Mon, Apr 12, 2010 at 2:04 PM, Mariano Kamp <mariano.k...@gmail.com>wrote:

> 1) CPU is not a problem per se. My process can happily be starved of CPU,
> but as it needs to do xml parsing it does task the CPU albeit at it's lowest
> prio.
> 2) As I said I rely on an external API that doesn't understand incremental
> updates.
>
> Anyway, I think there is no good solution and the usefulness of this thread
> is nearing zero now, so I will stop before I waste anymore of everybody's
> time. Thanks so far.
>
>
> On Mon, Apr 12, 2010 at 10:58 PM, Mark Murphy <mmur...@commonsware.com>wrote:
>
>> Mariano Kamp wrote:
>> >
>> >     Quoting myself:
>> >
>> > And you have done so wonderfully.
>> >
>> > What is it your trying to say though?
>> >
>> > That it is ok to raise the priority when I don't want my process to be
>> > killed.
>>
>> I'm saying what Ms. Hackborn confirmed in her reply to my post --
>> startForeground() elevates the service's process to the foreground
>> priority class. The not-too-unreasonable assumption the SDK makes is
>> that something that is supposed to be in the foreground is supposed to
>> be in the foreground. I mean, "foreground" is in the method's name.
>> There's no question the documentation could be stronger, though.
>>
>> That being said, your choices are:
>>
>> 1. Continue using startForeground() and either live with the complaints
>> or modify your service to be less CPU-intensive, or
>>
>> 2. Stop using startForeground() and modify your architecture to better
>> support the service being shut down
>>
>> Since Android applications have to support their services being shut
>> down (via task killers, the Services screen in Settings, etc.), I would
>> think #2 would be the better answer, but that's your call.
>>
>> --
>> Mark Murphy (a Commons Guy)
>> http://commonsware.com | http://twitter.com/commonsguy
>>
>> Android Training in NYC: 4-6 June 2010: http://guruloft.com
>>
>> --
>> 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+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>>
>> To unsubscribe, reply using "remove me" as the subject.
>>
>
>  --
> 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+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to