New laz4android2.0.12 ! lazarus / 43-Android ---------------------------------------------------------------------- truetom · 2021-11-22 23:35 Hello all, New version laz4android2.0.12-FPC3.2.0 released. You can download from here: http://sourceforge.net/projects/laz4android/ Laz4Android is a Lazarus for Android Package. Thanks the FreePascal team and the Lazarus team. Now Laz4Android is only run on Windows.Sorry for this! I recommend using laz4android + LAMW(Lazarus Android Module Wizard) to develop android apps. LAMW on this: https://github.com/jmpessoa/lazandroidmodulewizard http://forum.lazarus.freepascal.org/index.php/topic,21919.0.html --------------------------------------------------------- Last update:2021-11-22 FPC: 3.2.0 (win32/win64/arm- android/aarch64-android/i386-android/x86_64-android/jvm-android) Lazarus:2.0.12 Android NDK: r19c 1.Update to Lazarus 2.0.12 source + FPC 3.2.0 2.Update to Android NDK r19c 3.Add Win64, aarch64-android, x86_64-android ========================================================= How to install Laz4Android? 1.You can download a installer file from here: http://sourceforge.net/projects/laz4android/files/?source=navbar - Double click the installer file - Next , Next to finished. --------------------------------------------------------- 2.You can download a 7z compressed file from here: http://sourceforge.net/projects/laz4android/files/?source=navbar - Unzip 7z file to e.g. c:\laz4android - Please run build.bat (double click it), it will compile and build laz4android. ========================================================= Thanks and best regards! ---------------------------------------------------------------------- rsu333 · 2021-11-23 14:15 Thank you for this great achivement. ---------------------------------------------------------------------- nouzi · 2021-11-23 15:32 thanks ---------------------------------------------------------------------- AlexTP · 2021-11-23 17:45 @truetom Since I don't find the wiki topic about the project, can you write it (you may write just here on the forum too)? ---------------------------------------------------------------------- Blade · 2021-11-23 19:03 Thanks. Good to see. ---------------------------------------------------------------------- jmpessoa · 2021-11-23 23:46 TrueTom came back! Great news! Very happy with your new "laz4android2.0.12-FPC3.2.0" announcement! Thank you! ---------------------------------------------------------------------- jmpessoa · 2021-12-10 03:25 For those who prefer "laz4android2.0.12" as a single window IDE (Docking) Here are my experiment, based on the @PascalDragon reported here: https://forum.lazarus.freepascal.org/index.php/topic,51023.msg374103.h tml#msg374103 Step 1: Go to IDE menu "Package" -> "Open Package File (*.lpk) ..." open "sparta_generics.lpk" in folder "C:\laz4android2.0.12\components\sparta\generics" and "Remove" all units.... until you get an empty package (image_1)! Step 2: Go to IDE menu "Package" -> "Install/Unistall Packages ..." Select "AnchorDockingDsgn" in the right panel and click "Install selection" and then "Save and rebuild IDE" ....wait until IDE restart Step 3: Go to IDE menu "Package" -> "Install/Unistall Packages ..." Select "sparta_dockedformeditor" in the right panel and click "Install selection" and then "Save and rebuild IDE" ....wait until IDE restart, but if you got some error then try "Step 4"! Step 4: Go to IDE menu "Tools" -> "Configure Build lazarus" and configure as "Image_2" and click "Build" ....wait until IDE restart Success! Now you have a nice single window "Lazarus IDE (Image_3)"! ---------------------------------------------------------------------- dbannon · 2021-12-10 06:01 OK, as an outsider looking in, can I please ask for an over view of the Lazarus for Android model ? As I understand it there is - LAMW https://github.com/jmpessoa/lazandroidmodulewizard - is the core 'product' but it depends on a heap of other things. LAMW Managers help solve the "heap of other things" issue, there are separate Windows https://github.com/dosza/LAMWManager-win and Linux https://github.com/dosza/LAMWManager-linux ones and they will install the pretty extensive stacks of requirements. And we have laz4android (Windows only) - OK, as a Linux user, what am I missing out on by not being able to use laz4android ? It has some nice screen shots on its sourceforge site but just "Laz4Android is a Lazarus for Android Package" - not a word about what it actually does ? Where does it fit into the above... It does sound like we have available a viable Android system available to us (and thats brilliant), but outsiders really need an overview to understand where to start. Davo ---------------------------------------------------------------------- jmpessoa · 2021-12-10 06:17 Hi, dbannon! Yes, there are many ways to get your Lazarus "for Android" 1) Laz4Android 2.0.12 (only Windows) 2) LAMW Manager (Linux and Windows) A complete solution (that is, LAMW Manager is the only that produce a Lazarus "for Android" IDE and install all requirements!) 3) Fpcupdeluxe (Linux and Windows and ...) 4) Do It Yourself! you can get some details here (readme.md): https://github.com/jmpessoa/lazandroidmodulewizard ---------------------------------------------------------------------- dbannon · 2021-12-10 06:32 Quote from: jmpessoa on December 10, 2021, 07:17:25 am.... you can get some details here (readme.md): https://github.com/jmpessoa/lazandroidmodulewizard Ah, thanks jmpessoa, laz4android is, sort of, an alternative to the LAWM Managers then ? Brilliant ! And I had already read your docs, and found them clear and reasonably complete. I reckon the FPC/Lazarus wiki should not try to document your processes, just have that overview and point to your document. I am not sure pointing to Forum posts is a good idea, forums can lack focus sometimes :-) Davo ---------------------------------------------------------------------- MarkMLl · 2021-12-10 08:09 Quote from: dbannon on December 10, 2021, 07:32:18 amAh, thanks jmpessoa, laz4android is, sort of, an alternative to the LAWM Managers then ? Brilliant ! Yes, but what do these things DO, why is one needed, and why should any one be preferred over the others? MarkMLl ---------------------------------------------------------------------- dbannon · 2021-12-10 11:09 Exactly Mark, I said the same thing a few posts up. I think we need someone who has not done any Android programing, hates Java, who can just muddle through a bit of basic Pascal code, likes writing documentation and, of course, has plenty of time on their hands, to try and install one of these stacks, and document their experiences. I'll let you know how I go. Don't hold your breath .... Davo ---------------------------------------------------------------------- loaded · 2021-12-10 11:34 Since I use LAMW Manager, I want to talk about it. It provides you a turnkey solution for Android application development. It contains; LAZARUS IDE+LAMW PACKAGE +JAVA JDK+ANDROID SDK AND NDK + ANT AND GRADLE All these are installed on your system without any hassle. It's like a pascal version of Android Studio. Then you can start developing applications directly on your android device. (Perhaps a few minor adjustments may be needed.) If you say I have to handle everything myself. After installing the LAMW package on Lazarus, the components that LAMW needs are available in the attached picture. You can also work by downloading it yourself from the internet and then making the adjustments in the picture. ---------------------------------------------------------------------- MarkMLl · 2021-12-10 11:51 Quote from: loaded on December 10, 2021, 12:34:31 pmIt's like a pascal version of Android Studio. What's Android Studio? Sorry, but I'm intentionally acting dumb there for the purpose of documentation. I know it's some sort of IDE, but don't know what it or LAMW etc. produce as executables. A couple of weeks ago I gained some Panasonic Toughbook tablets plus a dock, and I'm told that one of the more useful OSes that can be put on them is Android (8?). So yesterday I checked whether FPC supported i386+Android as a target and was interested to note that it did... then immediately found myself in a maze of twisty little wiki pages with no clear overview. MarkMLl ---------------------------------------------------------------------- loaded · 2021-12-10 12:06 I'm sorry for the fact that my technical explanation is close to zero. Quote from: MarkMLl on December 10, 2021, 12:51:38 pmWhat's Android Studio? Written and published by Google; It is an application development environment for Android operating systems. It is available in the IDE and all the other necessary stuff. In LAMW Manager, I made a similar analogy to the above, as it helps download and install the IDE and all other things. If your operating system is windows, it will take you 45 minutes at most to download and test it to the C: Drive and run the first hello world application.I am also developing an application for Android 8 version. ---------------------------------------------------------------------- MarkMLl · 2021-12-10 12:18 Quote from: loaded on December 10, 2021, 01:06:51 pm(Android Studio is) an application development environment for Android operating systems. It is available in the IDE and all the other necessary stuff. In LAMW Manager, I made a similar analogy to the above, as it helps download and install the IDE and all other things. If your operating system is windows, it will take you 45 minutes at most to download and test it to the C: Drive and run the first hello world application.I am also developing an application for Android 8 version. Right. So what you're saying is that both Android Studio and LAMW automate getting the right binutils etc. What sort of executable is produced? Are they both oriented towards Java bytecodes? If somebody wanted native machinecode would one of the other tools give him that option? I've run FPC on a tablet before, so know it can be done... Oh, and I'm afraid that I've barely touched windows for 20 years. I've been using Linux etc. since before most people had soundcards (in particular, since before they had a working soundcard under Linux) so I'm afraid that I pronounce "Linux" in the non-approved way :-) MarkMLl ---------------------------------------------------------------------- loaded · 2021-12-10 13:09 Quote from: MarkMLl on December 10, 2021, 01:18:13 pmRight. So what you're saying is that both Android Studio and LAMW automate getting the right binutils etc. You're right, just like that There are 2 executable file extensions on Android. -I use; apk file produced in LAMW. I don't know much about the technical details. In fact, when a compressed file is opened, there are files in binary format with dex extension and in other formats. -At the same time; There are new generation aab files that I haven't used yet. I know that this format is necessary for the application to be uploaded to the Google Play Store. Quote from: MarkMLl on December 10, 2021, 01:18:13 pmOh, and I'm afraid that I've barely touched windows for 20 years. I've been using Linux etc. since before most people had soundcards (in particular, since before they had a working soundcard under Linux) so I'm afraid that I pronounce "Linux" in the non-approved way :-) In fact, I believe that you will write legendary applications with your current experience. For anyone interested; My First Android App with Lazarus; Hello World https://youtu.be/Yumg_gfj1GE ---------------------------------------------------------------------- h-elsner · 2021-12-10 15:13 QuoteI think we need someone who has not done any Android programing, hates Java, who can just muddle through a bit of basic Pascal code, likes writing documentation and, of course, has plenty of time on their hands, to try and install one of these stacks, and document their experiences. - not done Adroid programming: yes - hate Java: yes! - bit of basic Pascal: let's see - like writing doc: not really - has time: yes, I'm retired. I will start testing laz4android and comment soon. br HE ---------------------------------------------------------------------- jmpessoa · 2021-12-10 16:18 QuoteSo yesterday I checked whether FPC supported i386+Android as a target and was interested to note that it did... Yes! FPC (and LAMW) support: arm- android/aarch64-android/i386-android/x86_64-android/ and you can wrapper all these in your executable Apk/bundle package.... (in fact, lamw/fpc will produce one (or more) ".so" library that is/are added together with all java ".dex" stuff!) Edited: in the ".so" [lamw project] you can code "almost" all FPC/RTL/FCL! (but not LCL!) QuoteI will start testing laz4android and comment soon. Welcome! ---------------------------------------------------------------------- dbannon · 2021-12-10 23:04 Quote from: h-elsner on December 10, 2021, 04:13:48 pmI will start testing laz4android and comment soon. br HE Excellent, what OS do you use br HE ? I am a Linux user and will try, time permitting, to do the same on Linux so we should compare notes. My model will be to install in a Virtual Box VM (I'm using Debian Bullseye) we will almost certainly make mistakes along the way and being able to easily blow it away and start again is important. Take copious notes as you go ... Happy to work on the Wiki ? Davo ---------------------------------------------------------------------- h-elsner · 2021-12-11 09:33 Environment: Windows 10 Pro 64bit, Version 2004, Build 19041.1348 Windows Feature Experience Pack 120.2212.3920.0 CPU Intel Core I7-2600K RAM 12GB Install: Install laz4android with Windows installer, tested with this file "laz4android2.0.12-FPC3.2.0.exe" Windows Defender claims an unknown app as risc, you need to allow an exception to install "laz4android2.0.12-FPC3.2.0". Setup needs some time, be patient. Installation wizard as usual, no problems. First start of laz4android: Splash screen and nothing happens (see attached pic) It looks like laz4android needs to be started as Administrator. This works. Now I try to create a small project. br HE ---------------------------------------------------------------------- dseligo · 2021-12-11 14:39 This is my experience installing LAMW with LAMW Manager and first run of 'Hello world' application after installation (and some recollections of installation with FPCUPdeluxe I did couple of months ago). On my main computer I already have LAMW installed using FPCUPdeluxe. As I recall, I had quite a few problems with setting it up. It's possible that was caused since I had Android Studio already installed and I had issues with paths (Java, SDK, NDK, ..., I don't remember). I also had issues with Android emulator (I had some license agreement unconfirmed or something). When I solved this, emulator was working really slow. To solve this I installed Virtual device with Intel Atom (x86_64) ABI. Then I had some issues with Hyper-V in Windows (I think I had to disable it). Back to LAMW Manager. OS used is Windows 10, it has no Lazarus or Java or similar on it before. I recorded the videos of installation and first run, so I can upload them somewhere if somebody is interested. Installation went smooth and it was completely uneventful. After installation, I noticed that Lazarus version installed with LAMW Manager is 2.3.0, while the one installed with FPCUPdeluxe is 2.0.12. When I first ran new project, Lazarus gave errors when I wanted to create events for form or button with double clicking. I solved this by going to Project/Project Options/[LAMW] Android Project Options/Build, then I chose Chipset and press OK. After compiling (Ctrl+F9), creating events started to work fine. On my other computer (where I have LAMW with Lazarus 2.0.12) I don't have this problem. After that I wanted to run apk in emulator (Project/[LAMW] Build Android Apk and Run). I couldn't install any emulator - when creating new Android Virtual Device there is no CPU/ABI to choose from (it says 'No system images installed for this target'). Probably I did that separately on other computer, but I don't remember. Target x86_64-android isn't available in Lazarus, which is important if I one want to use Intel Atom (x86_64) ABI. So, to test 'Hello world' I connected phone, installed apk (Project/[LAMW] Build Android Apk and Run) and it worked (actually, that was in second attempt, after I remembered to look at phone's screen and allow access from computer). Overall, installing LAMW with LAMW Manager is very easy since I didn't have to look for various Android stuff and install it separately. It would be nice to have little more control over what and where exactly is installing (e.g. installation directory, Lazarus version - trunk or stable). It would be great if it is possible for LAMW Manager to also install necessary stuff to make emulator work out of the box. This was probably my longest post on this forum. P.S.: Size on disk for C:\lamw_manager directory is 8,48GB. ---------------------------------------------------------------------- engkin · 2021-12-11 17:43 Quote from: dseligo on December 11, 2021, 03:39:59 pmP.S.: Size on disk for C:\lamw_manager directory is 8,48GB. There must be a better way. ---------------------------------------------------------------------- loaded · 2021-12-11 18:06 Quote from: engkin on December 11, 2021, 06:43:05 pmThere must be a better way. I think this size is very normal because there isn't any AVD, because Android itself is a memory and disk monster. All the weight is in SDKs and NDKs. If you add emulators to this number, you will see huge numbers. In Android studio, I saw that this number increased to 30 GB. ---------------------------------------------------------------------- af0815 · 2021-12-11 18:20 Quote from: engkin on December 11, 2021, 06:43:05 pmQuote from: dseligo on December 11, 2021, 03:39:59 pmP.S.: Size on disk for C:\lamw_manager directory is 8,48GB. There must be a better way. Do you know, what is included in this directory ? A complete fpc/Lazarus installation and NDK and SDK from android, with the needed tools. If you have more than one sdk/ndk the size will increase more. I had installed this and see what is happens. The size of the android part is big. A working fpc/Lazarus installation have on my system 3.9 GB with some cross enviroments. With a lot of cross enviroments i can have 7 GB. All needed libs from the targets included. So 8GB ist nothing for discussion for me. ---------------------------------------------------------------------- zeljkoc · 2021-12-12 05:39 To make an apk, pascal4android only needed java, and Directory of C:\Program Files\Pascal4Android\android-tools 12/12/2021 06:35 AM