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