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

JNI ArrayList<String> to QAndroidJniObject



  • Hey guys, I've been looking into JNI, and for a function (sendMultipartTextMessage) I need to pass an ArrayList<String>, for which I have two doubts:

    1. What would the string to define the object be? java/util/arraylist is the class, however, what about the type (String) ?
    2. How do I turn a QList<QString> to a QAndroidJniObject? For string there's a QAndroidJniObject::fromString(), but the only other option is ::fromLocalRef<jobject> function (which I'm not very clear on usage).

    From the documentation:
    https://doc.qt.io/qt-5/qandroidjniobject.html

    jobjectArray [Ljava/lang/Object;

    I guess JAVA will then interprete it as each of those Objects being a String inside the ArrayList?

    Regards..


Log in to reply