How to: Create and Run your first "Hello World!" Android App_

  • LAMW: Lazarus Android Module Wizard

  • 1.0) From Lazarus IDE select "Project" -> "New Project"

    • 1.1) From displayed dialog select "[LAMW] GUI Android Module" and "Ok"

    • 1.2) Fill the form/dialog fields and "Ok" and "Save" to path that is showed ...

      • 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)
    • 1.3) From Lazarus IDE select "Run" -> "Build"

      • Success! Your sistem is up to produce your first Android Apk!
    • 1.4) From "Android Bridge" component tab select a jImageView and drop it on Form designer

      • set property: PosRelativeToParent = [rpTop, rpCenterHorizontal]
      • set property: ImageIndentifier = ic_launcher
    • 1.5) From "Android Bridge" component tab select a jTextView and drop it on Form designer

      • set property: PosRelativeToParent = [rpCenterInParent]
      • set property: Text = My First "Hello World!" App
    • 1.6) From "Android Bridge" component tab select a jButton and drop it on Form designer

      • set property: Anchor = jTextView1

      • set property: PosRelativeToAnchor = [raBelow]

      • set property: PosRelativeToParent = [rpCenterHorizontal]

      • set property: LayoutParamWidth = lpTwoThirdOfParent

      • set property: Text = Say Hello!

      • fire event property OnClick and write some code:

        
             SowMessage('Hello Android World!')
        
        
      • 1.7) From Lazarus IDE select "Run" -> "Build"

        • Success! No bugs in the code!
      • 1.8) Configure you phone device to debug mode and plug it to the computer usb port

        • Go to phone Settings -> more/aditional -> Developer options and check:
          • (x) stay awake
          • (x) usb debugging
          • (x) verify apps via usb
      • 1.9) Go to Lazarus IDE menu "Run" -> "[LAMW] Build Apk and Run"

        • Congratulations!
  • 2.0) How to get more/others ".so" chipset builds

    • Google Play require APKs to include both 32 and 64 bits version of LAMW "*.so" libraries
    • From LazarusIDE menu:
      • Project -> Project Options -> Project Options -> [LAMW] Android Project Options -> "Build" -> Chipset [select!] -> [OK]
      • From LazarusIDE menu:
        • Run -> Clean up and Build...
      • From LazarusIDE menu:
        • [LAMW] Build Android Apk and Run
  • 2.1) About LAMW components palettes:

    • [Android Bridges] and [Android Bridges Extra] need only "Ant" builder
    • [Android Bridges AppCompat] and [Android Bridges jCenter] are online libraries and need "Gradle" builder and Internet connection

Others references...

  1. GUI Design WYSIWYG
  2. Multi-Form demo
  3. All GUI demos

🔝🔝