I have a built-in function in nativeLib
public native int [] getArrayNative();
which I use as follows
private static int[] DEMO_NODES;
DEMO_NODES = nativeLib.getArrayNative();
in c code it has
JNIEXPORT jintArray JNICALL Java_com_testing_NativeLib_getArrayNative
(JNIEnv *env, jobject obj) {
int array[] = { 0, 1, 0, 1, 2, 1, 2, 3, 2, 3, 1, 2, 1, 2, 3, 2, 3, 1, 2 };
jintArray temp = (*env)->NewIntArray(env,20);
temp[0] = array[0];
return temp;
}
here I want to return the whole guy [], but I canβt figure out how to do this. here I took a new temp array inside, which tried to copy the value of arry [], but it shows an error. so how to do it
source
share