get NFC Ndef Well Known URI - Android Network

Android examples for Network:NFC Ndef

Description

get NFC Ndef Well Known URI

Demo Code


//package com.java2s;

import android.nfc.NdefMessage;
import android.nfc.NdefRecord;

public class Main {
    public static NdefMessage getNdefWellKnownURI(String uri) {
        NdefRecord uriRecord = NdefRecord.createUri(uri);
        return createNdefMessage(uriRecord);
    }/*w w  w  .j a  va 2 s.  co  m*/

    private static NdefMessage createNdefMessage(NdefRecord... records) {
        NdefMessage ndefMessage = new NdefMessage(records);
        return ndefMessage;
    }
}

Related Tutorials