简体   繁体   English

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

[英]How to write Contact Card to NFC tags

I am trying to write an app which writes NFC tag with contact details. 我正在尝试编写一个应用程序,该应用程序可以写入带有联系方式的NFC标签。 Can you please tell me what should be the "type" for NdefRecord for contact card. 您能告诉我联系卡的NdefRecord的“类型”是什么。

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

When you use the vCard format for the contact details, you can use 将vCard格式用于联系人详细信息时,可以使用

NdefRecord record = new NdefRecord(NdefRecord.TNF_MIME_MEDIA, 
  "text/vcard".getBytes(), new byte[] {}, messagebytes);

where messagebytes is the actual vCard data. 其中messagebytes是实际的vCard数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM