0
Parcelable[] rawMsgs = intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES);

when i debug application raw Msgs value is following below,

[NdefMessage [NdefRecord tnf=1 type=5370 payload=D1010B5501676F6F676C652E636F6D]] data

where is come from this value thanks in advance.

4

1 回答 1

0

The extra NDEF_MESSAGES is a parameter of one of the NFC disovery intents (NDEF_DICOVERED/TECH_DISCOVERED). The data can come either from an NFC tag (in that case the NFC tag holds the NDEF data structure in its memory) or from another peer-to-peer NFC device (in that case the NDEF data structure had been transfered over either SNEP or NPP).

The TECH_DISCOVERED intent only triggers for NFC tags, while the NDEF_DICOVERED intent triggers for both tags and peer-to-peer communication.

Btw. the data contained in your NDEF message is a single NDEF URI record containing the URI http://www.google.com/

于 2013-10-05T08:27:04.467 回答