Android.Nfc.NdefRecord.CreateMime Method
Create a new NDEF Record containing MIME data.

Syntax

[Android.Runtime.Register("createMime", "(Ljava/lang/String;[B)Landroid/nfc/NdefRecord;", "")]
public static NdefRecord CreateMime (string mimeType, byte[] mimeData)

Parameters

mimeType
a valid MIME type
mimeData
MIME data as bytes

Returns

Documentation for this section has not yet been entered.

Exceptions

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

Remarks

Create a new NDEF Record containing MIME data.

Use this method to encode MIME-typed data into an NDEF Record, such as "text/plain", or "image/jpeg".

The mimeType parameter will be normalized with Android.Content.Intent.NormalizeMimeType(string) to follow Android best practices for intent filtering, for example to force lower-case. However the unchecked exception Java.Lang.IllegalArgumentException may be thrown if the mimeType 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.

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

[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