May I ask if it is possible to completely avoid java code (expect for the jdk and ndk stuff)? Many example projects, including the LCL example itself, has a bunch of java code. I would love a 100% free pascal alternative to build apps/apks. I am pretty sure I am missing the overall strategy here. If would appreciate if someone could explain what is happening here. Is it some sort of pascal binding for the java api? Or the other way around?
Yes, by using
NativeActivity. This is however, is meant for you-draw-everything-yourself apps, like games. In other words, you don't get access to android GUI libraries, draw everything yourself using OpenGL ES. Another way is to use FPC JVM, but I consider this as separate environment, it's like coding Java using Pascal syntax. The amount of code you can reuse with this method is considerably low.
All existing approaches use the same base and recommended way to access Java code from other languages: JNI. But instead of directly interface with Android libraries, another wrapper is made for possibly unbounded reasons: ease of use, componentization (to make it more similar to LCL, thus allowing form designer to be used), etc. that will be harder to do if the interface is plainly done. You can check the Java code yourself, as it's normally only 2 small files (one for bootstrapping as required by Android runtime if you want to use its GUI libraries, another one for wrapping functionalities to make it simpler and easier to use).