[Lazarus] Android Target GUI

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Fri Feb 17 08:24:53 CET 2012

On Fri, Feb 17, 2012 at 5:59 AM, Marc Santhoff <M.Santhoff at web.de> wrote:
> I have pretty much no idea of the Android SDK or things, but I
> understand that this target involves compiling the code to Java byte
> code.

Android can run native code too, it runs Linux shared objects. Lazarus
for Android compiles the project as a Linux shared object which is
exactly what many large and successful Android applications do and it
does not use the FPC compiler support for Java. I doubt that the Java
backend would ever support building all the necessary libraries which
the LCL uses or the LCL itself, for example due to the lack of
pointers. Also if that was the case then no 3rd party libraries would
work at all, like LNet. Basically I doubt that there can be any
significant sharing of code here. Also when I started the Java backend
didn't exist.

> How is the GUI specified, is it drawn like building a form or is it made
> by drawing on a canvas in code?

Android applications are full screen apps which respond to events, for
example paint or touch or key event. We redirect all events to
LCL-CustomDrawn common handlers for any platform and it does it's job.
In the paint event we draw every single pixel in Pascal code in our
TLazCanvas surface and send a finished bitmap to Android.

> Or does Lazarus/fpc only generate the event handlers an making a GUI is
> a seperate task for a HTML designer or the like?

HTML!? No, there is no HTML involved.

Felipe Monteiro de Carvalho

More information about the Lazarus mailing list