reckfellENGINE

JavaClassWrapper

Provides access to the Java Native Interface.

On this page
class JavaClassWrapperReckfellSharp

Provides access to the Java Native Interface.

The JavaClassWrapper singleton provides a way for the Reckfell application to send and receive data through the Java Native Interface (JNI). Note: This singleton is only available in Android builds.

Warning: When calling Java methods, be sure to check JavaClassWrapper.GetException to check if the method threw an exception.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Properties1

SingletonProperty
# Singleton
C#
public static JavaClassWrapperInstance Singleton { get; }

Methods5

CreateProxy2 overloads
# CreateProxy · 1/2
C#
public static JavaObject CreateProxy(ReckfellObject @object, ReadOnlySpan<string> interfaces);

Creates a JavaObject implementing the given Java interfaces using the given ReckfellObject as the implementation. The object must contain methods signatures matching the methods signatures from the passed Java interfaces. Invoking methods from the Java interfaces will route to the matching object method.

Note: This method only works on Android. On every other platform, this method will always return null.

Parameters
NameTypeDefault
objectReckfellObject—
interfacesReadOnlySpan<string>—
Returns JavaObject
# CreateProxy · 2/2
C#
public static JavaObject CreateProxy(ReckfellObject @object, string[] interfaces);

Creates a JavaObject implementing the given Java interfaces using the given ReckfellObject as the implementation. The object must contain methods signatures matching the methods signatures from the passed Java interfaces. Invoking methods from the Java interfaces will route to the matching object method.

Note: This method only works on Android. On every other platform, this method will always return null.

Parameters
NameTypeDefault
objectReckfellObject—
interfacesstring[]—
Returns JavaObject
CreateSamCallbackJavaObject
# CreateSamCallback
C#
public static JavaObject CreateSamCallback(string samInterface, Callable callable);

Creates a JavaObject implementing the Java Single Abstract Method (SAM) interface using the Reckfell Callable as the implementation. The sam_interface must be a Java SAM interface, meaning it must only have a single abstract method to implement. The callable must be able to handle the same parameter types as the SAM interface method, and must provide the same return type. The callable will be invoked as a callback, passing the arguments from the Java SAM interface method.

Note: This method only works on Android. On every other platform, this method will always return null.

Parameters
NameTypeDefault
samInterfacestring—
callableCallable—
Returns JavaObject
GetExceptionJavaObject
# GetException
C#
public static JavaObject GetException();

Returns the Java exception from the last call into a Java class. If there was no exception, it will return null. Note: This method only works on Android. On every other platform, this method will always return null.

Returns JavaObject
WrapJavaClass
# Wrap
C#
public static JavaClass Wrap(string name);

Wraps a class defined in Java, and returns it as a JavaClass ReckfellObject type that Reckfell can interact with. When wrapping inner (nested) classes, use $ instead of . to separate them. For example, JavaClassWrapper.wrap("android.view.WindowManager$LayoutParams") wraps the WindowManager.LayoutParams class. Note: To invoke a constructor, call a method with the same name as the class. For example:

Note: This method only works on Android. On every other platform, this method does nothing and returns an empty JavaClass.

Parameters
NameTypeDefault
namestring—
Returns JavaClass
Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.