Android examples for Network:NFC Ndef
get String As Ndef from NFC
//package com.java2s; import android.nfc.NdefMessage; import android.nfc.NdefRecord; public class Main { public static NdefMessage getStringAsNdef(short tnf, String type, String id, String payload) { byte[] idBytes = id.getBytes(); byte[] payloadBytes = payload.getBytes(); byte[] typeBytes = type.getBytes(); NdefRecord textRecord = new NdefRecord(tnf, typeBytes, idBytes, payloadBytes);/*from w ww . j a v a 2s. c om*/ return new NdefMessage(new NdefRecord[] { textRecord }); } }