Recent

Author Topic: Compile to a tablet?  (Read 11581 times)

regressist

  • New Member
  • *
  • Posts: 18
Re: Compile to a tablet?
« Reply #15 on: October 28, 2021, 04:12:26 pm »
Yes, by default, it gives an exe file. You can change that by changing the target OS to Android, and target CPU to Arm. Both are in the Project Options window. You can open this window from the main menu under Project, or using CTRL+Shift+F11 key shortcut if I recall correctly.

I am not by a computer now, I'll try to post a screenshot later if you did not find them.
Done (thanks). Surprisingly upon compilation I get an error on the 2nd last line [error while linking]

    writeln(namefile,'Total solutions: ' , Nsoluzioni);

I am just writing in namefile:  Total solutions   nnn
And an identical command is written before, without any problem.

namefile is output.txt

In the meantime I also installed on the Galaxy your suggested Terminal emulator. It seems to work but touch wood because the OS is not performing well in general, it was probably a mistake to switch to this non-native OS.

Note: when you are fed up of supporting just say that, I do not want to disturb you too much!

engkin

  • Hero Member
  • *****
  • Posts: 2979
Re: Compile to a tablet?
« Reply #16 on: October 28, 2021, 08:50:45 pm »
Done (thanks). Surprisingly upon compilation I get an error on the 2nd last line [error while linking]

    writeln(namefile,'Total solutions: ' , Nsoluzioni);

I am just writing in namefile:  Total solutions   nnn
And an identical command is written before, without any problem.

namefile is output.txt

I think the location is irrelevant here, because the compiler did not issue the error. It is the linker. Probably you need to check other messages before or after this one.

To make sure you have a working environment, start a new project of type Program and only add writeln to the template Lazarus produced:
Code: Pascal  [Select][+][-]
  1. ....
  2. begin
  3.   Writeln('Hello World!');
  4. end.

Change the target OS to Android, CPU to Arm, and Target processor to ARMV7A

If you try to compile, you'll see a similar error. When you check the messages, the linker was unable to find one of the files, named: crtbegin_dynamic.o. This file comes with Android NDK. There are a few copies for each Android API version depending on the target processor.

To save you from needing to install the NDK, I'll make a guess and attach a zip file with the needed files. Expand the compressed file and point the test project to it using:

Compiler Options - Paths - Libraries

In the meantime I also installed on the Galaxy your suggested Terminal emulator. It seems to work but touch wood because the OS is not performing well in general, it was probably a mistake to switch to this non-native OS.

Great.

Note: when you are fed up of supporting just say that, I do not want to disturb you too much!

Don't worry about it.
« Last Edit: October 28, 2021, 09:16:46 pm by engkin »

y.ivanov

  • Sr. Member
  • ****
  • Posts: 306
Re: Compile to a tablet?
« Reply #17 on: October 28, 2021, 09:13:14 pm »
@engkin, @regressist
Wouldn't it be much simpler just by installing Termux+clang+fp-compiler on the tablet?

No need for Android NDK, laz4android, etc. Just a text editor on the PC and USB cable to transfer the source files to the device.

engkin

  • Hero Member
  • *****
  • Posts: 2979
Re: Compile to a tablet?
« Reply #18 on: October 28, 2021, 09:47:23 pm »
@engkin, @regressist
Wouldn't it be much simpler just by installing Termux+clang+fp-compiler on the tablet?

No need for Android NDK, laz4android, etc. Just a text editor on the PC and USB cable to transfer the source files to the device.

I don't think either way is simpler. If you are comfortable using Linux or fpc directly you might prefer using Termux. If you are a Windows person or used to Lazarus, then you might prefer Laz4android.

In both cases you have to set the environment up.

MarkMLl

  • Hero Member
  • *****
  • Posts: 3547
Re: Compile to a tablet?
« Reply #19 on: October 28, 2021, 10:53:11 pm »
It seems to work but touch wood because the OS is not performing well in general, it was probably a mistake to switch to this non-native OS.

I'm unaccountably disturbed by that: what do you mean by "non-native" in this context?

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

y.ivanov

  • Sr. Member
  • ****
  • Posts: 306
Re: Compile to a tablet?
« Reply #20 on: October 28, 2021, 11:10:00 pm »
@engkin, @regressist
Wouldn't it be much simpler just by installing Termux+clang+fp-compiler on the tablet?

No need for Android NDK, laz4android, etc. Just a text editor on the PC and USB cable to transfer the source files to the device.

I don't think either way is simpler. If you are comfortable using Linux or fpc directly you might prefer using Termux. If you are a Windows person or used to Lazarus, then you might prefer Laz4android.

In both cases you have to set the environment up.
Exactly what I'm writing about ... I've installed Termux+clang+fpc in a matter of minutes. Making my first apk with laz4android, LAMW, Android SDK+NDK took me days and several gigs on my HD. And then we should introduce OP to the Android bridges et al. Much, much steeper IMHO.

engkin

  • Hero Member
  • *****
  • Posts: 2979
Re: Compile to a tablet?
« Reply #21 on: October 28, 2021, 11:24:26 pm »
No, no APK, just an executable for the terminal. But wait, did you produce an APK using Termux?

ojz0r

  • New Member
  • *
  • Posts: 43
Re: Compile to a tablet?
« Reply #22 on: October 29, 2021, 09:08:38 am »
No Termux only compiles like on any Linux system, run it with ./application-name.

However there is the app Tasker where you can reach into Termux to execute commands or in this case an executable. The same developer also has an app called "Tasker App Factory" that can convert a Tasker task into an apk - i tried it alittle bit right now but it seems not to work as expected, it will not launch the Termux. Maybe it needs a little bit more configuration to get it working.
Otherwise you can create a widget with a shortcut to a Tasker task and that seemed to work right away - no apk this way though but you can use it like an icon on the homescreen.
Just trying to learn.

y.ivanov

  • Sr. Member
  • ****
  • Posts: 306
Re: Compile to a tablet?
« Reply #23 on: October 29, 2021, 10:20:51 am »
No, no APK, just an executable for the terminal.
Sorry, my error. I presumed *.apk (laz4android+LAMW) vs native executable (Termux+fpc).
 
But wait, did you produce an APK using Termux?
No. Considering all additional stuff needed I didn't even think its possible.

regressist

  • New Member
  • *
  • Posts: 18
Re: Compile to a tablet?
« Reply #24 on: October 29, 2021, 06:38:21 pm »
Change the target OS to Android, CPU to Arm, and Target processor to ARMV7A

If you try to compile, you'll see a similar error. When you check the messages, the linker was unable to find one of the files, named: crtbegin_dynamic.o. This file comes with Android NDK. There are a few copies for each Android API version depending on the target processor.

To save you from needing to install the NDK, I'll make a guess and attach a zip file with the needed files. Expand the compressed file and point the test project to it using:

Compiler Options - Paths - Libraries

Note: when you are fed up of supporting just say that, I do not want to disturb you too much!

Don't worry about it.

Done, thanks a lot. Now I have a file without extension which I suppose is the executable.

I suppose I have to transfer it to the tablet, chmod like you said before and run. I do it only when you say that because I am afraid to make mistakes on the tablet, and there I would be lost, I do not have a virtual machine to start again

To the guy who was asking about the nonnative OS, the Galaxy 10 (and also Toshiba with the AT100, in agreement I guess) after version 4.4 stopped upgrading very deceptively I believe since the hw was still good, they want us to buy a new tablet every other year. So someone suggested me after a few years to install a new version not from Samsung, I have now Android 7, but handicapped, it works only partially, e.g. the browser crashes, and I am not able to transfer large files to the pc. But for this which is only a few KB I could use even bluetooth (I hope)

MarkMLl

  • Hero Member
  • *****
  • Posts: 3547
Re: Compile to a tablet?
« Reply #25 on: October 29, 2021, 08:09:54 pm »
To the guy who was asking about the nonnative OS, the Galaxy 10 (and also Toshiba with the AT100, in agreement I guess) after version 4.4 stopped upgrading very deceptively I believe since the hw was still good, they want us to buy a new tablet every other year. So someone suggested me after a few years to install a new version not from Samsung, I have now Android 7, but handicapped, it works only partially, e.g. the browser crashes, and I am not able to transfer large files to the pc. But for this which is only a few KB I could use even bluetooth (I hope)

I was the gentleman who was trying to help by finding that out. Refer to me as "guy" if you like, but I don't...

The major reason I was asking was because I was trying to fond out whether you thought that by rooting the tablet it was now "non-native". Or alternatively you were referring to the way you were driving Lazarus: your phrasing was a bit vague.

OK, this isn't really the place to discuss the care and feeding of Androids, but can you remember what you used: CyanogenMod or some derivative? I've been through this with a rather less prominent brand and ended up with CyanogenMod 13 (? Android 6.0.1) tailored for the specific "phablet" concerned, most of the stuff works and it's certainly good enough to be a useful development tool.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

regressist

  • New Member
  • *
  • Posts: 18
Re: Compile to a tablet?
« Reply #26 on: October 29, 2021, 08:53:51 pm »
I was the gentleman who was trying to help by finding that out. Refer to me as "guy" if you like, but I don't...

The major reason I was asking was because I was trying to fond out whether you thought that by rooting the tablet it was now "non-native". Or alternatively you were referring to the way you were driving Lazarus: your phrasing was a bit vague.

OK, this isn't really the place to discuss the care and feeding of Androids, but can you remember what you used: CyanogenMod or some derivative? I've been through this with a rather less prominent brand and ended up with CyanogenMod 13 (? Android 6.0.1) tailored for the specific "phablet" concerned, most of the stuff works and it's certainly good enough to be a useful development tool.

MarkMLl
Hi,

if your question is on which Android 7 I installed (with large help!) it is this

http://androidbiits.com/samsung-galaxy-tab-10-1-gt-p7510-android-7-0-nougat-aosp-rom/

but even though I do not follow that page from 3 years and might have been fixed, I do not suggest you to install it.

Cheers

Sergio

engkin

  • Hero Member
  • *****
  • Posts: 2979
Re: Compile to a tablet?
« Reply #27 on: October 29, 2021, 09:31:46 pm »
Done, thanks a lot. Now I have a file without extension which I suppose is the executable.

I suppose I have to transfer it to the tablet, chmod like you said before and run. I do it only when you say that because I am afraid to make mistakes on the tablet, and there I would be lost, I do not have a virtual machine to start again

Yes, that file is the executable. There is nothing to worry about, any mistakes will not cause any major problem. Simply it either works or it does not. In the latter case, it might give a message explaining why it would not run.

Are you familiar with a way to transfer files between your Galaxy and your PC?

regressist

  • New Member
  • *
  • Posts: 18
Re: Compile to a tablet?
« Reply #28 on: October 29, 2021, 10:03:43 pm »

Yes, that file is the executable. There is nothing to worry about, any mistakes will not cause any major problem. Simply it either works or it does not. In the latter case, it might give a message explaining why it would not run.

Are you familiar with a way to transfer files between your Galaxy and your PC?

Yes, if the link works I will do with it otherwise I will try with bluetooth. I'll let you know

Thanks again

MarkMLl

  • Hero Member
  • *****
  • Posts: 3547
Re: Compile to a tablet?
« Reply #29 on: October 29, 2021, 11:08:15 pm »
but even though I do not follow that page from 3 years and might have been fixed, I do not suggest you to install it.

I wouldn't dream of it for a moment. I was trying to find out what you were on about so that we could collectively help you, since you're the one who pleads limited experience.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018