Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/opengl/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android NFC书写的文本格式_Android_Eclipse_Tags_Nfc_Writer - Fatal编程技术网

Android NFC书写的文本格式

Android NFC书写的文本格式,android,eclipse,tags,nfc,writer,Android,Eclipse,Tags,Nfc,Writer,如何用这样的格式将文本写入NFC标记 WELL-KNOWN: urn:nfc:wkt:T (Text) Encoding: UTF-8 Language:en 我的阅读器只能阅读这种格式的文本,而我使用的是这种格式,但无法工作: private NdefMessage getNoteAsNdef() { byte[] textBytes = mNote.getText().toString().getBytes(); NdefRecord textRecord = new

如何用这样的格式将文本写入NFC标记

WELL-KNOWN: urn:nfc:wkt:T (Text)
Encoding: UTF-8
Language:en
我的阅读器只能阅读这种格式的文本,而我使用的是这种格式,但无法工作:

private NdefMessage getNoteAsNdef() {

    byte[] textBytes = mNote.getText().toString().getBytes();


    NdefRecord textRecord = new NdefRecord(NdefRecord.TNF_MIME_MEDIA, "text/plain".getBytes(),
            new byte[0] , textBytes);
    return new NdefMessage(new NdefRecord[] {
        textRecord
    });
}

谢谢,请参见我在回答您的其他问题时添加的第二个选项: