[fpc-pascal] Working Free Pascal android JNI example

Benjamin Jan Alexander Rosseaux benjamin at rosseaux.com
Sat Jul 3 02:37:35 CEST 2010

  Am 02.07.2010 02:11, schrieb Reimar Grabowski:
>  From your mail it is not clear which ld and as you used. I just took them from the Android NDK, you too?
> Unfortunately I currently have no time to play around with your code, 
> but I will as soon as I can.

Under linux I'm using self-built arm binutils, and under windows I'm 
using the YAGARTO "Yet another GNU ARM toolchain", because the original 
android NDK ARM binutils binaries are very buggy, at least the ld linker 
from it.

> Did you try if gdb and gprof are working?

So far when I had time for this :-)

> All in all great work and perhaps you can claim the bounty:
> http://wiki.lazarus.freepascal.org/Bounties#Cross-Compile_to_Android_on_Ubuntu_X64
> My compiler runs on Ubuntu64, so yours should too and with JNI you are able to build real .apks which I think is good enough to claim the bounty.

A lazarus android UI widget set is so far very difficult to make for 
now, because android's UI concept is very different from another UI 
concepts and therefore very difficult to adapt this concept for the LCL 
"in the current state". But a alternative way would be the way over a 
own OpenGL ES based GUI engine for android lazarus apps, but that would 
break the android UI design concept philosophy.

Short: My android JNI freepascal stuff is rather only for to speedup 
some things, for example DSP audio stuff, game rendering/complexlogic 
code, etc. all what will be as Java code a lot of slower than freepascal 
native code, but not for android UI things, sorry.

But Lazarus extending with a plain android JNI features (with automatic 
injecting into a "host Java JNI caller stub" apk and apk resigning) will 
be perharps posssible (for example for freepascal-based Android OpenGL 
ES games and so on, where no native android UI stuff is needed).

Benjamin 'BeRo' Rosseaux

More information about the fpc-pascal mailing list