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