NativeJavaBridge
The Android bridge to Java through reflection. Sync calls run on the JavaScript thread, so touch views only asynchronously.
type NativeJavaBridge = { … }Members
(operations: NativeJavaBatchOperation[]): NativeJavaValue[]Runs independent operations in one call on the JavaScript thread and returns every result in order.
(operations: NativeJavaBatchOperation[]): NativeCancelablePromise<NativeJavaValue[]>Runs the operations like batch, on the main thread, so views can be read safely.
(handle: NativeJavaReference): NativeJavaValueReads an object's class name, as a string value.
(name: string, args?: NativeJavaArgument[]): NativeHandleCalls the constructor matching args and returns a handle the scope holds until released.
Creates a key for attaching a value to objects with setAssociatedObject.
(name: string): NativeJavaClassDescriptionLists a class's constructors, methods and fields.
(plan: NativeJavaCallPlan): voidFrees a call plan; using it afterwards throws.
(root: NativeJavaReference, className: string, options?: NativeViewSearchOptions): NativeCancelablePromise<NativeJavaValue[]>Finds the views of a class under or above a view, on the main thread, like objc.findViews.
(handle: NativeJavaReference, key: NativeHandle): NativeJavaValueReads the value attached to an object under a key.
(name: string): NativeHandleLooks up a class by fully qualified name and returns a handle the scope holds until released.
(handle: NativeJavaReference, name: string): NativeJavaValueReads a field by name.
(handle: NativeJavaReference, name: string, args?: NativeJavaArgument[]): NativeJavaValueCalls a method on the JavaScript thread.
(handle: NativeJavaReference, name: string, args?: NativeJavaArgument[]): NativeCancelablePromise<NativeJavaValue>Calls a method on the main thread and resolves with its result. Needs native.java.invokeAsync.
(plan: NativeJavaCallPlan, target: NativeJavaReference, args?: NativeJavaArgument[]): NativeJavaValueCalls a prepared method on the JavaScript thread, like invoke.
(plan: NativeJavaCallPlan, target: NativeJavaReference, args?: NativeJavaArgument[]): NativeCancelablePromise<NativeJavaValue>Calls a prepared method on the main thread and resolves with its result, like invokeAsync.
(target: NativeJavaReference, name: string, parameterTypes: readonly string[]): NativeJavaCallPlanResolves a method by name and parameter types once, for repeated calls through invokePrepared.
(handle: NativeJavaReference): voidDrops the plugin's hold on a handle so the loader can free the object.
(handle: NativeJavaReference, name: string, args?: NativeJavaArgument[]): NativeJavaValueChecks whether the object has a method name callable with args, as a boolean value.
(handle: NativeJavaReference, key: NativeHandle, value: NativeJavaArgument): voidAttaches a value to an object under a key.
(handle: NativeJavaReference, name: string, value: NativeJavaArgument): voidWrites a field by name.