Android examples for Network:Uri
Create URI record
//package com.java2s; import java.nio.charset.Charset; import android.nfc.NdefRecord; public class Main { public static NdefRecord creatUriRecord(String uri) { Charset utfEncoding = Charset.forName("UTF-8"); byte[] textBytes = uri.getBytes(utfEncoding); NdefRecord ndefRecord = null;/*from w w w .j a v a 2 s . co m*/ ndefRecord = new NdefRecord(NdefRecord.TNF_ABSOLUTE_URI, NdefRecord.RTD_TEXT, new byte[0], textBytes); return ndefRecord; } }