0
我使用chariot solutions phonegap plugin編寫NFC標籤,但我不確定如何使用phonegap插件編寫Android Application Record。如何使用phonegap編寫Android應用程序記錄(AAR)?
這裏是我的,我怎麼寫的NDEF記錄代碼:
nfc.addNdefListener(function(nfcEvent) {
var tag = nfcEvent.tag, ndefMessage = tag.ndefMessage;
if (tag.isWritable && tag.canMakeReadOnly) {
log(JSON.stringify(tag));
var type = "application/com.example.name",
id = 1234,
payload = nfc.stringToBytes(JSON.stringify({ payloadID : 1234 })),
record = ndef.record(ndef.TNF_MIME_MEDIA, type, id, payload);
var message = [ record ];
nfc.write(message, function() {
alert("Successfully written to NFC Tag!")
}, function() {
alert("Failed to write to NFC Tag!")
});
}
}, function() { // success callback
log("Waiting for NDEF tag");
}, function(error) { // error callback
alert("Error adding NDEF listener " + JSON.stringify(error));
});
如何編寫一個Android應用程序記錄(AAR)使用PhoneGap的?
剛剛發現的TNF_EXTERNAL_TYPE記錄這個https://plus.google.com/+JanBrands/posts/8n3x9JFnG8T – deefactorial 2014-08-29 17:34:49