Search guides and the APICtrl K
  1. API reference
  2. Formats and wrappers

android_jni.h

The JNI an Android app's C++ uses -- the activity, its thread's JNIEnv, and the SDK's own Java class.

#include <sonore/android_jni.h>
On this page

Design notes

The framework is reached through JNI on its own classes (android_app.h asks for the density, the insets, the permissions that way). What only Java can do -- implement a framework callback interface -- is in SonoreBridge (sdk/android/java), which sonore_add_standalone compiles into the APK's classes.dex. FindClass from native code searches the SYSTEM class loader, which has never heard of an app's own classes, so SonoreBridge is loaded through the activity's class loader instead, once, and kept.

Every call here is for the activity's main thread unless it says otherwise: that is the thread whose JNIEnv the activity hands over.

Functions 7

↑↓ to move↵ to openEvery public name in the headers, and every guide