jmethodID methodID = env->GetMethodID(clazz,"<init>","()V");
jclass clazz = env->FindClass("com/xiaojianbang/ndk/NDKDemo");
jfieldID privateStaticStringField = env->GetStaticFieldID(clazz,"privateStaticStringField","Ljava/lang/string;");
jstring privateStaticString = static_cast<jstring>(env->GetStaticObjectField(clazz,privateStaticStringField));
const char* privatestr = env->GetStringUTFChars(privateStaticString,nullptr);
env->ReleaseStringUTFChars(privateStaticString,privatestr);
jclss clazz = env->FIndClass("com/xiaojianbang/ndk/NDKDemo"); jmethodID methodID = env->GetMethodID(clazz,"<init>","()V"); jobject ReflectDemoOjb = env->NewObject(clazz,methodID);
jfieldID publicStringField = env->GetFieldID(ReflectDmmoObj,"publicStringField","L/java/lang/String");
jstring publicString = static_cast<jstring>(env->GetObjectField(clazz,publisStringField));
const char* publicstr = env->GetStringUTFChars(publicString,nullptr);
env->ReleaseStringUTFChars(publicString,publicstr);
jcalss clazz = FindClass("com/xiaojianbang/ndk/NDKDemo");
jfieldID publicStringField = env->GetFieldID(clazz,"publicStringField","L/java/lang/String"); env->SetObjectField(clazz,publicStringField,env->NewStringUTF("xiaojianbang"));
|