Example usage for android.nfc NdefRecord TNF_ABSOLUTE_URI

List of usage examples for android.nfc NdefRecord TNF_ABSOLUTE_URI

Introduction

In this page you can find the example usage for android.nfc NdefRecord TNF_ABSOLUTE_URI.

Prototype

short TNF_ABSOLUTE_URI

To view the source code for android.nfc NdefRecord TNF_ABSOLUTE_URI.

Click Source Link

Document

Indicates the type field contains an absolute-URI BNF construct defined by RFC 3986.

When creating new records prefer #createUri , since it offers more compact URI encoding ( #RTD_URI allows compression of common URI prefixes).

Usage

From source file:mobisocial.musubi.ui.FeedListActivity.java

public void writeGroupToTag(Uri uri) {
    NdefRecord urlRecord = new NdefRecord(NdefRecord.TNF_ABSOLUTE_URI, NdefRecord.RTD_URI, new byte[] {},
            uri.toString().getBytes());//  w  w w . jav  a 2  s  .c o  m
    NdefMessage ndef = new NdefMessage(new NdefRecord[] { urlRecord });
    mNfc.enableTagWriteMode(ndef);
    Toast.makeText(this, "Touch a tag to write the group...", Toast.LENGTH_SHORT).show();
}