QAndroidJniEnvironment Class

The QAndroidJniEnvironment provides access to the JNI Environment. 更多...

头文件: #include <QAndroidJniEnvironment>
qmake: QT += androidextras
开始支持版本: Qt 5.2

公有函数

静态公有成员

JavaVM *javaVM()

详细描述

The QAndroidJniEnvironment provides access to the JNI Environment.

成员函数

QAndroidJniEnvironment::QAndroidJniEnvironment()

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();
  }

QAndroidJniEnvironment::~QAndroidJniEnvironment()

Detaches the current thread from the Java VM and destroys the QAndroidJniEnvironment object.

[static] JavaVM *QAndroidJniEnvironment::javaVM()

Returns the Java VM interface.

QAndroidJniEnvironment::operator JNIEnv *() const

Returns the JNI Environment pointer.

JNIEnv *QAndroidJniEnvironment::operator->()

Provides access to the QAndroidJniEnvironment's JNIEnv pointer.