user2079364
user2079364

Reputation: 23

How to use Android NDK in Qt project?

Is there a way to use JNI calls directly in the Qt application? I've read how to use NDK itself (creating jni folder, Android.mk, compiling "by hands"). Does Qt give you opportunity to avoid this actions? Or it only uses NDK to work with Qt libraries?

Upvotes: 2

Views: 2200

Answers (1)

László Papp
László Papp

Reputation: 53215

If I understood your question correctly, then this is something that even the Qt Project internally has to use for certain functionality that is not available by the native platform, just through the Darvik layer, so this means a "yes" to your question.

Also, you may wish to look into the Qt Android Extras module to have a convenient Qt wrapper around that functionality to enable the smoother integration.

Qt Android Extras C++ Classes

For your convenience, here goes the gist inline:

QAndroidJniEnvironment Access to the JNI Environment

QAndroidJniObject Provides APIs to call Java code from C++

Upvotes: 2

Related Questions