Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F60107998
CelluloUnity_Cellulo.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Apr 27, 13:42
Size
889 B
Mime Type
text/x-c
Expires
Mon, Apr 29, 13:42 (2 d)
Engine
blob
Format
Raw Data
Handle
17302064
Attached To
R9807 cellulo-lua
CelluloUnity_Cellulo.cpp
View Options
#include "CelluloUnity_Cellulo.h"
#include <dlfcn.h>
#include <QDebug>
jint load(JavaVM *vm, void *reserved, const char* so_file) {
jint (*that_jni_onload)(JavaVM *vm, void *reserved);
char *error;
void* handle = dlopen(so_file, RTLD_LAZY);
if (!handle) {
qDebug() << dlerror();
exit(EXIT_FAILURE);
}
*(void **) (&that_jni_onload) = dlsym(handle, "JNI_OnLoad");
if ((error = dlerror()) != NULL) {
qDebug() << error;
exit(EXIT_FAILURE);
}
return (*that_jni_onload)(vm, reserved);
}
jint JNI_OnLoad(JavaVM *vm, void *reserved)
{
qDebug() << "Begin JNI_Onload()";
load(vm, reserved, "libqtforandroid.so");
jint res = load(vm, reserved, "libQt5Core.so");
load(vm, reserved, "libQt5AndroidExtras.so");
load(vm, reserved, "libQt5Bluetooth.so");
qDebug() << "End JNI_Onload()";
return res;
}
Event Timeline
Log In to Comment