Qt 5.4/Android: Call Qt method from Java code
-
Hi,
Is there a way to call a C++/Qt object method from Java? I want to notfiy (with a list of parameter arguements) my Qt/Qml code from a Java activity. Do I need to register the C++ class as a listener? How can this be achieved?
Regards,
-
Solved it: you just have to add a native method to Java and implement it somewhere in C++.
-
You need to register your C++ interface via JNI. You may find example code at:
https://github.com/benlau/qtandroidexamplecode/tree/master/qtandroidrunner