Android examples for Network:NFC Record
create Text NFC Record
//package com.java2s; import java.nio.charset.Charset; import android.nfc.NdefRecord; public class Main { public static NdefRecord createTextRecord(String payload) { Charset utfEncoding = Charset.forName("UTF-8"); byte[] textBytes = payload.getBytes(utfEncoding); NdefRecord ndefRecord = null;//from www. j a va2 s . c o m ndefRecord = new NdefRecord(NdefRecord.TNF_WELL_KNOWN, NdefRecord.RTD_TEXT, new byte[0], textBytes); return ndefRecord; } }