开发者

JNI How to store char arrray and Log it in jNI?

开发者 https://www.devze.com 2023-04-05 08:07 出处:网络
I\'m sending ch开发者_JAVA技巧ar[] from java to C .I want to store the return value of my methodid function :

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号