Android - recommendations lazarus / 43-Android ---------------------------------------------------------------------- grl · 2019-11-24 09:53 Hi @all! I'm planning on porting a small part of our code to android (mostly special calculations, no external references). To make it usable I need some sort of GUI and a possibility to communicate via network (preferrable TCP). There's a lot of information about Lazarus and Android on the net - but most of the howtos around some years old. Then there is that dual way of doing android directly and via JVM. So I'm asking for help here: Has someone recently done a successful project using Lazarus to produce a GUI and communication via TCP? What technology did you use? Any tips where to start? We develop mainly on Linux. So I'd prefer to use that for creating the apks as well - but most of the tutorials use Windows als OS. Any recommendations on that topic as well? Thanks Lukas ---------------------------------------------------------------------- Handoko · 2019-12-06 09:57 There are several options for creating apk using Lazarus. You should try Lazarus Android Module Wizard first, it is the most features-rich and easiest. https://wiki.lazarus.freepascal.org/LAMW I'm not good in network programming. But I managed to write a simple demo android app to communicate with my Linux desktop PC using UDP socket. LAMW has a lot of ready to use components. ---------------------------------------------------------------------- xinyiman · 2019-12-06 11:17 I recently created an android app from linux and to configure the environment I used LAMW_Manager. It made the installation very easy. Look here about it. https://forum.lazarus.freepascal.org/index.php?topic=45361.0 ---------------------------------------------------------------------- Tomi · 2021-04-16 15:27 Hello! I have installed LAMW packages into Lazarus to make Android apps, but when I try make a new Android project, Lazarus shows me that it doesn't support arm-android. How can I solve this problem? Should I install arm CPU with Android OS by fpcupdeluxe? ---------------------------------------------------------------------- Handoko · 2021-04-16 15:52 Most users fail at the installation process, make sure you really installed LAMW correctly. To test it, open a demo that bundled with the LAMW source code, compile and generate the apk, send it to your mobile phone and test it. You should be able to install and run the apk on your mobile phone. If not, probably you haven't installed LAMW correctly. ---------------------------------------------------------------------- DonAlfredo · 2021-04-16 16:15 As there were many request about Android and LAMW, I have added a speed-install option into fpcupdeluxe. This speedbutton will install: FPC + Lazarus stable. LAMW. Android cross-compilers to armv7 and arm64. Just set the install-directory towards an empty directory on your system. Press the Android speedbutton. Sit back and keep fingers crossed. https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/tag/1.8.2s ---------------------------------------------------------------------- ASBzone · 2021-04-16 16:20 Quote from: DonAlfredo on April 16, 2021, 06:15:27 pmSit back and keep fingers crossed. Excellent work, Don.  I must say, though, you had me going.     Just when I thought you were about to say "sit back and relax"...  you take me for a ride instead.  LOL ---------------------------------------------------------------------- Tomi · 2021-04-17 07:42 Quote from: Handoko on April 16, 2021, 05:52:20 pmMost users fail at the installation process, make sure you really installed LAMW correctly. To test it, open a demo that bundled with the LAMW source code, compile and generate the apk, send it to your mobile phone and test it. You should be able to install and run the apk on your mobile phone. If not, probably you haven't installed LAMW correctly. Hello Handoko! I did it on the basis of this video: https://youtu.be/1BH460c9_Aw It seems everything is OK: groups "Android Bridges", "Android Bridges Extra", etc. are appeared, but when I tried make a new LAMW [GUI] Android Module, Lazarus warned me that fpc.exe compiler doesn't support target: arm-android. Therefore I thought that still required to install arm CPU with Android OS by fpcupdeluxe. Although I don't know whether fpcupdeluxe can find automatically the path of Lazarus or I have to type it somewhere? ---------------------------------------------------------------------- Tomi · 2021-04-17 07:47 Quote from: DonAlfredo on April 16, 2021, 06:15:27 pmAs there were many request about Android and LAMW, I have added a speed-install option into fpcupdeluxe. This speedbutton will install: FPC + Lazarus stable. LAMW. Android cross-compilers to armv7 and arm64. Just set the install-directory towards an empty directory on your system. Press the Android speedbutton. Sit back and keep fingers crossed. Hello DonAlfredo! It seems great! But is there a way to install only the required cross- compilers in fpcupdeluxe? I think, FPC, Lazarus and LAMW are not require for me, because these are installed on my system. ---------------------------------------------------------------------- DonAlfredo · 2021-04-17 07:55 Nop. Fpcupdeluxe only works correct for an install made by fpcupdeluxe itself. So, you cannot use it for an install by other means. However. You can use the same tools as those being used by fpcupdeluxe. Binary tools: https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/download/winc rossbins_v1.1/WinCrossBinsAndroidAll.zip https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/download/linu xx64crossbins_v1.1/CrossBinsAndroidAll.zip Libraries: https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/download/cros slibs_v1.1/CrossLibsAndroidAarch64.zip https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/download/cros slibs_v1.1/CrossLibsAndroidARM.zip ---------------------------------------------------------------------- rsu333 · 2021-04-18 06:35 For beginner Laz4android old version is best with example  [2.0.0.0] . Once you get technic of language then use new upgraded which is BEST. ---------------------------------------------------------------------- shyub · 2021-04-18 06:40 If I install "lazarus-2.0.12-fpc-3.2.0-win32.exe" and "lazandroidmodulewizard-master.zip", do I still need to install the compilator for Android and how can I do it? If I want to update "lazandroidmodulewizard-master.zip", do I need to remove the installed LAMW packages or reinstall Lazarus first? ---------------------------------------------------------------------- rsu333 · 2021-04-18 07:31 Configuration Lazarus to android is part of experts, As a jr and want to devolop andr. app , I prefer to install Laz4android ,through LAMW manager, ---------------------------------------------------------------------- Tomi · 2021-04-18 13:19 Quote from: DonAlfredo on April 16, 2021, 06:15:27 pmAs there were many request about Android and LAMW, I have added a speed-install option into fpcupdeluxe. I have download it and install these programs (previously I removed my old Lazarus), and everything seems to be good, but when I try to run my Lazarus program, it warns me that "cannot build APK!" and "Exit code 1". What is wrong with it? Maybe need it an Android emulator too? I have no idea... ---------------------------------------------------------------------- dseligo · 2021-04-18 14:08 Quote from: DonAlfredo on April 16, 2021, 06:15:27 pmAs there were many request about Android and LAMW, I have added a speed-install option into fpcupdeluxe. This speedbutton will install: FPC + Lazarus stable. LAMW. Android cross-compilers to armv7 and arm64. Just set the install-directory towards an empty directory on your system. Press the Android speedbutton. Sit back and keep fingers crossed. https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/tag/1.8.2s I tried 1.8.2s and installation failes: Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i echo '45643' > revision.incC:/LAMW/fpc/bin/x86_64-win64/fpc.exe -Ur -Xs -O2 -n -Fux86_64 -Fusystems -FuC:/LAMW/fpcsrc/rtl/units/x86_64-win64 -Fix86_64 -FE. -FUx86_64/units/x86_64-win64 -dRELEASE -vw-n-h-l-d-u-t- p-c-    -dREVINC -dx86_64 -dGDB -dBROWSERLOG -Fux86 -Sew version.pasversion.pas(94,8) Error: Operator is not overloaded: "ShortString" + "Word"version.pas(100) Fatal: There were 1 errors compiling module, stoppingFatal: Compilation abortedError: C:\LAMW\fpc\bin\x86_64-win64\ppcx64.exe returned an error exitcodemake.exe[1]: *** [cycle] Error 2C:\LAMW\fpcbootstrap\make.exe: *** [compiler_cycle] Error 2fpcupdeluxe: ERROR: FPCCrossInstaller (BuildModuleCustom: FPC): Running cross compiler fpc C:\LAMW\fpcbootstrap\make.exe for aarch64-android failed with an error code.fpcupdeluxe: ERROR: FPCCrossInstaller (BuildModuleCustom: FPC): Removing all aarch64-android compiler settings from fpc.cfg.fpcupdeluxe: info: FPCCrossInstaller (InsertFPCCFGSnippet: fpc.cfg): Inserting snippet in C:\LAMW\fpc\bin\x86_64-win64\fpc.cfg done.  ERROR: Fpcupdeluxe fatal error !Sequencer (FPCCleanBuildOnly): Failure running fpcupdeluxe: error executing sequence FPCCleanBuildOnlySequencer (Only): Failure running fpcupdeluxe: error executing sequence Only Error is here: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function full_version_string:string;begin  full_version_string := version_nr+'.'+release_nr+'.'+patch_nr+minorpatch{$ifdef REVINC}  +'-r'+{$i revision.inc} // <--- error - revision.inc is 45643{$endif REVINC}  ;end;  IntToStr missing? I am on Windows 10. ---------------------------------------------------------------------- Tomi · 2021-04-19 08:01 Now I reinstall Lazarus and after I installed arm-android with fpcupdeluxe, it show me the following error message: ---------------------------------------------------------------------- DonAlfredo · 2021-04-19 08:23 @Tomi Your screenshot shows me that you are using the win64 version of fpcupdeluxe. This is perfectly fine if you want to use it solely for compilation of win64 apps. However, it is NOT recommended when cross-compiling !! So, please perform a NEW install as described previously, in a directory called e.g. win32fpclazlamw. Sorry about this, I should have told you. https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/download/1.8. 2s/fpcupdeluxe-i386-win32.exe ---------------------------------------------------------------------- Tomi · 2021-04-19 09:18 Okay; thanks, DonAlfredo, I will download and try that version of Fpcupdeluxe. Otherwise, somebody know this program? fpc-3.0.0.i386-win32.cross.android I installed it just now, and it made three directory in default c:\FPC folder. In this in the "units" folder there are: arm-android i386-android mipsel-android directories. Is it possible to I would have to copy these into c:\lazarus\units folder to make Lazarus able to support arm-android? Or do I have to compile these somehow after I replaced these folders? ---------------------------------------------------------------------- Tomi · 2021-04-19 13:00 I have download that fpcupdeluxe and install Android LAMW with it, but the situation is the same: it exits during build Android APK with exit code 1...