GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
al_android_get_jni_env(3) al_android_get_jni_env(3)

al_android_get_jni_env - Allegro 5 API


#include <allegro5/allegro_android.h>
JNIEnv *al_android_get_jni_env(void)

    

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.

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);

    

5.2.2

[Unstable API]: This API is new and subject to refinement.

Allegro reference manual

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.