My JAVA class code snippet .I want to access getReg_chal() method from my C file using JNI:
public char[] getReg_chal() {
return reg_chal;
}
My C file doing some jni operation:
mid = (*env)->GetMethodID(env, info, "getReg_chal()", "()I");
mid = (*env)->GetMethodID(env, info, "getReg_chal()", ***);
I want to know the method descriptor for my char[]. Writing “()I” gives me bogus method descriptor error since ()I is used for Int. What would i fill in *.
Please Help me. Thanks in advance.
The method signature would be “
()[C” .You can read about the details here and here.
To call the method using the method id, you’d just write something like