Recent

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

Rbart

  • New Member
  • *
  • Posts: 19
Re: Setting up for Andoid easy to mess up, or is it just me?
« Reply #15 on: November 19, 2023, 12:30:29 pm »
./sdkmanager file or folder does not exist.
Am I in the right folder? I can see a sdkmager. (see screenprint previous post)

Maybe I should build from scratch using the old version from two years ago?
Seems like the new versions won't work together very well.

And then I still can't test anything unless I connect an external device. I am afraid the new Android studio will reject these old projects too.




Handoko

  • Hero Member
  • *****
  • Posts: 5131
  • My goal: build my own game engine using Lazarus
Re: Setting up for Andoid easy to mess up, or is it just me?
« Reply #16 on: November 19, 2023, 12:39:05 pm »
In Windows, you just need to type the name of the program to run it. For example, you're in the folder that contains notepad.exe, to start the program you type this in the Command Prompt:

notepad


But in Linux, you have you add "./" in front of the program name. For example you're in same folder of the your program named myprog. To run it from Terminal (Linux calls it Terminal, Windows calls it Command Prompt) you type this:

./myprog

./sdkmanager file or folder does not exist.
Am I in the right folder? I can see a sdkmager. (see screenprint previous post)

sdkmanager is a program. You need to goto the folder first before you can run it.

Rbart

  • New Member
  • *
  • Posts: 19
Re: Setting up for Andoid easy to mess up, or is it just me?
« Reply #17 on: November 19, 2023, 04:26:08 pm »
I tryed on Windows with Laz4Android. Following this: https://github.com/jmpessoa/lazandroidmodulewizard

4) Go to Lazarus menu "Tools" --> "[LAMW] Android Module Wizard" --> "Build FPC Cross Android" and repeat the "Build and install" process once for each architecture.

There is no [LAMW] Android Module Wizard

Handoko

  • Hero Member
  • *****
  • Posts: 5131
  • My goal: build my own game engine using Lazarus
Re: Setting up for Andoid easy to mess up, or is it just me?
« Reply #18 on: November 19, 2023, 04:38:02 pm »
If you managed to install LAMW correctly, you can try:
Lazarus main menu > New >

There should be able to find LAMW related projects.

Handoko

  • Hero Member
  • *****
  • Posts: 5131
  • My goal: build my own game engine using Lazarus
Re: Setting up for Andoid easy to mess up, or is it just me?
« Reply #19 on: November 19, 2023, 05:09:23 pm »
./sdkmanager file or folder does not exist.

Please use your Terminal and go to the location:
~/android/sd/cmdline-tools/tools/bin

And then type:
ls

And please post the screenshot.

---

I downloaded the SDK as mentioned by the installation guide in the link you gave, the sdkmanager was indeed inside the zip file. I unzipped the zip file and I could run sdkmanager.
« Last Edit: November 19, 2023, 05:31:49 pm by Handoko »

Rbart

  • New Member
  • *
  • Posts: 19
Re: Setting up for Andoid easy to mess up, or is it just me?
« Reply #20 on: November 20, 2023, 12:48:10 pm »
So it was a different folder then the one mentioned in the warning. The sdkmanager is an empty file there.
I tryed the update the 'right' folder but failed again to install the update.

Handoko

  • Hero Member
  • *****
  • Posts: 5131
  • My goal: build my own game engine using Lazarus
Re: Setting up for Andoid easy to mess up, or is it just me?
« Reply #21 on: November 20, 2023, 03:27:06 pm »
You can try to run sdkmanager without any parameter:
./sdkmanager

If I remember correctly, running sdkmanager without any parameter will cause it to start in GUI mode. There you can update necessary components easily.

Seenkao

  • Hero Member
  • *****
  • Posts: 546
    • New ZenGL.
Re: Setting up for Andoid easy to mess up, or is it just me?
« Reply #22 on: November 20, 2023, 05:05:31 pm »
  Android Studio установлен у вас? Если да, то вам надо через настройки Android Studio установить нужные параметры для SDKmanadger.

  И, если у вас установлен Android Studio, то вам необходимо выполнить первые шаги по сборке простых проектов.
- создайте простой проект на Android Studio (на просторах интернета много примеров для создания подобных примеров).
- протестируйте данный проект на работоспособность.
- при возникновении ошибок при сборке проекта или тестировании, необходимо их устранить (думаю есть много примеров по тому как работать с Android Studio и там же показано как исправлять основные ошибки).

  Если всё хорошо работает, то можете начинать переходить на проекты FPC/Lazarus + LAWM.

  Множество ошибок выскакивающих у вас, так же встречаются и при сборке проектов на Android Studio. Поэтому много ответов вы можете найти не здесь, а на других форумах или сайтах, где рассказывается о работе с проектами под Android.

---------------------------------
Google translate:
  Do you have Android Studio installed? If yes, then you need to set the necessary parameters for SDKmanadger through the Android Studio settings.

  And, if you have Android Studio installed, then you need to complete the first steps to build simple projects.
- create a simple project in Android Studio (there are many examples on the Internet for creating similar examples).
- test this project for functionality.
- if errors occur during project assembly or testing, you need to eliminate them (I think there are many examples on how to work with Android Studio and it also shows how to correct basic errors).

   If everything works well, then you can start moving to FPC/Lazarus + LAWM projects.

   Many errors that pop up for you also occur when building projects on Android Studio. Therefore, you can find many answers not here, but on other forums or sites that talk about working with projects for Android.
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 #23 on: November 20, 2023, 08:02:59 pm »
Hi Seenkao and Hondoko,

Thanks for the information.

Adroid studio works,  I even got the emulator working with a 'hello world'. Nothing slow about it. I am running it on a recent computer.

Importing the projects from Lazarus is a different story. I will have to learn how Lazarus and LAWM is working to figure it out, if it's even possible to do so with all the old and new versions around.
I was not expecting I was going to have to dig deeper in the IDE itself to get this working.

Even if I get it to work. It is still a different version than Lazarus. It needs other controls from the Android bridge. So I would have to build a separet application for Android anyway. And still need Android studio to run it. Learn Java as well is probably not a bad idea. If Lazarus then still has advantages I'm not sure.

So I will let it rest for a while. Have to go to work for the next 4 days, no energy in the evenings anymore like I was younger.

@handoko The sdkmanager did not start. See attachments

Greetings
Rbart

nobody.00

  • New member
  • *
  • Posts: 7
Re: Setting up for Andoid easy to mess up, or is it just me?
« Reply #24 on: November 20, 2023, 11:05:57 pm »
your errors: marked

try:
./sdkmanager "build-tools;33.0.2" "platforms;android-33"
« Last Edit: November 21, 2023, 01:18:18 am by nobody.00 »

Handoko

  • Hero Member
  • *****
  • Posts: 5131
  • My goal: build my own game engine using Lazarus
Re: Setting up for Andoid easy to mess up, or is it just me?
« Reply #25 on: November 21, 2023, 11:41:28 am »
Adroid studio works,  I even got the emulator working with a 'hello world'. Nothing slow about it. I am running it on a recent computer.

Glad to know you managed to make it works.
And sorry, my previous comments weren't very helpful.

I was not expecting I was going to have to dig deeper in the IDE itself to get this working.

Even if I get it to work. It is still a different version than Lazarus. It needs other controls from the Android bridge. So I would have to build a separet application for Android anyway. And still need Android studio to run it. Learn Java as well is probably not a bad idea. If Lazarus then still has advantages I'm not sure.

This is Lazarus/Pascal forum, of course here they will tell you Lazarus+LAMW is better than Java+others for building Android applications.  :)

You mentioned Java ... maybe you haven't know, Lazarus/FPC can build Java applications too:
https://wiki.lazarus.freepascal.org/Lazarus_JVM

One of Lazarus/FPC strength is cross compiling. I am building my cross platform OpenGL graphics engine that can be used on Windows, Linux and Android, it is a single project not 3 separate projects. I made use of Pascal conditional compilation:
https://wiki.freepascal.org/Conditional_compilation

LAMW Android components are not Lazarus native components, how can I 'merged' it with Windows/Linux components into a single project? Sure I do not merge all of them into a single file. But the OpenGL part is basically the same for all them, so the basic logic of my graphics engine (the OpenGL part) is shared and then I only need to write their platform depended 'things' into their own unit. It's not only in theory, actually I already have some code that works on Windows, Linux and Android. Unfortunately, I was busy and some issue with LAMW bugs, this project is temporary paused.

Each software development tool has their own advantages and disadvantages. Which tool to use, is more depended on the programmer personal choice. If you're not familiar with Lazarus/Pascal, you may have better luck to use other software to build applications. I am not a Pascal/Lazarus fanatic, before I decided to use Lazarus I really have done some research and tried many other tools. I use Lazarus because I know its advantages:
- Cross platform and cross compile
- General purpose (I can build all kinds of program if I have the knowledge)
- The generated binaries have good performance and relatively small in size
- Readability source code, easy to debug and maintain
- RAD (plenty of ready-to-used both visual and non-visual components)
- Compile very fast

You should not simply believe what I said, you have to do the research yourself.

And about Android Bridges, as far as I know there is no documentation for them. But that shouldn't be a problem because all of them have example code, you can find them in the demos in the LAMW folder.
« Last Edit: November 21, 2023, 02:46:45 pm by Handoko »

Seenkao

  • Hero Member
  • *****
  • Posts: 546
    • New ZenGL.
Re: Setting up for Andoid easy to mess up, or is it just me?
« Reply #26 on: November 21, 2023, 02:09:34 pm »
nobody.00, это может не сработать, если человек не установил необходимые инструменты для SDKmanadger. Их сначала надо установить, а уже потом использовать.
  При этом надо указать в AndroidManifest версию под которую собирается проект (если проект был подготовлен не в Android Studio). А если используется Gradle, а не Android Studio для сборки проекта, то необходимо настроить Gradle для сборки проекта под необходимую версию Android (и как я писал выше, надо установить необходимые инструменты).

Google translate:
  nobody.00, this may not work if the person has not installed the necessary tools for SDKmanadger. They must first be installed, and only then used.
   You also need to indicate in the AndroidManifest the version for which the project is being built (if the project was not prepared in Android Studio). And if you use Gradle and not Android Studio to build the project, then you need to configure Gradle to build the project for the required version of Android (and as I wrote above, you need to install the necessary tools).
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

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

WayneSherman

  • Full Member
  • ***
  • Posts: 243
Re: Setting up for Andoid easy to mess up, or is it just me?
« Reply #27 on: November 22, 2023, 12:03:51 am »
I followed these guidelines: https://wiki.freepascal.org/LAMW_install_linux_fpcupdeluxe

These instructions have been updated.  The main stopper for me was needing to use the most recent version of FPCUpDeluxe.  Note, there are some quirks trying to open and build the demo projects.  See the instructions under heading "For demo LAMW projects" which shows the steps I used for building the demo project "AppHelloWord".
« Last Edit: November 22, 2023, 12:22:54 am by WayneSherman »

Rbart

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

Thank you all for the help. I learned a lot. I will need to dig deeper in this later on.
Before a couple of weeks ago I didn't even know of the existance of Lazarus.
I do think there's still a future for this 'dead' language. But it will need a lot of work to get around all the draw backs.
A great project for my retirement days next year.

Greetings,
Rbart

 

TinyPortal © 2005-2018