Issue
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?
Solution
You just need to cast jint
to int
using C style casts. Same for jboolean
to bool
(if you're using C99 bool
type) or to uint8_t
(if you're using std int types) or to unsigned char
.
Open $NDK_ROOT/platforms/android-8/arch-arm/usr/include/jni.h
and you'll see jint
, jboolean
etc are just typedef
s.
Answered By - Gregory Pakosz
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.