Hello Tobias
I think the following code might help you.
jbyteArray byteArray;
char msg[50];
int l;
sprintf(msg, "May the force be with you.");
l = strlen(msg);
byteArray = (*env)->NewByteArray(env, l);
(*env)->SetByteArrayRegion( env, byteArray, 0, l, (const jbyte*)msg );
Sorry for it's not exact what you want, but probably there is similar
function for 'double'.
The 'env' variable in above is JNIEnv type, which is cached where I
get it through the native function's parameter.
You can cache the JNIEnv object at JNI_OnLoad or any native functions
you made.
Sincerely,
Simeon Lee