dosza / lazandroidmodulewizard

LAMW: Lazarus Android Module Wizard: Form Designer and Components development model!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

N|Solid

LAMW: Lazarus Android Module Wizard

RAD Android! Form Designer and Components Development Model!
  • LAMW is a wizard to create JNI Android loadable module (.so) and Android Apk using Lazarus/Free Pascal.

Version

Features
  • Native Android GUI
    • AppCompat and Material Design supported!
  • RAD! Form designer and drag&drop component development model!
    • More than 140 components!

Getting Started

1. Get Lazarus for Android

  • Option a) Laz4Android 2.0.12 (Windows)

    • All cross-android compilers already installed!
      • arm-android/aarch64-android/i386-android/x86_64-android/jvm-android
      • hint: Install here: "C:\laz4android2.0.12" (not "Program Files" !!!)
    • How to:
      • Install Laz4Android2.0.12
      • Install LAMW
        • Download LAMW and unzip it in some folder
          • recommended folder: "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 "2. Infrastructure".
  • Option b) LAMW Manager

  • Option c) Fpcupdeluxe (Linux and Windows)

  • Option d) How to: Do It Yourself!

    • d.1) Get Lazarus 2.0.12
    • d.2) Install LAMW
      • Download LAMW and unzip it in some folder
        • recommended folder "C:\lazarus2.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)
    • d.3) Get FPC source code (trunk):
      • Unzip it in some folder and point up the source path in step "d.4"
    • d.4) Go to Lazarus menu "Tools" --> "[LAMW] Android Module Wizard" --> "Build FPC Cross Android" and 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
      • hint: After "build" and "install" the cross-compilers and after to do all "2. Infrastructure" go to "3. 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

2. Infrastructure :: only for non-users of "LAMW Manager" !!

2.1 Get Java JDK 8
  • warning: Java JDK > 8 don't support [anymore] "Ant" Apk builder!
2.2 Get Android SDK
  • recommended version for supporting "Ant" and "Gradle" Apk builders
  • hints:
    • 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!
    • on command line terminal go to folder "sdk/tools/bin"
      • run the command >>sdkmanager --update
      • run the command >>sdkmanager "build-tools;30.0.2" "platforms;android-30"
2.3 Get Android NDK
  • recommended version
2.4 Get Ant builder
  • Simply extract the zip file to a convenient location...
2.5 Get Gradle builder
  • recommended version
    • 6.6.1
      • Use the option "extract here" to produce the folder "gradle-6.6.1" in a convenient location...
      • warning: Gradle >= 7 don't supported by LAMW, yet!
      • warning: Gradle 6.x.y don't support Java > 13!
      • warning: Gradle build process need internet connection!!!

3. Using LAMW

  • 3.1) Configure Paths:
    • Lazarus IDE menu "Tools" -> "[LAMW] Android Module Wizard" -> "Paths Settings ..."
      • hint: [MacOs >= 10.5] Path to Java JDK auto setting as: ${/usr/libexec/java_home}
  • 3.2) How to: Create and Run your first Android Apk!
    • 3.2.1) From Lazarus IDE select "Project" -> "New Project"
    • 3.2.2) From displayed dialog select "[LAMW] GUI Android Module" and "Ok"
    • 3.2.3) Fill the displayed form fields and "Ok" and "Save"
      • hint: "Path to Workspace" is your projects folder!
      • hint: Accept "default" options! (but pay attention to the * signage)
      • hint: search your project folder... you will find many treasures there! (look for lazarus project in ".../jni" folder)
    • 3.2.4) From Lazarus IDE select "Run" -> "Build"
      • Success! Your sistem is up to produce your first Android Apk!
    • 3.2.5) Configure you phone device to debug mode and plug it to the computer usb port
    • 3.2.6) From Lazarus IDE select "Run" -> "[LAMW] Build Apk and Run"
      • Congratulations! You are now an Android Developer!

4. Others References

Tutorial: My First "Hello Word" App
"Getting Started" doc
"History and Change Log" doc
Getting Help: Lazarus Forum

N|Solid

About

LAMW: Lazarus Android Module Wizard: Form Designer and Components development model!


Languages

Language:Pascal 69.6%Language:Java 30.3%Language:Kotlin 0.1%