Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/231.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_Nfc_Contact - Fatal编程技术网

Android 如何将联系人卡写入NFC标签

Android 如何将联系人卡写入NFC标签,android,nfc,contact,Android,Nfc,Contact,我正试图写一个应用程序,写NFC标签的联系方式。你能告诉我什么应该是“类型”的NdefRecord的联系卡 NdefRecord record = new NdefRecord(NdefRecord.TNF_WELL_KNOWN, "RTD_URI".getBytes(), new byte[] {}, messagebytes); 当您将vCard格式用于联系人详细信息时,您可以使用 NdefRecord record = new NdefRecord(NdefRec

我正试图写一个应用程序,写NFC标签的联系方式。你能告诉我什么应该是“类型”的NdefRecord的联系卡

NdefRecord record = new NdefRecord(NdefRecord.TNF_WELL_KNOWN, "RTD_URI".getBytes(),
            new byte[] {}, messagebytes);

当您将vCard格式用于联系人详细信息时,您可以使用

NdefRecord record = new NdefRecord(NdefRecord.TNF_MIME_MEDIA, 
  "text/vcard".getBytes(), new byte[] {}, messagebytes);
其中
messagebytes
是实际的vCard数据