mobileinit

package
v0.0.0-...-82e3c6f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2022 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package mobileinit contains common initialization logic for mobile platforms that is relevant to both all-Go apps and gobind-based apps.

Long-term, some code in this package should consider moving into Go stdlib.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunOnJVM

func RunOnJVM(fn func(vm, env, ctx uintptr) error) error

RunOnJVM runs fn on a new goroutine locked to an OS thread with a JNIEnv.

RunOnJVM blocks until the call to fn is complete. Any Java exception or failure to attach to the JVM is returned as an error.

The function fn takes vm, the current JavaVM*, env, the current JNIEnv*, and ctx, a jobject representing the global android.context.Context.

func SetCurrentContext

func SetCurrentContext(vm unsafe.Pointer, ctx uintptr)

SetCurrentContext populates the global Context object with the specified current JavaVM instance (vm) and android.context.Context object (ctx). The android.context.Context object must be a global reference.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL