Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2011-04

Compiling android example

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Amit Bueno

http://wiki.lazarus.freepascal.org/Android_Interface/Native_Android_GUI

I've downloaded the example of the android application, done the following:

A. Installed android latest sdk

B. Installed eclipse with the ADT pluging for android

C. Downloaded the TurboChessClock4Android example, from the above link

D. Opened the android project files in eclipse.

And raised the following questions:

A. What do I need in order to compile the pascal portion of the code. (I've already got fpc installed on my windows machine)?

B. How are the java example classes connected to the pascal?

C. What do I need to preform a successful compilation of the android pascal code?

Regards,

Amit

Felipe Monteiro de Carvalho
to Amit Bueno
Amit Bueno wrote
B.      Installed eclipse with the ADT pluging for android

I don't use Eclipse, and therefore the instructions do not cover using it.

ANT is what builds the Java code. You need to have a working installation of ANT and all java packages that it requires. For me this was a huge amount of stuff, which I downloaded via urpmi to my Mandriva Linux. Unfortunatelly I didn't keep track of what I needed to install, but I can say that strange error messages in ant usually ment missing Java packages.

And raised the following questions: A.      What do I need in order to compile the pascal portion of the code. (I've already got fpc installed on my windows machine)?

You will need to have the adequate FPC cross-compiler installed and the adequate cross-binutils configured to produce armv5 binaries. See this wiki page:
http://wiki.lazarus.freepascal.org/Android_Interface#Configuring_the_Free_Pascal_Compiler_for_Android

When that is done, you can open Lazarus, open the LPI file and build. Or else you can call FPC from the command line. I can check which options Lazarus puts in the command line if you want to do that.

B.      How are the java example classes connected to the pascal?

via pipes

C.      What do I need to preform a successful compilation of the android pascal code?

This question repeats question A?

Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho
to Felipe Monteiro de Carvalho

It might be useful to know that I rebased my trunk to a new project, systeminfo4android which is a simple program that I wrote to help me at work. It calculates the reported screen diameter in inches, as well as all data from DisplayMetrics.

I documented this here: http://wiki.lazarus.freepascal.org/Android4Pascal

Updating (if desired, since not much changed) is easy, just copy the *pas and *java files to your project. The java ones of course need to have some stuff renamed as usual.

Felipe Monteiro de Carvalho