0% found this document useful (0 votes)
448 views

Lazarus and Android

This document provides step-by-step instructions for setting up tools to create an Android app with Lazarus/Free Pascal, including downloading and installing Java JDK, LazToApk, Lazarus, required packages, the Android SDK, and building a simple "Project1" app that runs on an Android device when deployed. The process takes about 30 minutes and requires about 6GB of free disk space.

Uploaded by

msamuti25
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
448 views

Lazarus and Android

This document provides step-by-step instructions for setting up tools to create an Android app with Lazarus/Free Pascal, including downloading and installing Java JDK, LazToApk, Lazarus, required packages, the Android SDK, and building a simple "Project1" app that runs on an Android device when deployed. The process takes about 30 minutes and requires about 6GB of free disk space.

Uploaded by

msamuti25
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

12.

Dez 2017

Important Note:
A)Please remove previous versions before installing a new version.
B)Installation path containing “SPACE” char's does not work.

What is LazToApk?
To build a piece of software which can be installed on an android device, you
need Java JDK, Android SDK, Android NDK, ANT and laz4android.

LazToApk is a software which will help you to configure all these needed 3 rd-
Party Tools.

What's new?

See changes file .\changes.txt


Content
Step 01: Download&Install JDK.....................................................................................................2
Step 02: Download&Install LazToApk...........................................................................................3
Step 03: Start&Configure LazToApk for the first time...................................................................5
Step 04: Start Lazarus and install packages.....................................................................................6
Step 05: Install LAMW (Lazarus Android Module Wizard)...........................................................7
Step 06: Start SDK-Manager and install API's................................................................................8
Step 07: Restart LazToApk............................................................................................................10
Step 08: Build your first android app.............................................................................................10
Step 09: Run the app......................................................................................................................11

Requirements

• Windows (I tested on WinXP and Win7)


• At least 6GByte free disk space.
• A quick internet connection, because 680MByte needs to be downloaded.
• Recommended: a real Android Device because the Android Emluator is
very slow!

Note: The whole installation may take 30 minutes!

Setup the tools to create an Android App with


Lazarus/Free Pascal

Please follow exactly this instructions, otherwise the chance is very high that
your final app will not work!

I tested on windows xp sp3 and on windows 7.

Step 01: Download&Install JDK

Download latest Java JDK jdk-8uxxx-windows-i586.exe (32bit is


important) from here: → Java JDK 8
Run the downloaded installer.
It will be installed in to <C:\Program Files\Java\>.

Step 02: Download&Install LazToApk

LazToApk → Download the setup from here. (sourceforge.net)

Run the setup.


You can now go for a coffee! No user-action is required the next 20 minutes.
The download took on my machine about 16 Minutes. After the download, the
files will be un-zipped automatically.
At the end of setup the batch-file <build.bat> gets automatically started.
→ laz4android get's compiled. This may take a while and look's something like
this.

Step 03: Start&Configure LazToApk for the first time

The application <LazToApk> will be started.


LazToApk will verify if the folder's for JDK,SDK,NDK,ANT and the tool
lazbuild.exe is available.
If everything went fine, it should look like this:
(If not, then a path setup dialog will show up and you must select the correct path manually.)
Step 04: Start Lazarus and install packages.
Start Lazarus by clicking onto Button <Lazarus>.

The Lazarus IDE should show up. Choose <Package>, <Install/Uninstall


Packages>.

Select the package <CustomDrawn> Select the package


and Press button <Install Selection>. <OnlinePackageManager> and Press
button <Install Selection>.
Press Button <Save and Rebuild IDE>

The Lazarus IDE gets rebuilt and restarted. This may take a while.

Step 05: Install LAMW (Lazarus Android Module Wizard)


Since the development of the CustomDrawn-Components seems to be
“stalled”, I will try to move to LAMW. This move is not finished yet and will only
happen with the help from the community.

Choose <Package> <Online Package Manager>

Select “LAMW” and press “install”.


The package get’s downloaded and installed. After a while the following dialoge
pops up. Press <Yes>.

The Lazarus IDE gets rebuilt and should now have new component-tabs.

Step 06: Start SDK-Manager and install API's


Close Lazarus IDE.
Now LazToApk will look like this. It's time to start the <SDK Manager>.

Select the following packages. (→ you can try some other's but I did not test
with other version's!!!!)
The following dialogs will show up.

Accept Licence and press <Install>.

Just wait, this will take a some time...

Now close the SDK Manager.


Press <OK>
Step 07: Restart LazToApk

Close LazToApk.
Close the setup.
Start LazToApk again.
Connect your android device to the computer. (usb-connection)

Step 08: Build your first android app

Select <USB connected> and


press button „Build&Deploy“.

In the following dialog, define a password for your app and press button <OK>.

The following info message will appear.


You have to enter the same password as before twice in the command windows

and do some more input as requested.


If everything works as expected, then it should look like this:

Well done, the app is now installed.

Step 09: Run the app


Let's run the app. Click onto the following icon:
Then click on „Project1“.

And enjoy your first android application.

You might also like