JNI How to store char arrray and Log it in jNI?
I'm sending ch开发者_JAVA技巧ar[] from java to C .I want to store the return value of my methodid function :
mid = (*env)->GetMethodID(env, clazz, "getReg_chal", "()[C");
char[] reg_chal = (*env)-> ?
I'm referring the following example as refrence:
jmethodID midGetName = (*env)->GetMethodID(env, employeeClass, "getAge", "()I");
int age = (*env)->CallIntMethod(env, employeeObject, midGetName);
return age;
What will i write in ? ... since CallCharArrayMethod is not available in JNI.
Thanks in advance..
CallObjectMethod() would be work. see http://www.velocityreviews.com/forums/t140355-jni-calling-methods-that-return-byte.html and http://download.oracle.com/javase/1.5.0/docs/guide/jni/spec/functions.html#wp16656
精彩评论