Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F86336969
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, Oct 5, 21:59
Size
992 B
Mime Type
text/x-c
Expires
Mon, Oct 7, 21:59 (2 d)
Engine
blob
Format
Raw Data
Handle
21404775
Attached To
R9807 cellulo-lua
CelluloUnity_Cellulo.cpp
View Options
#ifdef __ANDROID__
#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()"
;
jint
res
=
load
(
vm
,
reserved
,
"libQt5Core.so"
);
load
(
vm
,
reserved
,
"libQt5AndroidExtras.so"
);
load
(
vm
,
reserved
,
"libQt5Bluetooth.so"
);
load
(
vm
,
reserved
,
"libqtforandroid.so"
);
// FIXME: enables bluetooth. Does not work. See https://c4science.ch/T2160
qDebug
()
<<
"End JNI_Onload()"
;
return
res
;
}
#endif
Event Timeline
Log In to Comment