스트링 멤버변수 get,set
https://aroundck.tistory.com/608
jfieldID fid; /* store the field ID */
jstring jstr;
const char *str;
/* Get a reference to obj's class */
jclass cls = env->GetObjectClass( obj );
/* smk멤버 필드 아이디를 가져옴*/
smk_fid = env->GetFieldID(cls, "smk", "Ljava/lang/String;");
if ( fid == NULL )
return -1;
/* smk멤버 읽기 */
jstr = (jstring)env->GetObjectField( obj, fid );
str = env->GetStringUTFChars( jstr, NULL );
if ( str == NULL )
return -1;
printf(" c.s = \"%s\"\n", str );
env->ReleaseStringUTFChars( jstr, str );
/* smk멤버에 123 세팅*/
jstr = env->NewStringUTF("123" );
if (jstr == NULL )
return -1;
env->SetObjectField(obj, fid, jstr );