Sign in Join
Wiki copytemporary

LAMW: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: LAMW

OldNewLine
1+*(Android only)*
2+
3+<figure>
4+<img src="lamw_git_small_circle.png" title="LAMW" />
5+<figcaption>LAMW</figcaption>
6+</figure>
7+
8+**LAMW**: Lazarus Android Module Wizard is a wizard to create JNI Android loadable module (.so) and Android Apk using Lazarus/Free Pascal.
9+
10+**Features:**
11+
12+
13+Native Android GUI
14+
15+
16+
17+AppCompat and Material Design supported!
18+
19+
20+RAD! Form designer and drag&drop component development model!
21+
22+
23+
24+More than 140 components!
25+
26+Github Page: <https://github.com/jmpessoa/lazandroidmodulewizard>
27+
28+## Get Lazarus for Android
29+
30+### Laz4Android 2.0.12 (Windows)
31+
32+
33+All cross-android compilers already installed!
34+
35+
36+arm-android/aarch64-android/i386-android/x86_64-android/jvm-android
37+
38+How to
39+
40+
41+Install * [Laz4Android 2.0.12](http://sourceforge.net/projects/laz4android/files/?source=navbar)
42+
43+> **Note:** Install here: "C:\laz4android2.0.12" (not "Program Files" !!!)
44+
45+
46+Install * [LAMW](https://github.com/jmpessoa/lazandroidmodulewizard/archive/master.zip)
47+
48+> **Note:** Download LAMW and unzip it in some folder (ex. "C:\laz4android2.0.12\components")
49+
50+
51+
52+Packages installations order/sequence:
53+
54+
55+
56+tfpandroidbridge_pack.lpk (in "..../android_bridges" folder)
57+
58+lazandroidwizardpack.lpk (in ""..../android_wizard" folder)
59+
60+amw_ide_tools.lpk (in "..../ide_tools" folder)
61+
62+Go to Infrastructure.
63+
64+### LAMW Manager (Linux and Windows)
65+
66+> **Note:** All in One! LAMW Manage produces a complete Lazarus for Android environment by automating the step Infrastructure!
67+
68+
69+Install * [LAMW Manager Installer for Linux](https://github.com/dosza/LAMWManager-linux)
70+
71+Install * [LAMW Manager Installer for Windows](https://github.com/dosza/LAMWManager-win)
72+
73+### Install LAMW using fpcupdeluxe (Linux and Windows)
74+
75+
76+
77+[How to install on Linux (FPCUPdeluxe + LAMW)](https://wiki.freepascal.org/LAMW_install_linux_fpcupdeluxe)
78+
79+[How to install on Windows (FPCUPdeluxe + LAMW)](https://wiki.freepascal.org/LAMW_install_windows_fpcupdeluxe)
80+
81+### Do It Yourself! (Windows)
82+
83+
84+Install * [Lazarus 2.0.12](https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2064%20bits/Lazarus%202.0.12/lazarus-2.0.12-fpc-3.2.0-win64.exe/download)
85+
86+> **Note:** Install here: "C:\lazarus2.0.12" (not "Program Files" !!!)
87+
88+
89+Install * [LAMW](https://github.com/jmpessoa/lazandroidmodulewizard/archive/master.zip)
90+
91+> **Note:** Download LAMW and unzip it in some folder (ex. "C:\lazarus2.0.12\components")
92+
93+
94+
95+Packages installations order/sequence:
96+
97+
98+
99+tfpandroidbridge_pack.lpk (in "..../android_bridges" folder)
100+
101+lazandroidwizardpack.lpk (in ""..../android_wizard" folder)
102+
103+amw_ide_tools.lpk (in "..../ide_tools" folder)
104+
105+
106+Install * [FPC source code (trunk)](https://gitlab.com/freepascal.org/fpc/source/-/archive/main/source-main.zip)
107+
108+
109+
110+Download FPC source code and unzip it in some folder and point up the source path in next step
111+
112+
113+Go to Lazarus menu "Tools" \>\> "\[LAMW\] Android Module Wizard" \>\> "Build FPC Cross Android"
114+
115+> **Note:** repeat the "Build and install" process once for each architecture
116+
117+
118+
119+\(x\) Armv7a + Soft (android 32 bits \<\< tested!)
120+
121+
122+
123+Build
124+
125+
126+
127+Install
128+
129+
130+
131+\(x\) Aarch64 (android 64 bits \<\< tested!)
132+
133+
134+
135+Build
136+
137+
138+
139+Install
140+
141+> **Note:** After "build" and "install" the cross-compilers and after to do all Infrastructure go to Using LAMW and try to create your first \[New\] LAMW project!
142+
143+
144+If you get an error "Fatal: Cannot find unit system used by fcllaz of package FCL" when trying "Run" \>\> "Build" your project then go to "fpc.cfg" (ex. "C:\lazarus2.0.12\fpc\3.2.0\bin") and:
145+
146+
147+
148+**change:**
149+
150+
151+
152+\#searchpath for units and other system dependent things
153+
154+
155+
156+-FuC:\lazarus2.0.12\fpc\\\$FPCVERSION/units/\$fpctarget
157+
158+
159+
160+-FuC:\lazarus2.0.12\fpc\\\$FPCVERSION/units/\$fpctarget/*
161+
162+
163+
164+-FuC:\lazarus2.0.12\fpc\\\$FPCVERSION/units/\$fpctarget/rtl
165+
166+
167+
168+**to:**
169+
170+
171+
172+\#searchpath for units and other system dependent things
173+
174+
175+
176+-FuC:\lazarus2.0.12\fpc\3.2.0/units/\$fpctarget
177+
178+
179+
180+-FuC:\lazarus2.0.12\fpc\3.2.0/units/\$fpctarget/*
181+
182+
183+
184+-FuC:\lazarus2.0.12\fpc\3.2.0/units/\$fpctarget/rtl
185+
186+
187+And go to Lazarus IDE menu "Tools" \>\> "Options" \>\> "Environment" \>\> \[FPC Source\]
188+
189+
190+
191+**change:**
192+
193+
194+
195+\$(LazarusDir)fpc\\\$(FPCVer)\source
196+
197+
198+
199+**to:**
200+
201+
202+
203+\$(LazarusDir)fpc\3.2.0\source
204+
205+## Infrastructure
206+
207+> **Note:** Only for non-users of LAMW Manager!
208+
209+### Get Java JDK
210+
211+
212+Install * [Java JDK 8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)
213+
214+### Get Android NDK
215+
216+
217+Install * [r19c](https://github.com/android/ndk/wiki/Unsupported-Downloads)
218+
219+### Get Ant builder
220+
221+
222+Install * [Ant](http://ant.apache.org/bindownload.cgi)
223+
224+
225+
226+Simply extract the zip file to a convenient location...
227+
228+### Get Gradle builder
229+
230+
231+Install * [Gradle 6.6.1](https://gradle.org/next-steps/?version=6.6.1&format=bin)
232+
233+> **Note:** Use the option "extract here" to produce the folder "gradle-6.6.1" in a convenient location...
234+
235+### Get Android SDK
236+
237+
238+Install * [r25.2.5-windows](https://dl.google.com/android/repository/tools_r25.2.5-windows.zip)
239+
240+
241+Install * [r25.2.5-linux](https://dl.google.com/android/repository/tools_r25.2.5-linux.zip)
242+
243+
244+Install * [r25.2.5-macosx](https://dl.google.com/android/repository/tools_r25.2.5-macosx.zip)
245+
246+How to
247+
248+
249+unpacked/install to a "sdk" folder
250+
251+
252+open a command line terminal and go to folder "sdk/tools"
253+
254+
255+run the command \>\> "android update sdk" to open a GUI "SDK Manager"
256+
257+
258+
259+Go to \[Tools\] and keep "as is"
260+
261+
262+
263+Android SDK Tools (installed)
264+
265+\(x\) Android SDK Platform-Tools
266+
267+\(x\) Android SDK Build-Tools 29.0.3 (and others more recent)
268+
269+
270+
271+Go to \[Android R\] and uncheck all!
272+
273+
274+
275+Go to \[Android 10 API 29\] uncheck all and check only
276+
277+
278+
279+(x)SDK Platform
280+
281+
282+
283+Go to \[Extras\] and check:
284+
285+
286+
287+(x)Android Support Repository
288+
289+
290+
291+(x)Google USB Drive (Windows only...)
292+
293+
294+
295+(x)Google Repository
296+
297+
298+
299+(x)Google Play Services
300+
301+
302+
303+\[Install 7 package!\]
304+
305+## Using LAMW
306+
307+### Configure Paths
308+
309+
310+Lazarus IDE menu "Tools" \>\> "\[LAMW\] Android Module Wizard" \>\> "Paths Settings ..."
311+
312+> **Note:** MacOs: path to Java JDK auto setting!
313+
314+### Create and Run your first Android Apk
315+
316+How to
317+
318+
319+From Lazarus IDE select "Project" \>\> "New Project"
320+
321+
322+From displayed dialog select "\[LAMW\] GUI Android Module" and "Ok"
323+
324+
325+Fill the form/dialog fields and "Ok"
326+
327+> **Note:** Path to Workspace" is your projects folder
328+
329+> **Note:** Accept "default" options! (but pay attention to the * signage)
330+
331+
332+"Save" unit1 as/where suggested
333+
334+> **Note:** Search your project folder... you will find many treasures there! (look for lazarus project in ".../jni" folder)
335+
336+
337+From Lazarus IDE select "Run" \>\> "Build"
338+
339+
340+
341+**Success!** Your system is up to produce your first Android Apk!
342+
343+
344+Configure your phone device to [debug mode](https://developer.android.com/studio/debug/dev-options) and plug it to the computer usb port
345+
346+
347+From Lazarus IDE select "Run" \>\> "\[LAMW\] Build Apk and Run"
348+
349+
350+
351+**Congratulations!** You are now an Android Developer!
352+
353+## Other references
354+
355+[Tutorial: My First "Hello Word" App](https://github.com/jmpessoa/lazandroidmodulewizard/blob/master/docs/AppHelloWorld.md)
356+
357+---
358+*From the Free Pascal wiki, page "LAMW", as it stood on 2023-05-22 after a change by WayneSherman, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
359+Category: Android
360+Category: Lazarus

Back to history