Android examples for Network:NFC Record
Create new NFC Uri Record Sub
//package com.java2s; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.nio.charset.Charset; import android.net.Uri; public class Main { static boolean newUriRecordSub(ByteArrayOutputStream os, Uri uri, String prefix, int code) throws IOException { if (uri.toString().startsWith(prefix)) { os.write(code);//from w w w. j a v a 2 s. co m os.write(uri.toString().substring(prefix.length()) .getBytes(Charset.forName("UTF-8"))); return true; } else { return false; } } }