Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
al_android_get_jni_env(3)			     al_android_get_jni_env(3)

NAME
       al_android_get_jni_env -	Allegro	5 API

SYNOPSIS
	      #include <allegro5/allegro_android.h>

	      JNIEnv *al_android_get_jni_env(void)

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.

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

SINCE
       5.2.2

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

Allegro	reference manual			     al_android_get_jni_env(3)

NAME | SYNOPSIS | DESCRIPTION | SINCE

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=al_android_get_jni_env&sektion=3&manpath=FreeBSD+13.0-RELEASE+and+Ports>

home | help