al_android_get_jni_env(3)
πΈ NAME πΈ
al_android_get_jni_env β Allegro 5 API, bestie π
(Also hi, this is al_android_get_jni_env(3) from the Library Functions Manual β folding that header tea right here so you have the full vibe check. π«Ά)
β¨ SYNOPSIS β¨
#include <allegro5/allegro_android.h>
JNIEnv *al_android_get_jni_env(void)
π¦ DESCRIPTION π¦
Okay so this one is literally giving βlet me hand you the keys.β It returns the Android JNI environment that Allegro uses to call into Java. As a convenience, this function provides it to you, the user, so there is no need to obtain it yourself. Slay. π
For example, if you have a Java method void send(String message) in your activity class, you could call it like this from C code:
JNIEnv * env = al_android_get_jni_env();
jclass class_id = (* env)->GetObjectClass(env, al_android_get_activity());
jmethodID method_id = (* env)->GetMethodID(env, class_id, "send",
"(Ljava/lang/String;)V");
jstring jdata = (* env)->NewStringUTF(env, "Hello Java!");
(* env)->CallVoidMethod(env, al_android_get_activity(), method_id, jdata);
(* env)->DeleteLocalRef(env, jdata);
Thatβs the whole example, no cap. β¨
π SINCE π
5.2.2, bestie β thatβs when this icon showed up. π¦
[Unstable API]: This API is new and subject to refinement.
β xoxo, your Allegro reference manual girl π Β· source/version: Allegro reference manual Β· page: <code>al_android_get_jni_env(3)</code> Β· date: not printed on this page, bestie π«Ά
π¦ where this page comes from
- arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms