1. Before reading this article I assume you have read:
Android NDK Practical Learning-get Java-side classes and their class variables
Android NDK Practical Learning-java End Object member assignment and get object member values
2,java the construction of the End Class object:
① first gets the class;
② gets the parameterless constructor of the class:
" <init> " " () V ");
③ Constructor Class instance:
Jobject Jresult = Env->newobject (Jcsetdatamgr, Initid);
④ assign a value to a class variable:
1 // Assignment assigns a value from C + + to Jresult 2 int 666 ; 3 true ); 4 Env->setintfield (G_testobject, Gs_testgetdatamgr.jidata, i);
Note: Additional assignment codes can refer to the Android NDK utility learning-java End Object member assignment and get object member values
⑤ class instances can be passed as return values and class parameters;
Android NDK Practical Learning (iii)-Construction and use of Java End Class objects