Thursday, June 23, 2011

[android-developers] Re: NFC P2P pattern: Receive first, via NPP, and respond after also via NPP

hi Cruz:

> I've successfully established a LLCP connection between a SCL3711 desktop
> reader (using nfcpy) and a Nexus S. I've also implemented NPP client and
> server support so I can send NDEF messages from the desktop and receive them
> on the Android, and vice-versa.

Now i'm trying the same work like yours.I want to communication
between my desktop
reader and my Nexus S via the p2p.So could you help me some documents
or some codes
about the nfcpy.

> But I am struggling with the Android NFC API to accomplish something as
> simple as receiving a NPP message first, and then sending a response also
> via NPP. This is because the enableForegroundNdefPush() call has to be
> executed on the onResume() method and the NdefPushClient only sends the
> message if it is available as soon as the LLCP channel is established.
>
> In my use case the phone would be put next to my reader, which would trigger
> the establishment of a LLCP channel, and the reader would push an NDEF
> message. My application is launched, it is the only one that catches that
> specific intent, and produce a NDEF response based on the NDEF received and
> would push it to the reader via enableForegroundNdefPush(). But by now the
> LLCP channel is established, so the message does not get sent, and my
> application is processing the onNewIntent() method so I can't
> use enableForegroundNdefPush().
>
> Am I doing something wrong? Surely this simple use case must be possible to
> implement.
>
> Thanks,
> André
In your user case,Your Nexus S phone tap the desktop reader,the
desktop reader
send a NDEF message to the phone via the p2p,am i think right?In my
activity,i have
add a ndef filter,after i got the action of
NfcAdapter.ACTION_NDEF_DISCOVERED,then
Parcelable[] msgs =
intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES);
My code like this ,it can be possible to implement?

Thanks for any help.
tommy

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