In the c ++ program, data is generated that needs to be transferred to java. Data in the form of several objects class{ String name; int x, y, sx, sy; }; class{ String name; int x, y, sx, sy; }; You can request each value as a separate function, but this is not an option at all.

Is there a way to return an array to java, for example, in the form of a list of keys and values? Or in the form of a tree, where you can put all the necessary values ​​at once. That is the question: how to return the values ​​and use them with ease and simplicity.

UPD. Something like that. http://mikelsv.livejournal.com/8902.html . << This is the answer.

    1 answer 1

    I can be wrong, but in the field you can use the JNI jobject type, or rather, transfer their array to the JNI function and then use it in Java.

    The first thing that came to mind.

    • Anything can come to mind, the question is how to implement it. :) In general, I found an example and try to drag it into my code. If I understand correctly, I can return a whole array of class variables written in Java. If it works out will be awesome. About the best and not dreamed of. (Of course, except for the option to write completely without java). - mikelsv
    • Damn, the meaning was inherited from the jobject in C ++ and everything would have been calm if it understood the question correctly. What is the problem - it is not clear. - DroidAlex
    • In general, with jni code, you can modify java objects. So no problem. - KoVadim
    • Here is one theory, but I wanted practical information. The issue is resolved. - mikelsv
    • @mikelsv, then answer your question here once the issue is resolved. - Raskilas