Recent

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

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: Compile to a tablet?
« Reply #30 on: October 30, 2021, 02:06:12 am »
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

Thank you for asking. Your question lead him to provide a link that included the model number, Samsung GT-P7510, which helped pinpoint the exact CPU, Cortex-A9 and using ARMv7-A should be the correct instruction set.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Compile to a tablet?
« Reply #31 on: October 30, 2021, 10:06:37 am »
Thank you for asking. Your question lead him to provide a link that included the model number, Samsung GT-P7510, which helped pinpoint the exact CPU, Cortex-A9 and using ARMv7-A should be the correct instruction set.

Glad to be able to help in a very small way.

For those tinkering with Termux: can anybody say whether the pthreads library is still packaged strangely? That used to be one of the few sticking points with more advanced programming, but I've not looked in detail for more than three years.

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 #32 on: October 30, 2021, 12:39:45 pm »
Last news.
I am able to transfer files (probably only small size but for me it's enough). BUT I am not allowed to change permissions for the file; I remember that when we changed the os (actually to 5 and later on to 7) we rooted it but later on for some reasons in the various attempts to improve the poor performances sometimes I got some messages that I was not a superuser or similar. There is a SuperSU application installed, which I probably used.
Sorry for this, this probably is a killer, my complete ignorance and a system already garbled are a huge hurdle for anybody I suppose
Thanks a lot anyway

Sergio

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Compile to a tablet?
« Reply #33 on: October 30, 2021, 12:48:06 pm »
This certainly shouldn't be a killer, and I would urge you to watch out for late responses (it's a weekend, so there might not be as much activity here as normal).

In the worst case you might end up having to install something like Termux anyway, simply to allow you to run chmod or whatever is needed... that should also allow you to use e.g. sftp which doesn't mess around with file permissions in transit.

The fact that people (myself included) have run the compiler successfully on the target system using Termux suggests that this is solvable, allowing you to develop comfortably on a host PC.

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 #34 on: October 30, 2021, 01:10:57 pm »
This certainly shouldn't be a killer, and I would urge you to watch out for late responses (it's a weekend, so there might not be as much activity here as normal).

In the worst case you might end up having to install something like Termux anyway, simply to allow you to run chmod or whatever is needed... that should also allow you to use e.g. sftp which doesn't mess around with file permissions in transit.

The fact that people (myself included) have run the compiler successfully on the target system using Termux suggests that this is solvable, allowing you to develop comfortably on a host PC.

MarkMLl


Thank you, of course I will watch with huge interest, I hope it is not too frustrating for you to follow this issue!!

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: Compile to a tablet?
« Reply #35 on: October 30, 2021, 01:39:18 pm »
I am able to transfer files (probably only small size but for me it's enough). BUT I am not allowed to change permissions for the file; I remember that when we changed the os (actually to 5 and later on to 7) we rooted it but later on for some reasons in the various attempts to improve the poor performances sometimes I got some messages that I was not a superuser or similar. There is a SuperSU application installed, which I probably used.

This is normal for Android. To control permissions, each apk application is run under a different "user" account. When you grant an application some permission, like access to your GPS location, you are giving its "user" account that permission.

On a rooted device, each account/app can request a superuser power.  As a result you get a pop-up window asking you if you would like to allow the app to have superuser power. Typically on Android this window will disappear, if you don't respond, within 10 or 15 seconds rejecting the request. This detail depends on which Superuser app you have.

Test chmod again but this time request superuser power. You do that by typing su:
Code: Text  [Select][+][-]
  1. su chmod 755 ./yourFileName

Or su alone.


MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Compile to a tablet?
« Reply #36 on: October 30, 2021, 01:46:21 pm »
Not at all frustrating. I hope you're not too offended when I have to remind everybody that you're an admitted non-expert :-)

As I've said (but not necessarily in this thread) I've played with FPC running directly on an x86_64-based tablet using Termux in the past, and just to check that the basics still worked I loaded Termux onto my old development phablet a few days ago and was able to ssh into it (i.e. get a shell over a network connection) which implies sftp (file transfer) should also work. The implication of that is that FPC should run on an Android device itself and be controllable from a desktop computer, but something sophisticated like Lazarus might not because of the threads library problem (unless it's been fixed over the last three years, but that is related to the Android architecture rather than being directly fixable by either the Termux or FPC/Lazarus developers).

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

ojz0r

  • Jr. Member
  • **
  • Posts: 58
Re: Compile to a tablet?
« Reply #37 on: October 30, 2021, 02:43:04 pm »
An alternative to sftp could be rsync over ssh, i use that to sync files to/from my phone (also works in Termux).
Just trying to learn.

regressist

  • New Member
  • *
  • Posts: 18
Re: Compile to a tablet?
« Reply #38 on: October 30, 2021, 05:00:14 pm »

This is normal for Android. To control permissions, each apk application is run under a different "user" account. When you grant an application some permission, like access to your GPS location, you are giving its "user" account that permission.

On a rooted device, each account/app can request a superuser power.  As a result you get a pop-up window asking you if you would like to allow the app to have superuser power. Typically on Android this window will disappear, if you don't respond, within 10 or 15 seconds rejecting the request. This detail depends on which Superuser app you have.

Test chmod again but this time request superuser power. You do that by typing su:
Code: Text  [Select][+][-]
  1. su chmod 755 ./yourFileName

Or su alone.


Thanks. When I tried su chmod 755 ./FileName I had a pop-up and pushed granted, on the display I got
 
tmp-mksh: 755: not found

Then I tried su alone and got #, then typed chmod 755 ./file , I got no message but upon ls -al the rights of the file are not changed and if I type the name of the file I get

tmp-mksh:filename: not found

regressist

  • New Member
  • *
  • Posts: 18
Re: Compile to a tablet?
« Reply #39 on: October 30, 2021, 05:08:56 pm »
Not at all frustrating. I hope you're not too offended when I have to remind everybody that you're an admitted non-expert :-)

As I've said (but not necessarily in this thread) I've played with FPC running directly on an x86_64-based tablet using Termux in the past, and just to check that the basics still worked I loaded Termux onto my old development phablet a few days ago and was able to ssh into it (i.e. get a shell over a network connection) which implies sftp (file transfer) should also work. The implication of that is that FPC should run on an Android device itself and be controllable from a desktop computer, but something sophisticated like Lazarus might not because of the threads library problem (unless it's been fixed over the last three years, but that is related to the Android architecture rather than being directly fixable by either the Termux or FPC/Lazarus developers).

MarkMLl

Thank you Mark, anyway I do not understand practically one single sentence of what you wrote!!
Anyway now I think I am SU from what I wrote above

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: Compile to a tablet?
« Reply #40 on: October 30, 2021, 06:32:16 pm »
Thanks. When I tried su chmod 755 ./FileName I had a pop-up and pushed granted, on the display I got
 
tmp-mksh: 755: not found

Then I tried su alone and got #, then typed chmod 755 ./file , I got no message but upon ls -al the rights of the file are not changed and if I type the name of the file I get

tmp-mksh:filename: not found

Yes, the name of the file alone will not work, unlike Windows. You need to put period slash ./ before it's name.

Unfortunately I will not be around a computer for some hours. As soon as I get a  chance I'll try it on my side and give you a more accurate step.

At least now we know your device is rooted. :)

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Compile to a tablet?
« Reply #41 on: October 30, 2021, 07:00:48 pm »
I'm not sure where this tmp-mksh comes into it, but to expand on one detail:

Yes, the name of the file alone will not work, unlike Windows. You need to put period slash ./ before it's name.

On Windows and other DOS-derivatives, the current directory (./) is implicitly on the execution path. On unix derivatives including Linux it's not, doctrine being that there's too much risk that a user will accidentally execute something he's just created when he really wanted something in /usr/bin.

So if you have a file fred in the current directory, you have to execute it by typing  ./fred

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 #42 on: October 30, 2021, 08:18:44 pm »
Yes, the name of the file alone will not work, unlike Windows. You need to put period slash ./ before it's name.

Unfortunately I will not be around a computer for some hours. As soon as I get a  chance I'll try it on my side and give you a more accurate step.

At least now we know your device is rooted. :)

You are right you told me. But it does not run anyway, I get

tmp-mksh: file: can't execute: permission denied

I guess because it is still a read/write only file.

Take your time, even two days, this is just for fun, and thanks again a lot

alpine

  • Hero Member
  • *****
  • Posts: 1038
Re: Compile to a tablet?
« Reply #43 on: October 30, 2021, 09:04:36 pm »
Not at all frustrating. I hope you're not too offended when I have to remind everybody that you're an admitted non-expert :-)

As I've said (but not necessarily in this thread) I've played with FPC running directly on an x86_64-based tablet using Termux in the past, and just to check that the basics still worked I loaded Termux onto my old development phablet a few days ago and was able to ssh into it (i.e. get a shell over a network connection) which implies sftp (file transfer) should also work. The implication of that is that FPC should run on an Android device itself and be controllable from a desktop computer, but something sophisticated like Lazarus might not because of the threads library problem (unless it's been fixed over the last three years, but that is related to the Android architecture rather than being directly fixable by either the Termux or FPC/Lazarus developers).

MarkMLl

Thank you Mark, anyway I do not understand practically one single sentence of what you wrote!!
Anyway now I think I am SU from what I wrote above
Considering what Mark said, I've just performed the following steps with Termux on my phone (it is not rooted):
Code: Text  [Select][+][-]
  1. $ whoami
The answer was something like: u0_a322
Code: Text  [Select][+][-]
  1. $ pkg install openssh
  2. $ passwd
  3. $ sshd

On second line I've entered a password for the current user (u0_a322)

Then on a Windows box you can use scp command to transfer files, including your pascal sources, and I presume, you can copy also your binaries generated from laz4android.
Code: Text  [Select][+][-]
  1. $ scp -P 8022 test.pas u0_a322@192.168.1.114:~
8022 is the port on which the sshd listens, the 192.168.1.114 is the IP of my phone, test.pas is the file. The ~ marks the home directory on the destination. It will ask for password, which is the same given to the passwd above.

The thing is that the copied files will have the same owner as the user who started sshd, namely u0_a322. Thus you don't need root permissions to execute:
Code: Text  [Select][+][-]
  1. $ chmod +x binaryfile
i.e. to mark it as executable.

Further, I used a WinSCP program on my PC - it works with SCP protocol and has a synchronization function (Commands/Synchronize...) - similar to rsync, but with Window-ish GUI.

In short - if you install sshd on your Termux, you'll be able to chmod without root permissions (su), and you can install program like WinSCP to easily synchronize directories between tablet and the PC.




"I'm sorry Dave, I'm afraid I can't do that."
—HAL 9000

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Compile to a tablet?
« Reply #44 on: October 30, 2021, 09:23:33 pm »
The thing is that the copied files will have the same owner as the user who started sshd, namely u0_a322. Thus you don't need root permissions to execute:
Code: Text  [Select][+][-]
  1. $ chmod +x binaryfile
i.e. to mark it as executable.

I think that's sound advice. We need to avoid the situation where the file transfer is being done by some Android implicit user but subsequently OP is using Termux or some other shell as a different user and as a result of that is neither able to run a program nor change its mode.

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