Ok, i am doing a java jni project, and i am trying to pass a string array from c++ to java. How is this done, i cannot figure out how to do it.
Passing c++ arrays to java jni
Page 1 of 17 Replies - 217 Views - Last Post: 10 February 2013 - 08:37 PM
Replies To: Passing c++ arrays to java jni
#2
Re: Passing c++ arrays to java jni
Posted 09 February 2013 - 01:16 PM
Can you show what you have attempted in terms of code?
#3
Re: Passing c++ arrays to java jni
Posted 09 February 2013 - 01:28 PM
I haven't attempted anything besides directly passing the array on which didnt compile, because i don't know where to start.
#4
Re: Passing c++ arrays to java jni
Posted 09 February 2013 - 01:43 PM
So can you post that code?
#5
Re: Passing c++ arrays to java jni
Posted 09 February 2013 - 03:37 PM
JNIEXPORT jobjectArray JNICALL Java_osjal_Battery_DeviceName(JNIEnv *env, jclass)
{
init1();
init2();
init3();
return DeviceName;
}
where devicename is a string array
This post has been edited by popgalop: 09 February 2013 - 03:37 PM
#6
Re: Passing c++ arrays to java jni
Posted 09 February 2013 - 04:47 PM
I've just had a look at the Java Native Interface, and your code looks incomplete. I've never used JNI and I'm not going to take the time learning it.
You need to put a lot more effort in with learning how to use the JNI properly.
You need to put a lot more effort in with learning how to use the JNI properly.
#7
Re: Passing c++ arrays to java jni
Posted 10 February 2013 - 06:35 AM
ive done a lot of research i just dont know how to do arrays i can do anything else
#8
Re: Passing c++ arrays to java jni
Posted 10 February 2013 - 08:37 PM
would be a lot easier to have Java to fetch that array fronm C++ if your design allow you to do so and use that alternative
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote





|