Convert JNI types to Native types

后端 未结 6 506
温柔的废话
温柔的废话 2020-12-30 18:47

While there is documentation regarding turning a jstring to a native string (string nativeString = env->GetStringUTFChars(jStringVariable, NULL);

6条回答
  •  一向
    一向 (楼主)
    2020-12-30 18:56

    You just need to cast jintto 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 typedefs.

提交回复
热议问题