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

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -