Call android_main (struct android_app * state) manually?

I use powervr sdk to draw 3d models on top of my camera view, which is created using the vuforia engine.

all powervr code is completely native and is called by android_app_glue. To start rendering, the android_main state (struct android_app *) is called. I want to call this function myself from one of my own functions, instead of having it call onCreate from some NativeActivity.

+3
source share
1 answer

The Android activity life cycle is executed in Java, and android_main(unlike on mainLinux / OS X / Windows) the OS is not called, but the Native App Glue is called, which consists of android.app.NativeActivityJava and android_native_app_glue.cthe main library and proxies events to a separate stream in your native library .

Adhesive is provided for convenience only, you may not use the adhesive at all and not perform the functionality yourself, or you can modify / extend the adhesive.

So, if you want to use glue, you can remove the call android_mainfrom android_native_app_glue.c, but make sure that the glue is initialized correctly before you make your own call android_main.

+1
source

All Articles