Thanks Android user i used that code and it was work!

On Aug 2, 11:46 am, android user <android.fa...@googlemail.com> wrote:
> Hello David,
> Here is some code
> try {
>                 tag.connect();
>                         if(tag.isConnected() && tag.isWritable()){
>                                 tag.writeNdefMessage(message);
>                                 tag.close();
>                         }
>
>                 } catch (IOException e) {
>                         // TODO Auto-generated catch block
>
>                 } catch (FormatException e) {
>                         // TODO Auto-generated catch block
>
>                 }
> This code works for writing. I also have a problem how to detect a tag
> is lost. Although this code works but it can not stop on catch
> statment and therefore i can not implement a code if the tag is lost.
> john
>
> On Aug 1, 11:47 pm, David P <d.refi...@gmail.com> wrote:
>
> > Hey Nick,
>
> > Could you please provide a code example of how to signal an event when
> > a "tag is lost"? Thanks in advance.
>
> > Best Regards,
> > David
>
> > On Jun 9, 10:18 am, Nick Pelly <npe...@google.com> wrote:
>
> > > As per other responses, you currently need to poll isConnected() on a
> > > connected technology object.
>
> > > This is not ideal, and we are considering an intent or callback in a 
> > > future
> > > API version.
>
> > > Cheers,
> > > Nick
>
> > > On Wed, Jun 1, 2011 at 8: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 noticed from logcat the following log message:  "D/NativeNfcTag( 
> > > > 3625):
> > > > Tag lost, restarting polling loop", when I remove theNFCtag.  Is there
> > > > a programmatic way to catch this event?  I've looked through the API and
> > > > don't anything obvious.  I'm using the Nexus S,  android 2.3.4.
>
> > > > I hope I don't have to implement my own detection/presence polling.
>
> > > > Thanks,
> > > > Dean
>
> > > > --
> > > > 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

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