Why do you stick 0 at end of file you read?
1) You can avoid OpenGL and use less code to simply draw pixels to window using ANativeWindow_lock/unlockAndPost calls. See native-bitmap example in NDK.
2) There is no need to copy android_app_glue.h/c files to jni folder. No idea how to do that in gradle, but when using NDK makefile systrem (Android.mk
) then you need to simply reference this library with "$(call import-module,android/native_app_glue)" command.