Passing an integer with JNI

@doom_monsta you can find examples in cocos2d.

Here is C++ part, example from cocos2d-x\cocos\platform\android\CCDevice-android.cpp:

extern "C"
{
    /**
    * this method is called by java code to init width, height and pixels data
    */
    JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxBitmap_nativeInitBitmapDC(JNIEnv*  env, jobject thiz, int width, int height, jbyteArray pixels)
    {
        ...
    }
};

Java part, example from cocos2d-x\cocos\platform\android\java\src\org\cocos2dx\lib\Cocos2dxBitmap.java

private static native void nativeInitBitmapDC(final int width,
            final int height, final byte[] pixels);

Thanks I appreciate the response. I think my biggest problem is trying to narrow down the correct path to call that function from then. this is what I have, I feel like some variation of it should work but things like proj.android need to be adjusted somehow because the “.” creates an error.

This is what I have, could you explain to me how to get the proper path?

cocos2dx_projects_game1_projandroid_app_src_org_cocos2dx_cpp_AppActivity_toCpp