So I have been doing this. Porting my android game engine/framework, which was done in Java to pure C++ solution using the NDK
Its a work in progress, but I can successfully create pure native android application that supports a OpenGL ES 2.0 context.
Based on my current experience with this I can definitely say:
Beware though, debugging NDK could be a real a pain in the neck
This is 100% true. I have not been able to debug (step through, step over, set breakpoints, and etc) with the NDK at all. I spend a solid week trying to set up various tools like Visual Studio 2015, Android Studio, and command line version of GDB. But in the end I could never get it working. Right now the
__android_log_print function is my best friend
I don't feel like the native activity is much help really.
....
So I find it easier to avoid any "weird and wonderful" bugs introduced there, and just write my own "native activity"
I'm not sure if you are talking about the android glue header/cpp they included in the NDK here, but that android glue header is kind of questionable. I ended up writing my own version. I felt like mainly the sections dealing with some of the activity callbacks and ALooper code to be spaghetti like/messy. At the very least I understand how all of it works
Tips:
Visual studio 2015Install and download Visual Studio 2015 (community edition is fine) with the cross-platform tools for mobile. I say this only because of the Android emulator seems to be way faster / less laggy than the google one. Also you want, you need that phone from your friend! An emulator can never properly test the way real hardware will handle. Also visual studio comes with a out of box solution that uses an OpenGL context. It is a hugh resource to study from. Its all done in C++ and you can even build/run it on a device.
Now just as a fair warning, visual studio is not all lollipops and rainbows. I actually have never been able to successfully deploy that out of the box solution onto the emulator. I have been able to deploy and run it on my Android 4.2 (API 17) physical device. But when it comes to the emulator it runs into some issue about not being able to find the emulator or something. With that being said I have been able to use the ADB toll through the command line, connect to the emulator, deploy my own native app, and run it
Logcat and __android_log_print functionBest friends ever. All day. Everyday
Honest tipThe NDK can be quite overwhelming. When you run into problems it can be very very unforgiving. Especially because the debugging can be really really rough. Just take a break, step back, and come at it later. The main thing is you keep moving forward, eventually things start to click, and then you'll be really moving before you know it