Call Java functions from Qt C++
Is it possible to call java functions from a Qt application? If so, how? Do I need to update the java source code for such a task? I have Qt Desktop Open Source.
First, think twice before calling Java from C/C++. For Android, it allows you to call some API functions of the operating system, but at the cost of performance and some hard-to-catch errors.
Qt devises a very simple way to call Java: package – androidextra
But if you need to call it on the desktop, there’s one way to avoid it: JNI (as Nejat puts it).
Here is a simple example of using it: