While there is documentation regarding turning a jstring to a native string (string nativeString = env->GetStringUTFChars(jStringVariable, NULL);) I can’t find an example which will convert a jboolean to a bool or a jint to an int.
Can anyone suggest how this is achieved?
You just need to cast
jinttointusing C style casts. Same forjbooleantobool(if you’re using C99booltype) or touint8_t(if you’re using std int types) or tounsigned char.Open
$NDK_ROOT/platforms/android-8/arch-arm/usr/include/jni.hand you’ll seejint,jbooleanetc are justtypedefs.