Recent

Author Topic: Setting up for Andoid easy to mess up, or is it just me?  (Read 3089 times)

Rbart

  • New Member
  • *
  • Posts: 19
Setting up for Andoid easy to mess up, or is it just me?
« on: November 17, 2023, 05:54:53 pm »
Hi,

As a very Newbie..searching for a new way to develop programs and apps when I able retire at 60 next year. The idea was very appealing to be able to write code once for all platforms.
So I started a journey, learn Pascal and Lazarus and enter a new world.
Setting up Lazarus was going ok. For Android it's a different story.
I found it confusing. You need to set up a different version of Lazarus or is the current version going to be influenced?
I run a dual boot Linux with windows. So to be 'save' I used the windows side to try out Lazarus for android. LAMW didn't work with the new versions of Lazarus. So every thing went bad. But I saw there were two versions. Lazarus and LazAndroid after installing lazandroid. But nothing was working without LAMW, I guess? So I tryed the other option to install fpcupdeluxe on Linux. The setup was successful but Google wanted me to install an update. So I did that. So now I was able to build a GUI with a button and a textfield. Trying to run this, didn't work so I searched and found you need to set up an emulator. No succes at that neighter. In a forum I found someone suggesting you should install Android studio. I installed Android studio via a snap. I think that messed it up good. Can I stille save this situation? And get my attemps working is an emulator?
Many thanks, Rbart

Handoko

  • Hero Member
  • *****
  • Posts: 5091
  • My goal: build my own game engine using Lazarus
Re: Setting up for Andoid easy to mess up, or is it just me?
« Reply #1 on: November 17, 2023, 06:15:20 pm »
Hello Rbart,
Welcome to the forum.

I used LAMW and managed to generate Android APK to run on my Asus Intel processor mobile phone. I admit to say the installation process was a bit challenging for most people, especially setting up to toolchain for generating Intel (not ARM) Android binaries. But, I did it.

I haven't used LAMW for a while for some reasons. But I am sure I will do Android programming again later. I just want to tell you: don't give up. Do you know how long the process I started to try LAMW until I really created the app to run on my phone? Almost a whole year. Yes, no joking. The documentation was poor, and if you had problem, no body could help you.

Things are much easier now, more people get involved, LAMW and the documentation have improved a lot.

If I can give you advice, I would say:

- Read the documentation thoroughly:
https://github.com/jmpessoa/lazandroidmodulewizard

- It will be much easier to test your apk on a real phone, don't run it on any emulator because they are extremely slow.

jmpessoa

  • Hero Member
  • *****
  • Posts: 2296
Re: Setting up for Andoid easy to mess up, or is it just me?
« Reply #2 on: November 17, 2023, 06:24:17 pm »

Hi, Rbart!

Can you try install on a real device?

(In fact, nowadays to get an emulator you need a complete "Anddroi Studio" install)
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

Rbart

  • New Member
  • *
  • Posts: 19
Re: Setting up for Andoid easy to mess up, or is it just me?
« Reply #3 on: November 17, 2023, 06:50:23 pm »
Hi jmpessoa and Handoko,

Thanks for the suggestions. I have an Android phone, that's a step. At this time I have to figure out how to install from Lazarus on it. Android studio I have installed on Linux that's where it went wrong with duplicate things errors. Neighter laz4android nor this Android studio is working now. Should I want to turn to this studio I could not. I guess they interfere with each other. I will try to get sence out of the documentation. I hope not having to spent a year to get a 'hello world' working. Better to learn Java and use the Android studio then. No, I find this idea with Lazarus a better challenge. I hope more people step in to this project. It has potential but also some real drawbacks.

Thanks and greetings from Belgium,
Rbart.

Seenkao

  • Hero Member
  • *****
  • Posts: 538
    • New ZenGL.
Re: Setting up for Andoid easy to mess up, or is it just me?
« Reply #4 on: November 18, 2023, 05:22:14 am »
  Android Studio нужен только для отладки или запуска эмулятора. Для создания приложения достаточно установить LAWM, собрать проект и собрать APK-файл. Если ни чего не изменилось в последнее время.

Google translate:
  Android Studio is only needed for debugging or running the emulator. To create an application, you just need to install LAWM, build the project and build the APK file. If nothing has changed recently.
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

Rbart

  • New Member
  • *
  • Posts: 19
Re: Setting up for Andoid easy to mess up, or is it just me?
« Reply #5 on: November 18, 2023, 10:36:22 am »
Hi Seenkao,

Thing have changed. Lazarus current version does no work with the two years old version of LAMW. You can not rely on the guides here in 2023. They are outdated.
I have build the APK but it  is giving me lot's of fails en errors.
Maybe building the tools from scratch would be the only way left to get things up to date.
I hope that it will work with the updates the system is asking for.
The world will have to be patient a bit longer for my first 'Hello' in Android.

Greeting Rbart

Handoko

  • Hero Member
  • *****
  • Posts: 5091
  • My goal: build my own game engine using Lazarus
Re: Setting up for Andoid easy to mess up, or is it just me?
« Reply #6 on: November 18, 2023, 10:43:17 am »
For security reasons, Google wants us to use the newer API versions. Have you followed the messages to update your SDK using the sdkmanager? That should fix your issue.

Rbart

  • New Member
  • *
  • Posts: 19
Re: Setting up for Andoid easy to mess up, or is it just me?
« Reply #7 on: November 18, 2023, 11:06:38 am »
I did. But now it is asking again. I am getting all sorts of errors. Every thing I do seems to make things worse.

Handoko

  • Hero Member
  • *****
  • Posts: 5091
  • My goal: build my own game engine using Lazarus
Re: Setting up for Andoid easy to mess up, or is it just me?
« Reply #8 on: November 18, 2023, 11:22:55 am »
Did you get the error when compiling your own project?

I mean, make sure you have installed LAMW and all the necessary things properly before starting your projects. In the LAMW folder, you can find some demos. Try to compile/build the demos and run them on your phone.

If you're having problem building the demos to generate apks, that means you haven't install the LAMW correctly.

If you can build the demos but can't or don't know to to make it to run your phone, try Googling the web "how to install apk on android". Android does not allow users to install apks that are not provided by Google/Play Store, you should enable this 'special app access' first.
« Last Edit: November 18, 2023, 11:24:28 am by Handoko »

Rbart

  • New Member
  • *
  • Posts: 19
Re: Setting up for Andoid easy to mess up, or is it just me?
« Reply #9 on: November 18, 2023, 11:52:54 am »
LAMW is installed by fpcupdelux. I expected it to do the job.
Try to open a demo gives me errors. Every thing gives errors.

I give up for today. I'll look at it tommorow with a fresh mind.

Handoko

  • Hero Member
  • *****
  • Posts: 5091
  • My goal: build my own game engine using Lazarus
Re: Setting up for Andoid easy to mess up, or is it just me?
« Reply #10 on: November 18, 2023, 11:57:19 am »
Have you done these:

sdkmanager --update
sdkmanager "build=tools;32.0.02" "platforms;android-33"


And did you get any errors running those commands above?

Seenkao

  • Hero Member
  • *****
  • Posts: 538
    • New ZenGL.
Re: Setting up for Andoid easy to mess up, or is it just me?
« Reply #11 on: November 18, 2023, 03:21:50 pm »
  Для LAWM не используйте последнюю версию Gradle. Уточните какая максимальная версия Gradle нужна для сборки проекта LAWM.

Google translate:
  For LAWM, do not use the latest version of Gradle. Check what maximum version of Gradle is needed to build the LAWM project.

Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

Rbart

  • New Member
  • *
  • Posts: 19
Re: Setting up for Andoid easy to mess up, or is it just me?
« Reply #12 on: November 19, 2023, 10:17:37 am »
Hi Handoko,

There's no sdkmanager installed.

I followed these guidelines: https://wiki.freepascal.org/LAMW_install_linux_fpcupdeluxe

Hi Seenkao,

Why not use the latest version of Gradle? I did not have a choosing of the version when installing.
In LAWM it's version 6.8.3 I can't find what it is for Android studio.

Can both Android studio and fpcupdelux or LAWM just share the same sources?

Handoko

  • Hero Member
  • *****
  • Posts: 5091
  • My goal: build my own game engine using Lazarus
Re: Setting up for Andoid easy to mess up, or is it just me?
« Reply #13 on: November 19, 2023, 11:54:24 am »
I don't Android programming currently, I can't be sure to tell you how to install LAMW and all the necessary things correctly.

If you failed to install sdkmanager following that installation instruction, try this:
https://developer.android.com/tools/sdkmanager

Alternatively, you can try other options:
https://github.com/jmpessoa/lazandroidmodulewizard

I used Laz4Android (option a). This probably is the easiest, but as a Linux user, I had to set a Windows virtual machine first.

Or you can try the option b and option d.

Handoko

  • Hero Member
  • *****
  • Posts: 5091
  • My goal: build my own game engine using Lazarus
Re: Setting up for Andoid easy to mess up, or is it just me?
« Reply #14 on: November 19, 2023, 12:05:59 pm »
Okay, I think I know your problem now.

Previously I said:

sdkmanager --update
sdkmanager "build=tools;32.0.02" "platforms;android-33"


I forgot to tell you, for Linux users you have to add "./", so those commands should be:
./sdkmanager --update
./sdkmanager "build=tools;32.0.02" "platforms;android-33"
« Last Edit: November 19, 2023, 12:09:47 pm by Handoko »

 

TinyPortal © 2005-2018