Hallo Tommy, > 1. i send the ndef data by the enableForegroundNdefPush(this, > mMessage)function in onResume,but how can i known that the mMessage is > send over,can i got the notification or Intent?
You don't. Even if another device's NPP server picks up the NDEF message from the NPP client, The NDEF push protocol provides no means of acknowledgement that the message was actually received and processed. > 2. As i know,in p2p module there have two parts,the initiator > and the target.I think int the question one activity called > enableForegroundNdefPush(this, mMessage) , it's initiator ,am is think > right? No. The NPP happens on a higher layer of abstraction than the NFC-DEP. (The NFC-DEP is the NFC peer-to-peer data exchange protocol that knows "initiators" and "targets".) The NPP sits on top of the LLCP and the LLCP sits on top of NFC-DEP. LLCP removes the restricition that the initiator always starts a connection. In fact both, initiators and targets, are equal on the LLCP layer. Both can listen on sockets and create new sockets. For NPP, the NPP server creates a listening LLCP socket and waits for pushed NDEF messages. The NPP client is invoked by the foreground NDEF push and sends NDEF messages to NPP servers. > 3. If in question tow i'm right,the target(another Nexus S > phone,or a nfc reader in my desktop) received the ndef data > mMessage,and send a response to initiator,how can i got the ndef > response. The NPP is one-way. You can't send a response to a received NDEF message. > 4. In target terminal such as another Nexus s phone,how can i get > the p2p inittiator pushed ndef data. > Ndef myTag=Ndef.get(tag); > myTag.connect(); > if (myTag.isConnected()) > { > myTag.getNdefMessage(); > } On the receiving device, the NDEF data should be delivered in an NDEF_DISCOVERED intent (or through the respective foreground dispatch). br, Michael -- 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