Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Using JNI interface, how to go both ways to between JObject and C++ list structure  RSS feed

meimei li
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried to invoke C++ function in Java. I have created the JNI interface and the signature of the native method is as follows:
(JNIEnv *, jclass, jint, jobject, jstring, jobject, jobject);
I need convert the passed parameter jobject (which is a java.lang.List) object to a c++ List type so that it can be passed to the C++ method YYY which actually does the work.
I also need convert the return value of YYY from C++ List to JAVA jobject of java.lang.List type.
I know how to convert String, array from what I learned from Java tutorial, but have no clue about more complex types.
I really appreciate your help.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!