![]() |
4S Device Communication Module Collection
Version 0.6-SNAPSHOT
Full documentation of the modules in the 4SDC collection (aimed at 4SDC module developers)
|
|
Handles to the Java VM running our Android service. More...
Functions | |
jint | JNI_OnLoad (JavaVM *vm, void *) |
JNI initialization function. More... | |
void | JNI_OnUnload (JavaVM *vm, void *) |
JNI deinitialization function. More... | |
Variables | |
static JavaVM * | theVM = nullptr |
static jobject | classLoader = nullptr |
static jobject | androidContext = nullptr |
This component bridges the C++ and Java worlds of the Android service by providing the handles into the Android/Java world needed by the C++ components of the PAL layer.
jint JNI_OnLoad | ( | JavaVM * | vm, |
void * | |||
) |
This function is called by the JNI (or the Qt library when used in a QtAndroid context) when the library has been loaded and should initialize itself.
We use it to save references to the JavaVM and the Java ClassLoader to use for loading 4S Java classes.
vm | The JavaVM pointer. |
void JNI_OnUnload | ( | JavaVM * | vm, |
void * | |||
) |
This function is called by the JNI (or the Qt library when used in a QtAndroid context) when the library is being unloaded.
We use it to free the references saved in the JNI_OnLoad() function.
vm | The JavaVM pointer. |