I am developing an application in JNI which is supposed to return a Vector of C++ class objects.

Edwin Madari

From native language side, always call Java Methods to populate your Vector. Similary, call Java Methods to read the contents of any of the elements of the Vector, and even the contents of each element.

This way, from the start, your vector lives in Java. You use Java methods to add/update/delete elements in this vector from native side. You can add/use a "<init>" method of your Java class to instantiate your Java Vector.

I had done something similar (retrieving n-dim Java String Array). Any thing other than primitive datatype of Java is an object in native side.

0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact