Friday, June 3, 2011

[android-developers] Re: Detect a NFC tag removal

I'm building a custom tag which will use NFC for communications. It
will support a large
command set, and in the app there will be different buttons, one for
each command. I would
like to be able to disable the buttons when the tag is removed from
the phone and re-enable
when the tag is brought back into the phone's influence.

I didn't read the isConnected close enough. Seems this will work but
will still require
my app to check it multiple times a second to enable/disable the
buttons. One step
better than my app having to send full commands over NFC to poll.

Thanks,
Dean


On Jun 3, 2:28 am, Nikolay Elenkov <nikolay.elen...@gmail.com> wrote:
> On Thu, Jun 2, 2011 at 12:47 PM, Dean Brotzel <dean.brot...@gmail.com> wrote:
> > Is it possible to receive a message/intent from Android for when a tag is
> > removed from the smart phone's influence (much like when a tag is brought
> > into to the smart phone's influence) ?
>
> I don't think so.
>
> > I hope I don't have to implement my own detection/presence polling.
>
> Why do you have to poll? You can use e.g., NfcA.isConnected() to
> check if the tag is still there, and cancel whatever you were about
> to do. You'll get an intent if/when it is connected again.

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