al_android_get_jni_env(3)

πŸ“¦
version 5.2.11.3 Β· 3 versions
, in arch rolling

🌸 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