I want to pass the following pointer array through the JNI layer from C code
char *result[MAXTEST][MAXRESPONSE] = {
{ "12", "12", "" },
{ "8", "3", "" },
{ "29", "70", "" },
{ "5", "2", "" },
{ "42", "42", "" }
};
In java code I have written the following declaration
public static native String[][] getResult();
I am confused how to pass that array through JNI layer to Java code??? Following is the JNI layer description
JNIEXPORT jobjectArray JNICALL Java_com_example_CheckResult_getResult
(JNIEnv *env, jclass thiz) {
Confused over here ????
}
bytebuffer with NUL terminators between strings) and let the Java side re-interpret it if necessary. The general complexity of turning a multi-dimensional C array in JNI into a multi-dimensional Java array is a lot higher than constructing the multi-dimensional array on the Java side (assuming that your really need that format) from simpler data.