Currently i am working on JNI for native access between java and c++.
Here goes my doubt:
If i have to access an integer field (present inside my java class) in my c++ code, then the code is like this:
jclass testC = env->FindClass("class name"); jfieldID fid1 = env->GetFieldID(testC,"var","I"); //assuming the field name is var(type-int) jobject objC = env->AllocObject(testC); jint ret = env->GetIntField(objC,fid1); //retrieving the value ret = 89; env->SetIntField(objC,fid1,ret); //changing the value of 'var'
But my problem is, if in the above case i have an integer array (instead of just an int),
and i want to perform similar get and set operations on the array, then what would be the code?
I have tried a lot for this, but not able to achieve this.
It would be really great, if someone can fix this problem.