Android.Nfc.NdefRecord.CreateUri Method
Create a new NDEF Record containing a URI.

Syntax

[Android.Runtime.Register("createUri", "(Ljava/lang/String;)Landroid/nfc/NdefRecord;", "")]
public static NdefRecord CreateUri (string uriString)

Parameters

uriString
string URI to encode.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
!:NoType:if the uriString is empty or invalid

Remarks

Create a new NDEF Record containing a URI.

Use this method to encode a URI (or URL) into an NDEF Record.

Uses the well known URI type representation: NdefRecord.TnfWellKnown and NdefRecord.RtdUri. This is the most efficient encoding of a URI into NDEF.

The uriString parameter will be normalized with Android.Net.Uri.NormalizeScheme to set the scheme to lower case to follow Android best practices for intent filtering. However the unchecked exception Java.Lang.IllegalArgumentException may be thrown if the uriString parameter has serious problems, for example if it is empty, so always catch this exception if you are passing user-generated data into this method.

Reference specification: NFCForum-TS-RTD_URI_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 14