Store return value and pass params[0] direct, don't need c_str here
Combine log output into one line
Move JNI down to just before it is used