jstring return in JNI program
JNIEXPORT jstring JNICALL Java_Sample1_stringMethod
(JNIEnv *env, jobject obj, jstring string)
{
const char *name = (*env)->GetStringUTFChars(env,string, NULL);
char msg[60] = "Hello ";
jstring result;
strcat(msg, name);
(*env)->ReleaseStringUTFChars(env,string, name);
puts(msg);
result = (*env)->NewStringUTF(env,msg);
return result;
}