Professional NFC Application Development for Android™ by Vedat Coskun & Kerem Ok & Busra Ozdenizci

Professional NFC Application Development for Android™ by Vedat Coskun & Kerem Ok & Busra Ozdenizci

Author:Vedat Coskun & Kerem Ok & Busra Ozdenizci
Language: eng
Format: epub
Publisher: John Wiley & Sons
Published: 2013-03-25T16:00:00+00:00


TNF_ABSOLUTE_URI

TNF_ABSOLUTE_URI indicates the absolute form of a URI that follows the absolute-URI rule defined by RFC 3986. The required code to create an absolute URI record is as follows:

byte[] uri = "http://nfclab.com/index.html".getBytes(Charset.forName("US-ASCII")); NdefRecord uriRecord = new NdefRecord( NdefRecord.TNF_ABSOLUTE_URI, uri, new byte[0], new byte[0] ); NdefMessage newMessage= new NdefMessage(new NdefRecord[] { uriRecord });

As you can see in the code, first a byte array named uri containing the absolute URI is created by encoding it with the US-ASCII charset and is then used to create a TNF_ABSOLUTE_URI record by selecting the record type as NdefRecord.TNF_ABSOLUTE_URI.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.