Updated 2019-May-20Building a simple test project:Project | New Project...
LAMW [GUI] Android Module
Set project folder, (ex. /home/user/test)
Automated Build = Gradle
For 32-bit: Architecture/Instructions = ARMv7a + VFPv3
For 64-bit: Architecture/Instructions = Aarch64
Use defaults for other settings
Click OK
Click Save if prompted to save files
Drop a label, edit box, button on the form from Android Bridge Component Tab (jTextView, jEditText, jButton)
Run | Build
From a command line run "gradle_local_build.sh" from the project folder
if successful, your compiled APK files are in ./build/outputs/apk
Installing and Using the Android Emulator:(the method described here uses the command line, another method is to install
Android Studio)
#Install the emulator and a system image
cd ~/android/sdk/tools/bin
./sdkmanager "emulator" "system-images;android-24;default;armeabi-v7a"
(to get a list of system images use ./sdkmanager --list)
#Create some android virtual devices (AVD)
#generic test device
./avdmanager create avd -n "my_test_device" -k "system-images;android-24;default;armeabi-v7a"
#Galaxy Nexus device
./avdmanager create avd -n "Galaxy_Nexus" -d "Galaxy Nexus" -k "system-images;android-24;default;armeabi-v7a"
(to get a list of devices use ./avdmanager list devices)
(after creation, AVD files are stored in: ~/.android/avd/)
#Run the emulator
cd ~/android/sdk/emulator
./emulator -no-snapshot-load -avd "my_test_device" -use-system-libs -gpu swiftshader_indirect
(to get a list of available AVDs, use ./emulator -list-avds)
(note: I had to use -gpu swiftshader_indirect to enable software rendering since I am running inside a virtual machine, more info
here. Inside my VM the emulator was running slow, so if you get any android "Process isn't responding" messages, click "Wait". The emulator was unstable when loading from a snapshot, the workaround is to use -no-snapshot-load)
#Run your project in the emulator:
From a command line run "gradle_local_run.sh",
or from the Lazarus IDE menu select Run | [LAMW] Build Android Apk and Run
How to build demos(still working on it. but have had some success by doing steps below as a 32-bit example):
Open a demo project and change
In
Project | Project Options | Compiler Options | PathsLibraries:/home/[user]/android/sdk/ndk-bundle/platforms/android-27/arch-arm/usr/lib/;/home/[user]/android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/(remove [user] and replace with your user name)
Target File name:../libs/armeabi-v7a/libcontrolsIn
Project | Project Options | Compiler Options | Custom Options-Xd -CfVFPv3 -CpARMV7A -XParm-linux-androideabi- -FD/home/[user]/android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin(remove [user] and replace with your user name)
Run
gradle_local_build.sh from a command line.