Android NDK (native) app lifecycle

edited in General
Does anyone have experience with this? There's some example code here, and of course native_app_glue.c, but this stuff is fairly poorly documented and it could be enlightening to have a quick Q&A session with anyone who has tackled this directly before. P.S. I'm not using JNI - this is all via NativeActivity & the native app glue. Even stackoverflow is sparse here.

Comments

  • I dont have experience with the nativeactivity, only JNI. Why do you want to use the nativeactivity instead of JNI? From what I can gather the nativeactivity still makes underlying calls through the JNI. So if its for performance, you might not gain as much as you expect.

    I found this reference which seems to have a better explanation on how to get started with nativeactivty
  • edited
    @petrc Thanks for responding. The engine was already written in C for desktop and I'm adapting it for Android based off the native-activity sample. A good deal of it is working in pure C (rendering, game logic, even input though see below). The main thing outstanding at this stage is managing the lifecycle correctly with respect to EGL surface, context and window. Because there are quite a few lifecycle phases, it's finding out exactly what to do where, specifically re GL stuff.

    EDIT: All sorted. I may post this code on github at some point, in which case I'll post back here.
Sign In or Register to comment.