NdefRecord.CreateExternal(String, String, Byte[]) Method

Definition

Create a new NDEF Record containing external (application-specific) data.

[Android.Runtime.Register("createExternal", "(Ljava/lang/String;Ljava/lang/String;[B)Landroid/nfc/NdefRecord;", "")]
public static Android.Nfc.NdefRecord? CreateExternal (string? domain, string? type, byte[]? data);
[<Android.Runtime.Register("createExternal", "(Ljava/lang/String;Ljava/lang/String;[B)Landroid/nfc/NdefRecord;", "")>]
static member CreateExternal : string * string * byte[] -> Android.Nfc.NdefRecord

Parameters

domain
String

domain-name of issuing organization

type
String

domain-specific type of data

data
Byte[]

payload as bytes

Returns

Attributes

Remarks

Create a new NDEF Record containing external (application-specific) data.

Use this method to encode application specific data into an NDEF Record. The data is typed by a domain name (usually your Android package name) and a domain-specific type. This data is packaged into a "NFC Forum External Type" NDEF Record.

NFC Forum requires that the domain and type used in an external record are treated as case insensitive, however Android intent filtering is always case sensitive. So this method will force the domain and type to lower-case before creating the NDEF Record.

The unchecked exception IllegalArgumentException will be thrown if the domain and type have serious problems, for example if either field is empty, so always catch this exception if you are passing user-generated data into this method.

There are no such restrictions on the payload data.

For efficiency, This method might not make an internal copy of the data byte array, so take care not to modify the data byte array while still using the returned NdefRecord.

Reference specification: NFCForum-TS-RTD_1.0

Java documentation for android.nfc.NdefRecord.createExternal(java.lang.String, java.lang.String, byte[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to