Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt program on Android with java data. Proper way to set up JNI



  • Good day. I have a Qt gui that currently uses a .so lib to access some data channels, the data are assigned to signals and drive a display.

    I want to port to Android. I have a native java lib to replace the .so and I can aquire data using it in a self contained java program. The java code basically spits out a string of data every time the value changes. What would be the proper way to call the java code and use the strings or values as a signal in Qt.

    I have been looking at the JNI examples but for a non programmer its hard for me to follow. A basic example I could follow would help very much.

    I need to be able to call the java code with a string that defines the channel name. The java code then ouput an update when value change and I need the Qt c++ code to catch that data.

    Will the JNI do this, and what would be the proper way to implement this senareo.

    thx


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    I think you are going to be interested by the QtAndroidExtras.

    It does provide tools to facilitate JNI code writing.


Log in to reply