jni

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package jni provides JNI helper functions for Android NativeActivity operations that have no NDK C API equivalent (permission dialogs, Toast messages, SurfaceTexture creation from Java).

This package is hand-written (not auto-generated) because JNI calls require inline C with JNIEnv method tables.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSurfaceTexture

func CreateSurfaceTexture(
	activityPtr unsafe.Pointer,
	texName, width, height int,
) unsafe.Pointer

CreateSurfaceTexture creates a Java SurfaceTexture wrapping the given GL texture name and returns the native ASurfaceTexture handle as unsafe.Pointer.

func FillWindowColor

func FillWindowColor(windowPtr unsafe.Pointer, color uint32)

FillWindowColor fills an ANativeWindow with a solid RGBA color.

func HasPermission

func HasPermission(activityPtr unsafe.Pointer, permission string) bool

HasPermission checks whether the activity has the given permission granted.

func RequestPermission

func RequestPermission(activityPtr unsafe.Pointer, permission string)

RequestPermission shows the system permission dialog for the given permission.

func ShowToast

func ShowToast(activityPtr unsafe.Pointer, message string)

ShowToast displays an Android Toast message.

Types

This section is empty.

Jump to

Keyboard shortcuts

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