Table of Contents

Class JNIExtensions

QOL extensions for the JNI.

public static class JNIExtensions
Inheritance
object
JNIExtensions

Methods

GetNullableFloat(AndroidJavaObject, string)

Unboxes a native nullable float field into an float?.

public static float? GetNullableFloat(this AndroidJavaObject current, string fieldName)

Parameters

current AndroidJavaObject
fieldName string

Returns

float?

GetNullableInt(AndroidJavaObject, string)

Unboxes a native nullable integer field into an int?.

public static int? GetNullableInt(this AndroidJavaObject current, string fieldName)

Parameters

current AndroidJavaObject
fieldName string

The field to unbox.

Returns

int?

The unboxed value.

UnboxAndCreateGlobalRefForByteBufferElement(nint, int)

Unboxes and creates a global ref of a native ByteBuffer from a native Object array, and returns its direct buffer address.

public static (nint obj, nint ptr) UnboxAndCreateGlobalRefForByteBufferElement(nint args, int index)

Parameters

args nint

The native array to take the buffer from.

index int

The index of the buffer object in the native array.

Returns

(nint obj, nint ptr)

The global reference and the direct buffer address.

UnboxBoolElement(nint, int)

Unboxes a boolean from a native Object array.

public static bool UnboxBoolElement(nint args, int index)

Parameters

args nint

The native array to take the boolean from.

index int

The index of the boolean object in the native array.

Returns

bool

The unboxed boolean.

UnboxIntElement(nint, int)

Unboxes an integer from a native Object array.

public static int UnboxIntElement(nint args, int index)

Parameters

args nint

The native array to take the integer from.

index int

The index of the integer object in the native array.

Returns

int

The unboxed integer.

UnboxLongElement(nint, int)

Unboxes a long from a native Object array.

public static long UnboxLongElement(nint args, int index)

Parameters

args nint

The native array to take the long from.

index int

The index of the long object in the native array.

Returns

long

The unboxed long.

UnboxStringElement(nint, int)

Unboxes a string from a native Object array.

public static string? UnboxStringElement(nint args, int index)

Parameters

args nint

The native array to take the string from.

index int

The index of the string object in the native array.

Returns

string

The unboxed string.