简体   繁体   中英

How to write Contact Card to NFC tags

I am trying to write an app which writes NFC tag with contact details. Can you please tell me what should be the "type" for NdefRecord for contact card.

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

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

where messagebytes is the actual vCard data.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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