Recent

Author Topic: [HowTo] Android Development Environment on Linux (FPCUPdeluxe + LAMW)  (Read 41069 times)

HobbyDev

  • New Member
  • *
  • Posts: 25
Re: [HowTo] Android Development Environment on Linux (FPCUPdeluxe + LAMW)
« Reply #15 on: April 18, 2018, 09:52:38 pm »
Hmm - didn't work - unfotunatly. I startet withe this first package, everything worked fine "linking lazarus" was the last message I saw, then Lazarus restartet but all I got is the into-picture, nothing else. In Terminal I get a lot of information, here are just the last lines...
Quote
Exception at 0000000000000000: EAccessViolation:
Access violation.
TApplication.HandleException Access violation
  Stack trace:
  $00007F0ECCADF27F
Exception at 00007F0ECCADF27F: EAccessViolation:
Access violation.
LAZARUS END - cleaning up ...
[FORMS.PP] ExceptionOccurred
  Sender=EAccessViolation
  Exception=Access violation
  Stack trace:
  $00007F0ECCACACD8
TApplication.HandleException Access violation
  Stack trace:
  $00007F0ECCACACD8
Exception at 00007F0ECCACACD8: EAccessViolation:
Access violation.
retrying the packeage installation doesn't help. Good night for today!

WayneSherman

  • Full Member
  • ***
  • Posts: 243
Re: [HowTo] Android Development Environment on Linux (FPCUPdeluxe + LAMW)
« Reply #16 on: April 19, 2018, 06:28:36 am »
Updated installation procedure to 2018-Apr-18 ver 0.9:
(see first post)
1) Add gdb and wget to package install
2) More simplification, only creating one symlink instead of four (also required adjustment to the LAMW NDK path)
3) Regarding which versions of FPC and Lazarus to install using FPCUPdeluxe, see "> 45" comments in post #2.
4) Tested on Manjaro Linux and added changes required for that distro.
« Last Edit: April 19, 2018, 06:55:40 am by WayneSherman »

HobbyDev

  • New Member
  • *
  • Posts: 25
Re: [HowTo] Android Development Environment on Linux (FPCUPdeluxe + LAMW)
« Reply #17 on: April 21, 2018, 10:40:00 pm »
Well done! Pretty good job you have done! :D

Im almost through! The last point I have is, when creating the test project I get the failure message that I  have to install sdk 26.x.y. But if I try
Code: [Select]
$ ./sdkmanager "26.0.2"I get
Code: [Select]
Warning: Failed to find package 26.0.2I checked the directory
Code: [Select]
/home/user/Android/android-sdk/platforms/android-26/ and there is some stuff in there. I also checked the path settings inside Lazarus again and they the sdk- path points to /home/user/Android/android-sdk
What else can I do?
Many Thanks so far!

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: [HowTo] Android Development Environment on Linux (FPCUPdeluxe + LAMW)
« Reply #18 on: April 21, 2018, 11:08:29 pm »

Try:

./sdkmanager "platforms;android-26" "build-tools;26.0.3"

Quote
I checked the directory ...

You need check the folder:

/home/user/Android/android-sdk/build-tools/

and see if there is some "26.x.x"  there....
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

HobbyDev

  • New Member
  • *
  • Posts: 25
Re: [HowTo] Android Development Environment on Linux (FPCUPdeluxe + LAMW)
« Reply #19 on: April 21, 2018, 11:37:47 pm »
That did the job! Thank you very much!

I was trying to place a lable as written in Post #2 or a button but got the error message
Code: Pascal  [Select][+][-]
  1. Invalid Parent - A TAndroidModule1 cannot hold TControls.
  2. You can only put non visual components on it.

But this is an other thing - probably here starts the new world for me, starting reading, learning...

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: [HowTo] Android Development Environment on Linux (FPCUPdeluxe + LAMW)
« Reply #20 on: April 22, 2018, 12:20:17 am »

Yes, You cant put a LCL component in AndroidModule/jForm ...
Use only the components from "Android Bridges XXX"  palettes
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

HobbyDev

  • New Member
  • *
  • Posts: 25
Re: [HowTo] Android Development Environment on Linux (FPCUPdeluxe + LAMW)
« Reply #21 on: April 22, 2018, 11:14:40 am »
Many Thanks again! Got it!

WayneSherman

  • Full Member
  • ***
  • Posts: 243
Re: [HowTo] Android Development Environment on Linux (FPCUPdeluxe + LAMW)
« Reply #22 on: September 30, 2018, 03:02:17 am »
Created a new wiki page for LAMW Linux Installation

Updated installation procedure to 2018-Sep-29 ver 1.1:
(see first post)

1) Work arounds were needed to deal with recent NDK / Gradle changes.
2) Updated command line SDK tools to "sdk-tools-linux-4333796.zip".
3) Using newer platform and build tools (ver 26 instead of ver 25)
4) Added MIPS toolchain links to work around NDK and gradle plugin inconsistency.
5) Using new Gradle:  gradle-4.10.2-bin.zip (previous was 4.1)
6) Add new environment variable: export ANDROID_SDK_ROOT="$HOME/android/sdk"
7) Tested with newer FPCUPdeluxe version (ver 1.6.1m)

A shoutout to Handoko for his recent hard work to create a new detailed Linux installation procedure.  Thanks for sharing.
He makes some different choices than I do, but nothing wrong with that.  Its good to have choices. :-)
Check it out here:
  LAMW 0.8 on Ubuntu 18.04 Installation Guide by Handoko
« Last Edit: September 30, 2018, 03:07:04 am by WayneSherman »

WayneSherman

  • Full Member
  • ***
  • Posts: 243
Re: [HowTo] Android Development Environment on Linux (FPCUPdeluxe + LAMW)
« Reply #23 on: September 30, 2018, 06:42:14 am »
Updated installation procedure to 2018-Sep-29 ver 1.2:
(see first post)

1) Tested and working with Xubuntu 18.04.
2) Add "update-java-alternatives --set /usr/lib/jvm/java-1.8.0-openjdk-amd64" to set default java to openjdk-8-jdk
3) Added commands to download and run fpcupdeluxe

See also:  Wiki page for LAMW Linux Installation

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: [HowTo] Android Development Environment on Linux (FPCUPdeluxe + LAMW)
« Reply #24 on: September 30, 2018, 07:49:14 pm »

Commited to LAMW git repository!!!

Thank you!
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

WayneSherman

  • Full Member
  • ***
  • Posts: 243
Updated installation procedure to 2019-May-20 ver 1.3:
(see first post)

Tested and working with Xubuntu 16.04 and 18.04.

1) sdkmanager is now pulling in NDK r19c (was r18)
2) Update sdk build-tools to 26.0.3 (was 26.0.2)
3) Update Gradle to 4.10.3 (was 4.10.2)
4) Update FPCUPdeluxe to version 1.6.2v (was 1.6.1m)

5) FPC branch is now "fixes3.2" (was trunk)
6) Lazarus branch is now "fixes2.0" (was trunk)
(the "fixes" branches are more stable than trunk)

7) Add support for 64-bit android (aarch64)  :-)

The 64-bit Android (aarch64) support was a team effort. Thank you to:
  yuriy_sydorov (aarch64 support in fpc compiler)
  DonAlfredo (aarch64 support in FPCUPdeluxe)
  jmpessoa (aarch64 support in LAMW)

See also:  Wiki page for LAMW Linux Installation
« Last Edit: May 31, 2019, 06:56:12 am by WayneSherman »

JackDca

  • New Member
  • *
  • Posts: 16
Re: [HowTo] Android Development Environment on Linux (FPCUPdeluxe + LAMW)
« Reply #26 on: January 23, 2020, 05:01:00 pm »
Wayne Sherman, and other contributors - !!THANK YOU!! for this guide. Without it I would never have been able to get Lazarus Android cross-compiles working.

Here are some notes on installing and testing the Lazarus-Android build system which might help others in the process. This was done on 2020-01-21.

My system runs Debian. Lazarus is installed on it and configured to target Debian. Since the Lazarus-Android IDE had been tested on Xubuntu 18.04 64 bit I hosted it on a VirtualBox Ubuntu 18.04 virtual machine. (Should have used Xubuntu, not Ubuntu. Next time!) This was a good thing because I had to start over more than once! Details:

- Ubuntu 18.04 LTS.
- System disk: 23 GB (default 10 GB is not enough).
- System RAM: 3072 MB (2048 MB is not enough).
- Under "Updates and other software" select "Minimal installation", deselect "Download updates while installing Ubuntu".
- When Ubuntu install is complete, run Settings application, Power-Power Saving-Blank screen-Never.

Re the last item: blanking of the virtual machine screen and/or blanking of the host machine screen appeared to cause crashes. When leaving the machines running unattended, if virtual machine had the mouse and keyboard captured that appeared to prevent blanking of the host machine screen.

- When running ./fpcupdeluxe-x86_64-linux, Basic tab, used FPC "fixes3.2" and Lazurus  "2.0.2". (The recomended "fixes3.2" "fixes2.0" resulted in failure.)

- When running ./fpcupdeluxe-x86_64-linux, Build Modules-OPM-Install module fails. Just ignored that because it is optional.

When building the APKs the correct command line is
./gradle-local-build.sh NOT
./gradle_local_build.sh

I tried installing both the "debug" and "release-unsigned" APKs on my Asus TF700T running Cyanogenmod Android 4.4.4. The "debug" version installed and ran, the "release-unsigned" did not install.

- When the app was run, the widgets were not correctly placed on the screen.

Next challenge - get the widget placement working!

JackDca

  • New Member
  • *
  • Posts: 16
Re: [HowTo] Android Development Environment on Linux (FPCUPdeluxe + LAMW)
« Reply #27 on: January 24, 2020, 06:23:29 pm »
When I follow the instructions to build a test APK (with jtextview, jeditext and jbutton controls) the project seems to build OK. But, when I install on the target Android device, all three controls are in the upper left-hand corner of the screen. Investigating this, in Lazarus on the build machine, when I mouse over the controls, the tooltip for each control shows "Position 0,0" which is consistent with what I see on the target device. Yet if I look at the .lfm file the positions look reasonable e.g. for the jTextView control
Left = 72
Top = 49
Width = 64
Height = 19

Any suggestions?


Handoko

  • Hero Member
  • *****
  • Posts: 5130
  • My goal: build my own game engine using Lazarus
Re: [HowTo] Android Development Environment on Linux (FPCUPdeluxe + LAMW)
« Reply #28 on: January 24, 2020, 06:52:14 pm »
Left = 72
Top = 49
Width = 64
Height = 19

Don't set those values directly. Instead you should configure these:
- LayoutParamHeight
- LayoutParamWidth
- PosRelativeToAnchor
- PosRelativeToParent

Read more:
https://forum.lazarus.freepascal.org/index.php/topic,43767.msg306821.html#msg306821

JackDca

  • New Member
  • *
  • Posts: 16
Re: [HowTo] Android Development Environment on Linux (FPCUPdeluxe + LAMW)
« Reply #29 on: January 24, 2020, 08:11:18 pm »
Thanks - I will look at the link you sent.

 

TinyPortal © 2005-2018