Android.Nfc.NdefRecord.CreateExternal Method
Create a new NDEF Record containing external (application-specific) data.

Syntax

[Android.Runtime.Register("createExternal", "(Ljava/lang/String;Ljava/lang/String;[B)Landroid/nfc/NdefRecord;", "")]
public static NdefRecord CreateExternal (string domain, string type, byte[] data)

Parameters

domain
domain-name of issuing organization
type
domain-specific type of data
data
payload as bytes

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
!:NoType:if either domain or type are empty or invalid

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 Java.Lang.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

[Android Documentation]

Requirements

Namespace: Android.Nfc
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 16