Android: Call Java function from C++

  • Hi,
    Does anybody know how can I call a Java function from C++?
    I'm using the following code, but I can't even get the java class.

    JavaVM *currVM;
    currVM = (JavaVM )QApplication::platformNativeInterface()->nativeResourceForIntegration("JavaVM");
    if( currVM->AttachCurrentThread(&env, NULL)<0){
    qCritical()<<"AttachCurrentThread failed";
    jclass applicationClass=env->FindClass("com/test/QtApplication");

  • This example:
    show how to call Java methods from C++ using Qt.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.