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

Syntax

[Android.Runtime.Register("createUri", "(Landroid/net/Uri;)Landroid/nfc/NdefRecord;", "")]
public static NdefRecord CreateUri (Android.Net.Uri uri)

Parameters

uri
URI to encode.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
!:NoType:if the uri 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 uri 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 uri 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