android - Trying to read NFC NDEF Payload in PhoneGap -


i found similar answer question here given new both phonegap , nfc, wondering if can me?

i able read nfc tag (type="text") don't know how extract payload data (text) tag read.

in logcat receive following message

e.tag = {"iswritable":true,"id":[4,72,-35,98,93,43,-128],"techtypes":    ["android.nfc.tech.nfca","android.nfc.tech.mifareultralight", "android.nfc.tech.ndef"],"type":"nfc forum type 2","canmakereadonly":true,"maxsize":142, "ndefmessage":[{"id":[],"type":[116,101,120,116,47,112,108,97,105,110], "payload":[110,117,108,108],"tnf":2}]}; 

i can't figure out how convert bytearray string. there simple way me this? using phonegap nfc plugin https://github.com/chariotsolutions/phonegap-nfc

hope can help!

thanks!

i able solve problem using phonegap nfc plugin. extracted payload tag read using 1st command shown below , converted bytes received string, again using method made available via plug-in. hope helps starting off nfc , plugin.

    some_value = nfcevent.tag.ndefmessage[0]["payload"];     string_value = nfc.bytestostring(some_value); 

thanks!


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -