Difference between revisions of "LAMW"
From Free Pascal wiki
Jump to navigationJump to search (→See also: New section) |
(A complete LAMW page update!) |
||
Line 3: | Line 3: | ||
{{Platform only|Android|Android|Android}} | {{Platform only|Android|Android|Android}} | ||
− | |||
− | '''LAMW''' is a | + | '''LAMW''': Lazarus Android Module Wizard is a wizard to create JNI Android loadable module (.so) and Android Apk using Lazarus/Free Pascal. |
− | |||
− | + | '''Features:''' | |
− | + | : Native Android GUI | |
− | + | : RAD! Form designer and drag&drop component development model! | |
− | |||
− | + | == Get Lazarus for Android == | |
− | === | + | ===Laz4Android 2.0.12 (Windows)=== |
− | + | : All cross-android compilers already installed! | |
− | + | : arm-android/aarch64-android/i386-android/x86_64-android/jvm-android | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | {{Note|Install here: "C:\laz4android2.0.12" (not "Program Files" !!!)}} | |
− | + | ; How to | |
− | + | : Install * [http://sourceforge.net/projects/laz4android/files/?source=navbar Laz4Android 2.0.12] | |
− | + | : Install * [https://github.com/jmpessoa/lazandroidmodulewizard/archive/master.zip LAMW] | |
− | + | {{Note|Download LAMW and unzip it in some folder (ex. "C:\laz4android2.0.12\components")}} | |
− | + | :: Packages installations order/sequence: | |
− | + | ::: tfpandroidbridge_pack.lpk (in "..../android_bridges" folder) | |
+ | ::: lazandroidwizardpack.lpk (in ""..../android_wizard" folder) | ||
+ | ::: amw_ide_tools.lpk (in "..../ide_tools" folder) | ||
− | + | ; Go to '''Infrastructure'''. | |
− | |||
− | + | ===LAMW Manager (Linux and Windows)=== | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | {{Note|All in One! LAMW Manage produces a complete Lazarus for Android environment by automating the step '''Infrastructure'''!}} | |
− | + | : Install * [https://github.com/dosza/LAMWManager-linux LAMW Manager Installer for Linux] | |
+ | : Install * [https://github.com/dosza/LAMWManager-win LAMW Manager Installer for Windows] | ||
− | |||
− | |||
− | |||
− | + | ===Fpcupdeluxe (Linux and Windows and ...)=== | |
− | + | :: [https://github.com/jmpessoa/lazandroidmodulewizard/tree/master/docs/linux/tutorial_by_waynesherman How to: Linux + Fpcupdeluxe + LAMW] | |
− | |||
− | |||
− | === | + | ===Do It Yourself! (Windows)=== |
− | + | : Install * [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 Lazarus 2.0.12] | |
− | + | : Install * [https://github.com/jmpessoa/lazandroidmodulewizard/archive/master.zip LAMW] | |
− | + | {{Note|Download LAMW and unzip it in some folder (ex. "C:\laz4android2.0.12\components")}} | |
− | + | :: Packages installations order/sequence: | |
− | + | ::: tfpandroidbridge_pack.lpk (in "..../android_bridges" folder) | |
+ | ::: lazandroidwizardpack.lpk (in ""..../android_wizard" folder) | ||
+ | ::: amw_ide_tools.lpk (in "..../ide_tools" folder) | ||
− | [ | + | : Install * [https://gitlab.com/freepascal.org/fpc/source/-/archive/main/source-main.zip FPC source code (trunk)] |
− | + | :: Unzip it in some folder and point up the source path in next step | |
− | |||
− | + | : Go to Lazarus menu "Tools" >> "[LAMW] Android Module Wizard" >> "Build FPC Cross Android" | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | {{Note|repeat the "Build and install" process once for each architecture}} | |
− | + | ::: (x) Armv7a + Soft (android 32 bits << tested! | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | :::: Build | |
− | + | :::: Install | |
− | + | ::: (x) Aarch64 (android 64 bits << tested! | |
− | + | :::: Build | |
− | |||
− | + | :::: Install | |
− | [ | + | {{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!}} |
− | + | :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: | |
− | + | :: '''change:''' | |
− | + | ::: #searchpath for units and other system dependent things | |
− | + | ::: -FuC:\lazarus2.0.12\fpc\$FPCVERSION/units/$fpctarget | |
− | + | ::: -FuC:\lazarus2.0.12\fpc\$FPCVERSION/units/$fpctarget/* | |
+ | |||
+ | ::: -FuC:\lazarus2.0.12\fpc\$FPCVERSION/units/$fpctarget/rtl | ||
− | + | :: '''to:''' | |
− | + | ::: #searchpath for units and other system dependent things | |
− | + | ::: -FuC:\lazarus2.0.12\fpc\3.2.0/units/$fpctarget | |
− | + | ::: -FuC:\lazarus2.0.12\fpc\3.2.0/units/$fpctarget/* | |
− | + | ::: -FuC:\lazarus2.0.12\fpc\3.2.0/units/$fpctarget/rtl | |
− | |||
− | |||
− | + | ||
+ | : And go to Lazarus IDE menu "Tools" >> "Options" >> "Environment" >> [FPC Source] | ||
− | + | ::'''change:''' | |
− | + | ::: $(LazarusDir)fpc\$(FPCVer)\source | |
− | + | :: '''to:''' | |
+ | |||
+ | ::: $(LazarusDir)fpc\3.2.0\source | ||
+ | |||
− | + | ==Infrastructure== | |
− | + | {{Note|Only for non-users of LAMW Manager!}} | |
− | + | ===Get Java JDK=== | |
+ | : Install * [http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html Java JDK 8] | ||
− | + | ===Get Android NDK=== | |
+ | : Install * [https://github.com/android/ndk/wiki/Unsupported-Downloads r19c] | ||
− | + | ===Get Ant builder=== | |
+ | : Install * [http://ant.apache.org/bindownload.cgi Ant] | ||
− | + | :: Simply extract the zip file to a convenient location... | |
− | + | ===Get Gradle builder=== | |
+ | : Install * [https://gradle.org/next-steps/?version=6.6.1&format=bin Gradle 6.6.1] | ||
− | + | {{Note|Use the option "extract here" to produce the folder "gradle-6.6.1" in a convenient location...}} | |
− | + | ===Get Android SDK=== | |
+ | : Install * [https://dl.google.com/android/repository/tools_r25.2.5-windows.zip r25.2.5-windows] | ||
− | + | : Install * [https://dl.google.com/android/repository/tools_r25.2.5-linux.zip r25.2.5-linux] | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | [ | + | : Install * [https://dl.google.com/android/repository/tools_r25.2.5-macosx.zip r25.2.5-macosx] |
− | + | ; How to | |
− | + | : unpacked/install to a "sdk" folder | |
− | + | : open a command line terminal and go to folder "sdk/tools" | |
− | + | : run the command >> "android update sdk" to open a GUI "SDK Manager" | |
− | + | :: Go to [Tools] and keep "as is" | |
− | + | ::: Android SDK Tools (installed) | |
+ | ::: (x) Android SDK Platform-Tools | ||
+ | ::: (x) Android SDK Build-Tools 29.0.3 (and others more recent) | ||
− | + | :: Go to [Android R] and uncheck all! | |
− | + | :: Go to [Android 10 API 29] uncheck all and check only | |
− | + | ::: (x)SDK Platform | |
− | : | + | :: Go to [Extras] and check: |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | ::: (x)Android Support Repository | |
− | + | ::: (x)Google USB Drive (Windows only...) | |
− | + | ::: (x)Google Repository | |
− | + | ::: (x)Google Play Services | |
− | + | :: [Install 7 package!] | |
− | |||
− | + | ==Using LAMW== | |
− | + | ===Configure Paths=== | |
− | + | : Lazarus IDE menu "Tools" >> "[LAMW] Android Module Wizard" >> "Paths Settings ..." | |
− | + | ||
− | + | {{Note|MacOs: path to Java JDK auto setting!}} | |
− | |||
− | |||
− | |||
− | + | ===Create and Run your first Android Apk=== | |
− | + | ; How to | |
− | + | : From Lazarus IDE select "Project" >> "New Project" | |
− | + | : From displayed dialog select "[LAMW] GUI Android Module" and "Ok" | |
− | |||
− | + | : Fill the form/dialog fields and "Ok" and "Save" | |
− | + | {{Note|Path to Workspace" is your projects folder}} | |
− | + | {{Note|Accept "default" options! (but pay attention to the * signage)}} | |
+ | |||
+ | : From Lazarus IDE select "Run" >> "Build" | ||
− | + | :: '''Success!''' Your system is up to produce your first Android Apk! | |
− | |||
− | + | : Configure you phone device to debug mode and plug it to the computer usb port | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | : From Lazarus IDE select "Run" >> "[LAMW] Build Apk and Run" | |
− | + | :: '''Congratulations!''' You are now an Android Developer! | |
− | |||
− | == | + | ==Others References== |
− | + | [https://github.com/jmpessoa/lazandroidmodulewizard/blob/master/docs/AppHelloWorld.md Tutorial: My First "Hello Word" App] | |
[[category:Android]] | [[category:Android]] |
Revision as of 10:08, 11 December 2021
│ English (en) │ polski (pl) │ русский (ru) │
This article applies to Android only.
See also: Multiplatform Programming Guide
LAMW: Lazarus Android Module Wizard is a wizard to create JNI Android loadable module (.so) and Android Apk using Lazarus/Free Pascal.
Features:
- Native Android GUI
- RAD! Form designer and drag&drop component development model!
Get Lazarus for Android
Laz4Android 2.0.12 (Windows)
- All cross-android compilers already installed!
- arm-android/aarch64-android/i386-android/x86_64-android/jvm-android
Note: Install here: "C:\laz4android2.0.12" (not "Program Files" !!!)
- How to
- Install * Laz4Android 2.0.12
- Install * LAMW
Note: Download LAMW and unzip it in some folder (ex. "C:\laz4android2.0.12\components")
- Packages installations order/sequence:
- tfpandroidbridge_pack.lpk (in "..../android_bridges" folder)
- lazandroidwizardpack.lpk (in ""..../android_wizard" folder)
- amw_ide_tools.lpk (in "..../ide_tools" folder)
- Go to Infrastructure.
LAMW Manager (Linux and Windows)
Note: All in One! LAMW Manage produces a complete Lazarus for Android environment by automating the step Infrastructure!
- Install * LAMW Manager Installer for Linux
- Install * LAMW Manager Installer for Windows
Fpcupdeluxe (Linux and Windows and ...)
Do It Yourself! (Windows)
- Install * Lazarus 2.0.12
- Install * LAMW
Note: Download LAMW and unzip it in some folder (ex. "C:\laz4android2.0.12\components")
- Packages installations order/sequence:
- tfpandroidbridge_pack.lpk (in "..../android_bridges" folder)
- lazandroidwizardpack.lpk (in ""..../android_wizard" folder)
- amw_ide_tools.lpk (in "..../ide_tools" folder)
- Install * FPC source code (trunk)
- Unzip it in some folder and point up the source path in next step
- Go to Lazarus menu "Tools" >> "[LAMW] Android Module Wizard" >> "Build FPC Cross Android"
Note: repeat the "Build and install" process once for each architecture
- (x) Armv7a + Soft (android 32 bits << tested!
- Build
- Install
- (x) Aarch64 (android 64 bits << tested!
- Build
- Install
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!
- 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:
- change:
- #searchpath for units and other system dependent things
- -FuC:\lazarus2.0.12\fpc\$FPCVERSION/units/$fpctarget
- -FuC:\lazarus2.0.12\fpc\$FPCVERSION/units/$fpctarget/*
- -FuC:\lazarus2.0.12\fpc\$FPCVERSION/units/$fpctarget/rtl
- to:
- #searchpath for units and other system dependent things
- -FuC:\lazarus2.0.12\fpc\3.2.0/units/$fpctarget
- -FuC:\lazarus2.0.12\fpc\3.2.0/units/$fpctarget/*
- -FuC:\lazarus2.0.12\fpc\3.2.0/units/$fpctarget/rtl
- And go to Lazarus IDE menu "Tools" >> "Options" >> "Environment" >> [FPC Source]
- change:
- $(LazarusDir)fpc\$(FPCVer)\source
- to:
- $(LazarusDir)fpc\3.2.0\source
Infrastructure
Note: Only for non-users of LAMW Manager!
Get Java JDK
- Install * Java JDK 8
Get Android NDK
- Install * r19c
Get Ant builder
- Install * Ant
- Simply extract the zip file to a convenient location...
Get Gradle builder
- Install * Gradle 6.6.1
Note: Use the option "extract here" to produce the folder "gradle-6.6.1" in a convenient location...
Get Android SDK
- Install * r25.2.5-windows
- Install * r25.2.5-linux
- Install * r25.2.5-macosx
- How to
- unpacked/install to a "sdk" folder
- open a command line terminal and go to folder "sdk/tools"
- run the command >> "android update sdk" to open a GUI "SDK Manager"
- Go to [Tools] and keep "as is"
- Android SDK Tools (installed)
- (x) Android SDK Platform-Tools
- (x) Android SDK Build-Tools 29.0.3 (and others more recent)
- Go to [Android R] and uncheck all!
- Go to [Android 10 API 29] uncheck all and check only
- (x)SDK Platform
- Go to [Extras] and check:
- (x)Android Support Repository
- (x)Google USB Drive (Windows only...)
- (x)Google Repository
- (x)Google Play Services
- [Install 7 package!]
Using LAMW
Configure Paths
- Lazarus IDE menu "Tools" >> "[LAMW] Android Module Wizard" >> "Paths Settings ..."
Note: MacOs: path to Java JDK auto setting!
Create and Run your first Android Apk
- How to
- From Lazarus IDE select "Project" >> "New Project"
- From displayed dialog select "[LAMW] GUI Android Module" and "Ok"
- Fill the form/dialog fields and "Ok" and "Save"
Note: Path to Workspace" is your projects folder
Note: Accept "default" options! (but pay attention to the * signage)
- From Lazarus IDE select "Run" >> "Build"
- Success! Your system is up to produce your first Android Apk!
- Configure you phone device to debug mode and plug it to the computer usb port
- From Lazarus IDE select "Run" >> "[LAMW] Build Apk and Run"
- Congratulations! You are now an Android Developer!