I need to get a List of Strings (char*) from C++ and return it to Java.
How can I do that?
I think one solution is return a big string pre-defined like: “[item1][item2]” and make a split on Java, but it doesn’t look like the right approach.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Look at
NewObjectArrayinto the JNI doc.Basically you can return from the JNI function an Array Of String (Java) an then transform it in a
Listor a whatever kind of Collection type.Peudo code:
Java:
JNI
Not tested!!!
Let me know if it works for u
Regards