The QAndroidJniEnvironment provides access to the JNI Environment. More...
Header: | #include <QAndroidJniEnvironment> |
qmake: | QT += androidextras |
Since: | Qt 5.2 |
This class was introduced in Qt 5.2.
QAndroidJniEnvironment() | |
~QAndroidJniEnvironment() | |
jclass | findClass(const char *className) |
JNIEnv * | operator JNIEnv *() const |
JNIEnv * | operator->() |
int * | javaVM() |
Constructs a new QAndroidJniEnvironment object and attach the current thread to the Java VM.
bool exceptionCheck() { /* The QAndroidJniEnvironment attaches the current thread to the JavaVM on creation and detach when it goes out of scope. */ QAndroidJniEnvironment qjniEnv; return qjniEnv->ExceptionCheck(); }
Detaches the current thread from the Java VM and destroys the QAndroidJniEnvironment object.
Searches for className using all available class loaders. Qt on Android uses a custom class loader to load all the .jar files and it must be used to find any classes that are created by that class loader because these classes are not visible in the default class loader.
Returns the class pointer or null if is not found.
This function was introduced in Qt 5.12.
[static]
int *QAndroidJniEnvironment::javaVM()
Returns the Java VM interface.
Returns the JNI Environment pointer.
Provides access to the QAndroidJniEnvironment's JNIEnv pointer.
© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-5.13/qandroidjnienvironment.html