Third party apps can not use android:persistent.

Service.startForeground() is the formal way to say you can not be killed.
 This means the user must be aware that you are running (currently by
posting a notification) so they can manage what is going on.

For the vast majority of NFC uses though I wouldn't think this is necessary
-- if your service is going to run for a minute or so there should be no
need to do this, except that it would force the system to keep your process
around when getting very low on memory even if it normally wouldn't want to.

On Wed, May 11, 2011 at 8:23 PM, perumal316 <perumal...@gmail.com> wrote:

> I am communicating with a NFC tag and sending commands to the tag. But
> the service gets cutoff and I could not complete the sending of
> commands. Increasing the timeout doesn't help too.
>
> That's why need looking for a way to continuously run the NFC service.
>
> On May 12, 11:12 am, dnkoutso <dnkou...@gmail.com> wrote:
> > startForeground() basically helps you achieve keeping your service
> running
> > as long as possible. However, the cost of doing this is that you must
> > provide an ongoing notification so the user is aware that something is
> > constantly running.
> >
> > What is it you are trying to achieve and you want the NFC service to run
> > continuously?
>
> --
> 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
>



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