Hello,
There is a new Android NDK example in the Lazarus CCR. The most important thing that this example adds is that there are precise step-by-step instructions for the entire process and also a full project structure for building it. The instructions cover from configuring the cross-compiler up to installing the APK in the telephone:
http://wiki.lazarus.freepascal.org/Android_Interface/Android_Programming#Build_the_NDK_OpenGL_exampleThe example itself is very simple, and just processes some touch screen inputs and draws some colors in the screen.
It uses JNI and the NativeActivity so it runs on all phones with Android 2.3+ (because the cross-compiler uses soft-float). In this example there is zero Java source code, the NativeActivity does everything that we need. This method is fully sponsored by Google, so applications built like that are really on the safe side.
I am no OpenGL expert, so I don't know yet much about this part, so I just reused older examples for that, but what really amazed me is that I was able to create a project which correctly links to Android native libraries from the NDK, so I gained some knowledge here which I tought people might find useful:
1> Copying .so libraries from the device to link to them is not required, just link against the .so files which are in the NDK
2> Specifying the path to the .so files with -Fl works nicely as described in the example instructions
3> I previously heard from someone that FPC had some initialization issues in Android libs, but I haven't found any in this project (I still have to check if it doesn't appear if I added more units to the uses clause)
4> It is possible to write an application which uses OpenGL and touch screen input with zero Java code =D
5> You need at least ant 1.8 to use the latest Android SDK, so you might need to upgrade your Linux (I had to upgrade from Mandriva 2010 to Mageia 1 for this)
I hope you enjoy,