.\" Automatically generated by Pandoc 3.1.11.1 .\" .TH "al_android_get_jni_env" "3" "" "Allegro reference manual" "" .SH NAME al_android_get_jni_env \- Allegro 5 API .SH SYNOPSIS .IP .EX #include JNIEnv *al_android_get_jni_env(void) .EE .SH DESCRIPTION Returns the Android JNI environment used by Allegro to call into Java. As a convenience this function provides it to the user so there is no need to obtain it yourself. .PP For example if you have a Java method \[lq]void send(String message)\[rq] in your activity class, you could call it like this from C code: .IP .EX 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, \[dq]send\[dq], \[dq](Ljava/lang/String;)V\[dq]); jstring jdata = (* env)\->NewStringUTF(env, \[dq]Hello Java!\[dq]); (* env)\->CallVoidMethod(env, al_android_get_activity(), method_id, jdata); (* env)\->DeleteLocalRef(env, jdata); .EE .SH SINCE 5.2.2 .RS .PP \f[I][Unstable API]:\f[R] This API is new and subject to refinement. .RE