I am using powervr sdk to draw 3d models on top of my camera view which is created using the vuforia engine.
the entire powervr code is completely native and is called by the android_app_glue. To begin rendering, android_main(struct android_app* state) is called. I want to call this function myself from one of my native functions instead of having it being called onCreate of some NativeActivity.
Android activity life cycle is done in Java, and
android_main
(unlikemain
on Linux/OS X/Windows) is not called by the OS, instead it is called by the Native App Glue, which consists ofandroid.app.NativeActivity
in Java andandroid_native_app_glue.c
in the main library and proxies the events to a separate thread in your native library.The glue is provided only for convenience, you are free not to use the glue at all and to reimplement the functionality by yourself, or you can modify/extend the glue.
So, if you want to use the glue, you may remove the
android_main
call fromandroid_native_app_glue.c
, but make sure the glue is initialized properly before you make your own call toandroid_main
.