Scroll to navigation

SDL_GetAndroidJNIEnv(3) SDL3 FUNCTIONS SDL_GetAndroidJNIEnv(3)

NAME

SDL_GetAndroidJNIEnv - Get the Android Java Native Interface Environment of the current thread.

SYNOPSIS

#include <SDL3/SDL_system.h>
void * SDL_GetAndroidJNIEnv(void);

DESCRIPTION

This is the JNIEnv one needs to access the Java virtual machine from native code, and is needed for many Android APIs to be usable from C.

The prototype of the function in SDL's code actually declare a void* return type, even if the implementation returns a pointer to a JNIEnv. The rationale being that the SDL headers can avoid including jni.h.

RETURN VALUE

for more information.

THREAD SAFETY

It is safe to call this function from any thread.

AVAILABILITY

This function is available since SDL 3.2.0.

SEE ALSO

SDL_GetAndroidActivity(3)

SDL 3.2.14 Simple Directmedia Layer