Hey, sorry to piggy back on this thread, but I'm also just doing an introductory look into android, but I'm looking to use the NDK. How feasible is using the NDK? How easy is it to integrate an already made C++ engine to work with Android? I know there is some unavoidable Java code that I'll have to write to query platform features and such, but how intrusive is that code?

I'm an experienced C++ programmer and would really like to target the platform if it doesn't require a whole rewrite of my engine.

I have an engine that is primarily just rendering tech with some additional functionality like cameras, file IO, the like. It's a completely cross platform engine though, and I render using OpenGL, DirectX 9, and DirectX 11. I should be able to fold OpenGL ES into my engine well enough, but I'm worried about rendering not being a clean break from Java. Like how much Java code would I have to write to just get my engine spinning under the hood?

I wish you luck but sharing a bit of my experience its not pretty but I do hope it keeps getting better.

Pros

1. Ease of conversion only real issue was pthread_cancel in my case

2. Excellent performance must faster than java in some heavy cpu encryption cases

Cons

1. With much research I still cannot get a gl context without java

2. Targeting multiple devices is a pain I must be doing something wrong but that leads to 3. Out of the 4 devices in my home apparently there are 3 different types of arm cores which makes sense being some are old and 1 is a media player but I still havent been able to get all of them to work.

3. Horrible docs alot of things are not documented

4. pthread_cancel is non existent and probably more but thats just something my project was using that it cant anymore.

I hope this is just me and not the ndk itself this has just been my experience and I have never compiled for arm devices before maybe someone knowing more can put tell if the cons are just me or not I would be interested to know.

One note about my findings so far I have not done audio so thats a bit scary as the library we were using is not capable and were looking for low level audio im not sure how well it will come out.

I've found using the NDK fairly simple and had very little trouble with it. I'm not using Native Activity but still the amount of Java I have in my codebase is around 20 ~ 30 lines.
There are also several open source engines available that you can look at for inspiration too. Cocos2d-X, gameplay3D and this one:http://www.wrox.com/WileyCDA/WroxTitle/productCd-1119975913,descCd-DOWNLOAD.html
which comes with the programming games and graphicsfor Android. amd iOS book.

I think there is also a cross platform quake port floating around somewhere too.

JoeJ, that sounds amazing. I'm a console developer at work, and I'd really like to be able to still work in Visual Studios without too much hassle. And I have experience with pthread, so I should be able to cross that one off the list.

I hope I can create my OGL context in my code, but if I can't, it's not the end of the world.

I'll have to check out the Nvidia resources and see what they can do for me.

I'm currently using the NDK with SDL2 (ex. 1.3) and it's been a piece of cake. Sure, the debuging options are limited, but so long as you setup some defines for logging (so you can use the logcat) and learn how to use gdb it's not too bad. It helps if you can help your project for a different platform (e.g. Linux or Windows) and debug on there, but this may not be possible depending on what you are doing.

I'm sharing code between Windows, OSX, Linux and Android (all non-NEON devices, as SDL doesn't build correctly for them) at the moment, using CMake to build all of the projects except the Android one - where I use the NDK tools on Linux, but I've tested Cygwin and that works too. Eventually I'll add iOS in the mix, but I thought I'd leave that for a while (this is probably a massive mistake) as I wanted to get on and actually start developing.

At some point I'll clear out all the project specific code and upload a blank project template to bitbucket or github, since it's taken a little bit of work to get it all working, but now it is all setup it's a doddle.

That's great to hear. I've never played around with make files so this should be quite the learning experience, but I'm glad to hear such positive feedback. Another question. I've got a working OpenGL 2.0-3.3 graphics engine, how hard is it to port to Android/iOS. (I know you don't know the code, but just in general)