본문 바로가기

Android

Convert char* to jstring in JNI

You could just check JNI api documentation. E.g. Here.
You will find:

jstring NewStringUTF(JNIEnv *env, const char *bytes);

So all you have to do it something like this:

char *buf = (char*)malloc(10);
strcpy(buf, "1234567890");
jstring jstrBuf = (*env)->NewStringUTF(env, buf);


http://stackoverflow.com/questions/16939349/convert-char-to-jstring-in-jni-when-char-is-passed-using-va-arg 

'Android' 카테고리의 다른 글

Draw bitmap (Fit)  (0) 2015.03.24
jni char to byte array  (0) 2015.03.24
kill app  (0) 2015.03.23
renderscript path  (0) 2015.03.18
toolbar shadow  (0) 2015.03.17