Lazarus

Free Pascal => General => Topic started by: Paul Breneman on March 15, 2014, 07:21:59 pm

Title: Free Pascal console programs on Android are easy
Post by: Paul Breneman on March 15, 2014, 07:21:59 pm
http://turbocontrol.com/gnuroot.htm (http://turbocontrol.com/gnuroot.htm) is a new (unpublished) web page.  Feedback appreciated!
Title: Re: Free Pascal console programs on Android are easy
Post by: Leledumbo on March 16, 2014, 08:04:05 am
OK, that's cute :D
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on March 16, 2014, 02:21:30 pm
Yes, there are now lots of inexpensive Android tablets so the next "phase" will be seeing how many interesting things people come up with.  I really want to load Debian on them and completely get rid of Android, but right now this isn't very easy (Ubuntu is probably a little easier).  LinuxOnAndroid.org is also interesting.  All of those options require rooting the device which I want to avoid as long as possible.  So GNURoot (which doesn't require rooting) is an interesting first step to try.

GNURoot may not allow x11 to work, and I'm also concerned that communication (USB-serial, bluetooth, wifi) won't work.  But I'm still testing.  If any communication works then I guess I could try "Free Vision".   :)  My main (first) goal in this is to be able to run a single console program (for machine control) on an inexpensive tablet.  Maybe even with embedded Firebird (I have an Android tablet with an Intel CPU if that is needed).  A GUI is not required.
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on March 16, 2014, 05:40:56 pm
The Free Vision testapp example seems to work for the keyboard, but the mouse doesn't (yet) work.  Maybe non-root Android apps will be a good reason to keep improving Free Vision?   :)

Since wget does work in the GNURoot terminal it seems communication should work.

So things still look interesting for doing machine control!   :)
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on March 24, 2014, 04:53:20 pm
Well, maybe I can wait on doing more with Free Vision and use fpGUI instead!  :)

GNURoot has been updated!  See this text: "WheezyX rootfs type added - it has Xterms working. After launching it, use a vncviewer on your Android device or you PC to connect to it."  Now I hope to get Control Terminal working (first for WiFi and Bluetooth, then with USB OTG for Ethernet and Serial)!

http://turbocontrol.com/gnuroot.htm
Title: Re: Free Pascal console programs on Android are easy
Post by: Arucard1983 on April 05, 2014, 07:47:10 pm
I tested GnuRoot on my Android Tablet and I can run Lazarus IDE, build PeaZip and run it without issues. Later I will post a guide after updating my patches work on PeaZip port to ARM.

To run X11 apps on GnuRoot you can install the Pelya's XSDL X11 Server from Google Play and run it. You can adjust the screen resolution and the default font size.
The x11 app should be running before launch GnuRoot, otherwise the pipe link will fail.  ::)
 
Then run GnuRoot and install the LXFE or XFCE Desktop Environment from the distro repositories.
So far I tested the Debian Wheezy and the XFCE4 DE.
Once installed (it take a while to install, even it needs to:
apt-get install xfce4 build-essentials
And install about 300 packages)
just run on terminal console:
DISPLAY=127.0.0.1:0.0 startxfce4

Switch to X11 app and done! After 20 to 30 seconds the Debian XFCE4 Desktop Environment is up and you can use (almost) any Linux application.

To install the Lazarus IDE from scratch, just pick the ARM build of FPC from sourceforge, the FPC souce code and the Lazarus source code.
Install FPC, unpack FPC source to /usr/share/fpc, and Lazarus source to /home.
Install the GTK source toolkits (I don't remembre all details  %))
# apt-get install gtk* (errm..) :(

Jump to Lazarus folder root and compile:
# make clean bigite
If someone fails, like "not found library gtk2", search the debian packages to find a particular library. (It was about 15!)
Once built sucefully, just install it:
#make install

And then:
# startlazarus

Lazarus IDE running on Android !  :D :)
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on May 10, 2014, 02:06:42 am
http://turbocontrol.com/gnuroot.htm

I just updated the above web page with a Control Terminal console program that uses Synapse to get the header of a web page.  Nice to see what can be done with a 2 MB zip and Free Pascal and Synapse.  Thanks for the great tools!
Title: Re: Free Pascal console programs on Android are easy
Post by: bee on May 10, 2014, 03:39:15 pm
Any hope to have graph unit working on Android console? That would be great for making little retro games. :D
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on May 12, 2014, 09:05:03 pm
I just added a new file with the Free Vision testapp but the keyboard Alt-X and the mouse still don't work.  Any suggestions?
http://turbocontrol.com/gnuroot.htm
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on May 14, 2014, 09:33:02 pm
Sorry Bee that I didn't reply to your message before, but I think graphics will require X11 which I'm trying to avoid right now.  Seeing how far I can get with Free Vision seems better and more fun!   :)

I just added new --051414.zip files (3 of them) which are working much better:  http://turbocontrol.com/gnuroot.htm (http://turbocontrol.com/gnuroot.htm)
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on May 20, 2014, 11:44:42 pm
I keep trying to go further every week!   :)

I just added 3 zips (4.9 MB to 5.6 MB) that use Free Pascal 2.6.4 and also can compile the textmode IDE.  This should make it easier to work with Free Vision.  The new zips are available on this page:
http://ctrlterm.com/ports.htm (http://ctrlterm.com/ports.htm)

I hope to update this page soon:
http://turbocontrol.com/gnuroot.htm (http://turbocontrol.com/gnuroot.htm)
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on May 21, 2014, 05:34:26 am
The FPC 2.6.4 zips work for i386 Win32 and i386 Linux, but the ARM Linux fails to compile one (of three) programs.  The same program worked with FPC 2.6.2 but with 2.6.4 whenever I put SynaSer or BlckSock (Synapse units) in the uses it fails:

./fpcunits/cprt0.o: In function '_haltproc_eabi':
(.text+0x88): undefined reference to '_fini'
./fpcunits/cprt0.o: In function '_haltproc_eabi':
(.text+0x90): undefined reference to '_init'
--- Error: Error while linking

Seems that those two Synapse units may be exposing a FPC 2.6.4 bug?

Two Free Vision apps (in the same zip) work OK with FPC 2.6.4.

*********************

There are 2-6 MB zips on this page:
  http://ctrlterm.com/ports.htm

The ARM -051414.zip works but the -052014.zip doesn't.  I can't test on my Raspberry Pi at the moment, so I'm testing on a Nexus 7 tablet.
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on May 26, 2014, 11:52:33 pm
Here is something from a year ago but I don't think it is related to my current problem: http://bugs.freepascal.org/view.php?id=24518 (http://bugs.freepascal.org/view.php?id=24518)

I just went back to FPC 2.6.2 so everything works (even though kept 2.6.4 IDE source code).  On Android the IDE seems to work and Alt-F10 gets the menu opened up (which is nice).  Alt-X doesn't work (but F5 does).

Now I hope to finish porting CtrlTerm to Free Vision.  Then it will be easier to see what all (serial, Ethernet) works.  :)
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on September 18, 2014, 04:18:34 pm
For the past four months I've been busy with comedi and PicoScope (see http://www.ctrlpascal.com/ (http://www.ctrlpascal.com/) if interested).

With GNUroot I hope to work on two things soon:
1) Try Wheezy-x86 on my Android x86 tablet
2) Try to get the mouse to work as that would be very nice for Free Vision apps

Any suggestions would be appreciated very much!
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on January 02, 2015, 12:22:13 pm
Wintel might have found a way to compete with Android!   :)

On 23 Dec. 2014 I purchased a new 7" tablet with Windows 8.1 for $60 (USA).  Details are here:  http://turbocontrol.com/gnuroot.htm (http://turbocontrol.com/gnuroot.htm)

The touchscreen works with Free Pascal (& fpGUI/Lazarus) programs so this is easy!  Enjoy!  I've already got places to use it!  :)
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on April 24, 2017, 05:11:06 am
With GNURoot Debian it now comes up as Debian version 8.1 but I upgraded to 8.7 using the instructions near the bottom of this page:
  http://turbocontrol.com/gnuroot.htm (http://turbocontrol.com/gnuroot.htm)

The 2.6.0 ppcarm itself fails to run with: Illegal instruction

I'm using a Nexus 7 tablet (same device as three years ago) with Android 6.0.1 (that has been upgraded).  GNURoot (also upgraded) provides a chroot with Debian?

It has been three years since I did this before and things worked then so I don't know what might have changed so FPC 2.6.0 ppcarm doesn't even run now.
 Android?
 GNURoot?

I'm trying the *most simple* thing, so no x11 or VNC needed. Thanks in advance for *any* suggestions on why ppcarm now fails to run.  As soon as I get this working I hope to create a new wiki page so it is easier for others to share.
Title: Re: Free Pascal console programs on Android are easy
Post by: marcov on April 24, 2017, 04:26:53 pm
Stock 2.6.0 did not build hardware float targets, so that is not a standard 2.6.0 FPC.
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on April 24, 2017, 05:23:18 pm
Stock 2.6.0 did not build hardware float targets, so that is not a standard 2.6.0 FPC.

I'm sorry but I don't really understand what you wrote.  The file is the FPC ppcarm, not something that I compiled.

I also posted a new zip (not yet on web page) and tried that: HelloWorld-fpc-3.0.2.arm-linux-041917.zip  The 3.0.2 ppcarm itself fails with: Segmentation fault.
Title: Re: Free Pascal console programs on Android are easy
Post by: marcov on April 24, 2017, 07:34:38 pm
Stock 2.6.0 did not build hardware float targets, so that is not a standard 2.6.0 FPC.

I'm sorry but I don't really understand what you wrote.  The file is the FPC ppcarm, not something that I compiled.

Exactly my point. The original 2.6.0 ppcarm is OABI (for ARMV5) without hardfloat, and thus doesn't run on Raspbian or anything that has the newer EABI distributions.

And afaik android is EABI
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on April 24, 2017, 09:15:14 pm
And afaik android is EABI

It worked three years ago so did Android or GNUroot/Debian (or both) change in that time?

Is "Illegal instruction" shown by the FPC 2.6.0 ppcarm program or is it shown by the OS?

Is "Segmentation fault" shown by the FPC 3.0.2 ppcarm program or is it shown by the OS?

Is there somewhere to look up what these two errors mean (and what displayed them)?

Thanks for helping me!
Title: Re: Free Pascal console programs on Android are easy
Post by: marcov on April 24, 2017, 09:52:32 pm
It worked three years ago so did Android or GNUroot/Debian (or both) change in that time?

Debian did change from OABI to EABI. But worse, there are many 2.6.0 versions patched fo EABI,
not in the least the Raspbian version.

Quote
Is "Illegal instruction" shown by the FPC 2.6.0 ppcarm program or is it shown by the OS?

It is shown by FPC but in response to a hardware interrrupt. The corresponding *nix designation is SIGILL

Quote
Is "Segmentation fault" shown by the FPC 3.0.2 ppcarm program or is it shown by  the OS?

Segmentation fault is a catch all error, all access to unmapped addresses fall under this. Like SIGILL a hardware exception caught and reported by the FPC  runtime. Also known as GPF and SIGSEGV

Note that BSD likes often report SIGILL in cases where Linux would report SIGSEGV
Title: Re: Free Pascal console programs on Android are easy
Post by: jc99 on April 24, 2017, 10:01:04 pm
Quote
But worse, there are many 2.6.0 versions patched fo EABI,
not in the least the Raspbian version.
Why is it worse ?
Isn't it good, that it can be patched ?
And can 3.0.2 be patched too ?
Maybe a ppcarm-e for EABI and a ppcarm-o for OABI can be released ?
the names are RFC of cause
Title: Re: Free Pascal console programs on Android are easy
Post by: marcov on April 24, 2017, 10:03:35 pm
Quote
But worse, there are many 2.6.0 versions patched fo EABI,
not in the least the Raspbian version.
Why is it worse ?
Isn't it good that it can be patched ?

Well, at the time it was a good thing, providing support to people on a target that didn't have an official FPC version.

However now old "holy" versions of uncertain origins only confuse the situation.  2.6.0 is over 5 years old now......
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on April 25, 2017, 12:25:54 am
Debian did change from OABI to EABI. But worse, there are many 2.6.0 versions patched fo EABI,
not in the least the Raspbian version.

The FPC 2.6.0 ppcarm that I'm using came from here:
https://sourceforge.net/projects/freepascal/files/Linux/2.6.0/ (https://sourceforge.net/projects/freepascal/files/Linux/2.6.0/)

That is an official (not patched) version, right?

Stock 2.6.0 did not build hardware float targets, so that is not a standard 2.6.0 FPC.

I've looked up SIGILL and see that if we get that then the device has no fpu.  But I'm using the standard 2.6.0 (ppcarm) which shouldn't generate hardware floats anyway.  Something is still confusing here.  Maybe we're not supposed to compile and run FPC console programs so easily on Android?  :)
Title: Re: Free Pascal console programs on Android are easy
Post by: marcov on April 25, 2017, 10:17:18 am
Maybe we're not supposed to compile and run FPC console programs so easily on Android?  :)

Not with versions that predate android support.

As for the rest, EABI and OABI also influence parameter passing. They are mostly not compatible.

Since official 2.6.0 is afaik OABI, it is mostly only useful for generating binaries for old armv5 NAS boxes that run old OABI  linux systems. Later 2.6.x versions afaik switch to EABI, which was good for the very first RPI boxes. (EABI, but not hardfloat)

Then later raspbian also switched to hardfloat (from armv5 to armv6 ABI), and for anything with hardware floating point in an officially released version you'll need at least 3.0.0
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on April 25, 2017, 11:35:28 am
Not with versions that predate android support.

But this is running a Debian chroot in Linux, and FPC does support that well!  I'll try to raise a github issue with GNURoot tomorrow.  Thanks for your help marcov!
Title: Re: Free Pascal console programs on Android are easy
Post by: BeniBela on April 25, 2017, 11:49:30 am
Maybe we're not supposed to compile and run FPC console programs so easily on Android?  :)

Not with versions that predate android support.

As for the rest, EABI and OABI also influence parameter passing. They are mostly not compatible.

Since official 2.6.0 is afaik OABI, it is mostly only useful for generating binaries for old armv5 NAS boxes that run old OABI  linux systems. Later 2.6.x versions afaik switch to EABI, which was good for the very first RPI boxes. (EABI, but not hardfloat)

Then later raspbian also switched to hardfloat (from armv5 to armv6 ABI), and for anything with hardware floating point in an officially released version you'll need at least 3.0.0

That is the opposite of easy

Why is the thread titled "easy" when it is not easy?

Reminds of the time I tried it, too (https://github.com/benibela/xidel/issues/2). It took like a year!
Title: Re: Free Pascal console programs on Android are easy
Post by: marcov on April 25, 2017, 11:59:25 am
Not with versions that predate android support.

But this is running a Debian chroot in Linux, and FPC does support that well! 

Still ABI and hwfloat or not must match. And if the debian is not age old, it probably won't for that version.
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on April 26, 2017, 01:09:36 pm
That is the opposite of easy

Why is the thread titled "easy" when it is not easy?

Reminds of the time I tried it, too (https://github.com/benibela/xidel/issues/2). It took like a year!

Three years ago it was easy!

Thanks for your comments as I hope to make things more clear (also hope to create a wiki page if get it working again like 3 years ago).

Many people probably have a device in their home or business that has a computer in the device and it "happily" does it's work by itself for weeks. But how easily can you change just a single setting in the device when you need to? This is what has come up to me repeatedly in the past few years.  If you are a full-time programmer and develop nice GUI apps for sale or for a product this topic doesn't apply to you (so please don't confuse us simple nerds  :) ).

http://www.ctrlterm.com/ (http://www.ctrlterm.com/) is a very simple and easy way to use a 7 inch Windows tablet, and the touch screen works without any extra code.

https://atmosphere.anaren.com/products/bluetooth-smart-development-kit (https://atmosphere.anaren.com/products/bluetooth-smart-development-kit) is also "fairly" simple and allows you to use a smart phone (or an inexpensive tablet).

If you know of other ways to use inexpensive devices that are easy (for a non-programmer) please share!  Another example of use: I know a company that manufactures (low volume) equipment for business use. Adding LEDs and switches on the (waterproof) equipment (to change settings) is expensive, but using serial, Ethernet, or Bluetooth and a separate inexpensive device to change settings is very attractive! Yes, with Free Pascal and desktop PCs this is easy.

Three years ago I hoped that Free Pascal (and Free Vision) on inexpensive Android tablets would be an option.  We'll see...
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on April 27, 2017, 12:18:58 am
Stock 2.6.0 did not build hardware float targets, so that is not a standard 2.6.0 FPC.

I've looked up SIGILL and see that if we get that then the device has no fpu.  But I'm using the standard 2.6.0 (ppcarm) which shouldn't generate hardware floats anyway.  Something is still confusing here.  Maybe we're not supposed to compile and run FPC console programs so easily on Android?  :)

A good friend of mine (who uses Debian) looked things up and found this: https://lists.debian.org/debian-arm/2007/03/msg00097.html (https://lists.debian.org/debian-arm/2007/03/msg00097.html)

Is that maybe why the standard 2.6.0 ppcarm is getting SIGILL?  If so, does 2.6.4 or 3.0.0 or 3.0.2 correct this problem?
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on April 28, 2017, 02:25:53 pm
If so, does 2.6.4 or 3.0.0 or 3.0.2 correct this problem?

I just made and posted two more zips on TurboControl.com for testing:
HelloWorld-fpc-2.6.4.arm-linux-042817.zip
HelloWorld-fpc-2.6.2.arm-linux-042817.zip

I previously had:
HelloWorld-fpc-3.0.2.arm-linux-041917.zip
HelloWorld-fpc-2.6.0.arm-linux-052412.zip
HelloWorld-fpc-2.2.2.arm-linux.tar.gz

The simple instructions at the bottom of http://turbocontrol.com/gnuroot.htm (http://turbocontrol.com/gnuroot.htm) make testing easy.

When I run ppcarm from 2.6.2 and 2.6.0 I get: Illegal instruction

When I run ppcarm from 3.0.2 and 2.6.4 and 2.2.2 I get: Segmentation fault
Increasing stack size (ulimit -s 65536) doesn't change the last three errors.
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on May 19, 2017, 02:59:57 am
I finally got back to this...

I just installed the full fpc on Debian Jessie on GNUroot (chroot) on ARM and 2.6.4 was installed.  A lot of fp* programs are installed in /usr/bin/ so I tried running those.  Most get Segmentation fault, one gets Illegal instruction, and two (fpdoc & fppkg) run OK!  Any ideas on why those two run?  I'll have to look at the dependencies.
Title: Re: Free Pascal console programs on Android are easy
Post by: marcov on May 19, 2017, 11:12:56 am
fpdoc maybe doesn't use floating  point? The compiler does for literals.
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on May 19, 2017, 02:41:46 pm
fpdoc maybe doesn't use floating  point? The compiler does for literals.

I didn't try to compile any program.  I just ran the programs by themselves.  fpdoc and fppkg both run and display their options.
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on May 24, 2017, 05:32:19 am
It seems that fpc has had problems before with proot:
https://github.com/proot-me/PRoot/issues/74 (https://github.com/proot-me/PRoot/issues/74)

It also seems that development in proot and GNUroot has slowed or stopped?  Sadly things are no longer easy on Android.   :(
Please share if you know of something easy for engineers who are not full-time programmers!

Console and fpGUI programs are still easy on inexpensive Windows tablets such as this:  http://www.microcenter.com/product/439773/TW700_Tablet_-_Black (http://www.microcenter.com/product/439773/TW700_Tablet_-_Black)  :)
Control Terminal works on my TW700: http://ctrlterm.com/ (http://ctrlterm.com/)
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on May 29, 2017, 05:27:53 am
I've had PascalGUI for a while which I need to check out more:
https://play.google.com/store/apps/details?id=com.n0n3m4.droidpascal (https://play.google.com/store/apps/details?id=com.n0n3m4.droidpascal)

I'm also checking out the Limbo PC Emulator QEMU ARM x86:
https://play.google.com/store/apps/details?id=fr.energycube.android.app.com.limbo.emu.main.armv7 (https://play.google.com/store/apps/details?id=fr.energycube.android.app.com.limbo.emu.main.armv7)

I'm also testing things here a little: http://wiki.freepascal.org/ideU (http://wiki.freepascal.org/ideU)

There must be some way to run simple Free Pascal & FreeVision console programs on Android!   :)
Title: Re: Free Pascal console programs on Android are easy
Post by: jc99 on May 29, 2017, 01:35:25 pm
As a start, you are right, but in a point in time, it should be possible to create more complex Application in Android for Android. With no need to cross-compile and the ability to debug on the System itself.
My hope is that one time there is not only Laz4Android but also LazOnAndroid.

[Edit]
BTW: There are two more things to check out:
FlashPascal: http://flashpascal.sourceforge.net/

.. at the other, i can't remember the name, but it was a full Studio to compile Pascal to HTML-Websites..   




 
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on May 29, 2017, 04:50:46 pm
As a start, you are right, but in a point in time, it should be possible to create more complex Application in Android for Android. With no need to cross-compile and the ability to debug on the System itself.
My hope is that one time there is not only Laz4Android but also LazOnAndroid.

One of my favorite technical authors is Rob Landley http://www.landley.net/ (http://www.landley.net/) who has a lot of interesting stuff:
https://www.patreon.com/posts/mkroot-is-almost-9607891 (https://www.patreon.com/posts/mkroot-is-almost-9607891) - has a great video at the bottom
http://se-instruments.com/ (http://se-instruments.com/) - real engineering where he works

As you (and Rob) mention, it probably won't be very long before we're developing Android apps on Android!  I'm wanting to start this now with simple console apps.

BTW: There are two more things to check out:
FlashPascal: http://flashpascal.sourceforge.net/

.. at the other, i can't remember the name, but it was a full Studio to compile Pascal to HTML-Websites..

I'm looking for simple console programs!  Those are other things but thanks for sharing...
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on May 30, 2017, 04:34:07 pm
Does anyone here use PascalGUI?

I've seen it mentioned a few times, but is there anywhere that is better to discuss it than in this message thread?

I've been doing some research on writing (C or Java or Python or Pascal) console programs directly on Android and some recent links are below.

https://en.wikipedia.org/wiki/Self-hosting (https://en.wikipedia.org/wiki/Self-hosting)
http://landley.net/aboriginal/about.html#selfhost (http://landley.net/aboriginal/about.html#selfhost)
https://en.wikibooks.org/wiki/Android/Terminal_IDE (https://en.wikibooks.org/wiki/Android/Terminal_IDE) - first section is nice
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on May 31, 2017, 11:16:23 pm
Am I the only person left who cares about simple things like console programs on Android?  :-\

I do need to find some way to keep busy since retiring (there are a lot of us old Delphi programmers).  :)

So I added the 4th paragraph (5th if you count the TOC) here today: http://controlpascal.com/tutorial.htm (http://controlpascal.com/tutorial.htm)
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on June 03, 2017, 01:24:15 pm
I'm not the smartest cookie, but I refuse to give up and quit!  :)

http://controlpascal.com/self-hosted.htm (http://controlpascal.com/self-hosted.htm) has link to new wiki page!
Title: Re: Free Pascal console programs on Android are easy
Post by: jc99 on June 04, 2017, 09:11:31 am
BTW: There are two more things to check out:
FlashPascal: http://flashpascal.sourceforge.net/ (http://flashpascal.sourceforge.net/)

.. at the other, i can't remember the name, but it was a full Studio to compile Pascal to HTML-Websites..

I'm looking for simple console programs!  Those are other things but thanks for sharing...
You're probably right, they are defintily not simple, but as I can remember they both do console-programs.

BTW I am interested in console-programs simple and not so simple
e.G:
Code: Pascal  [Select][+][-]
  1. Unit Unt_iopcc;{$mode delphi}{$H+}Interface Procedure Main;Implementation{$define WaitAtEnd}
  2. Function X(B:Boolean;I1,I2:Integer):Integer;Begin If B Then Result:=I1 Else Result
  3. :=I2;End;Var A:Array[0..999]Of Integer;Const B=39;C:Array[0..3]Of Integer=(0,-1,B
  4. -1,-1);D:Array[0..3]Of Integer=(1,-B,-1,B);Procedure Main;Const E:Integer=22;Var
  5. F:Integer=0;G:Array[0..999]Of Integer;H:Array[0..3]Of Integer;I:Integer=0;J:Integer
  6. =0;K,L,M,N,O,P:Integer;Q:Integer=0;Begin Randomize;A[0]:=2;O:=B*E-1;L:=O;A[O]:=24
  7. ;While(Q<>0)Or(J>=I)Do Begin N:=O;O:=L;K:=A[N];P:=0;Q:=0;While(P<4)Do Begin L:=D[
  8. P]+N;If((L>=0)And(L<B*E)And(C[P]<>(L Mod B))And((K And 16)<>(A[L]And 16)))Then Begin
  9. H[Q]:=P;Q:=Q+1;End;P:=P+1;End;If(Q<>0)Then Begin P:=H[Random(Q)];L:=D[P]+N;M:=A[L
  10. ];M:=M Or 16;A[N]:=K Or 1 Shl P;A[L]:=M Or(1 Shl((P+2)Mod 4));G[J]:=L;J:=J+1;End
  11. Else Begin L:=X(J>I,G[I],L);I:=I+1;End;End;Write('  ');P:=B-1;While(P>0)Do Begin
  12. Write(' ');P:=P-1;Write('_');End;While(E>0)Do Begin Writeln;E:=E-1;Write('|');L:=
  13. B;While(L>0)Do Begin L:=L-1;Write(Copy('_ ',((A[F]Div 8)Mod 2)+1,1));F:=F+1;Write
  14. (Copy('| ',((A[F]Div 4)Mod 2)+1,1));End;End;{$IFDEF WaitAtEnd}Readln;{$ENDIF}End;
  15. End.  
  16.  
... would be my item for an IOPCC if there where any ...
the unobfuscated code is in my GidHub - Repo soon ([edit]diverses[/edit] section)
https://github.com/joecare99/Public/tree/master/Fun


Title: Re: Free Pascal console programs on Android are easy
Post by: jc99 on June 08, 2017, 02:25:09 pm
@Paul Breneman:
I think, you are right, since nobody seems to give a damn ...
By the way the Main prog looks like:
Code: Pascal  [Select][+][-]
  1. Program IOPCC;
  2. {$Apptype Console}
  3. uses unt_iopcc;
  4. begin main end.
but that should be obvious ...
Title: Re: Free Pascal console programs on Android are easy
Post by: jc99 on June 18, 2017, 01:08:17 am
Am I the only person left who cares about simple things like console programs on Android?  :-\

I do need to find some way to keep busy since retiring (there are a lot of us old Delphi programmers).  :)

So I added the 4th paragraph (5th if you count the TOC) here today: http://controlpascal.com/tutorial.htm (http://controlpascal.com/tutorial.htm)
I tried an alternative approach and got at least some attention (but no reaction from your side either)
see:
http://forum.lazarus.freepascal.org/index.php/topic,37229.msg249603.html#msg249603
Title: Re: Free Pascal console programs on Android are easy
Post by: jmpessoa on June 18, 2017, 02:21:50 am
Well,

LAMW has "indirect" app console support.

There is a "New Project" entry: "Android Console App [Lamw]".

A demo is here:

https://github.com/jmpessoa/lazandroidmodulewizard/tree/master/demos/Console/LamwConsoleAppDemo1

and about "indirect" support you can read the "readme_How_To_Run_Real_Device" in project folder...

https://github.com/jmpessoa/lazandroidmodulewizard/blob/master/demos/Console/LamwConsoleAppDemo1/readme_How_To_Run_Real_Device.txt
Title: Re: Free Pascal console programs on Android are easy
Post by: jc99 on June 18, 2017, 11:52:17 am
Could you try to run my Console-Progs ?
--- and - if successful - publish some pictures ?
PS try that one too:
Code: Pascal  [Select][+][-]
  1. program Prj_WritePascal4;
  2.  
  3. const
  4.   i64: int64 = 1055120232691680095; (* This defines "Pascal" *)
  5.   cc: array[-3..3] of string = (* Here are all string-constants *)
  6.     ('\ '#8' \  ', #8'__    ', #8'__/\  ',
  7.     '  '#8'    ', #8'__/\  ', '  '#8'    ', #8'__/\  ');
  8. var
  9.   x, y: integer;
  10.  
  11. begin
  12.   for y := 0 to 11 do
  13.   begin
  14.     Write(StringOfChar(cc[0][1], 13 - y));
  15.     for x := 0 to 16 do
  16.       Write(copy(cc[(((i64 shr ((x and 15) * 4 + y div 3)) and (3 -
  17.         (y div 9) shl 1))-4 + (2 - y mod 3) shl 2) mod 4], 1,
  18.          5 + (x mod 3) and 2));
  19.     writeln;
  20.   end;
  21.   readln;
  22. end.
  23.  
[UnSpoiler] I'll publish the obfuscated version in the other thread.
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on June 19, 2017, 11:42:19 am
I tried an alternative approach and got at least some attention (but no reaction from your side either)
see:
http://forum.lazarus.freepascal.org/index.php/topic,37229.msg249603.html#msg249603

Sorry jc99, but I don't get your joke?  You can update the wiki page yourself...
Title: Re: Free Pascal console programs on Android are easy
Post by: Thaddy on June 19, 2017, 12:46:30 pm
http://turbocontrol.com/gnuroot.htm (http://turbocontrol.com/gnuroot.htm) is a new (unpublished) web page.  Feedback appreciated!

The original still works on my samsung S4 mini.
Title: Re: Free Pascal console programs on Android are easy
Post by: jc99 on June 19, 2017, 01:00:13 pm
Sorry jc99, but I don't get your joke?  You can update the wiki page yourself...
Me neither, what Wiki Page ?
Have you actually tried my mini-programs ?
I started a thread about (mini-)console (demo-)programs ...
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on June 19, 2017, 03:39:02 pm
... what Wiki Page ?

http://wiki.freepascal.org/self-hosted (http://wiki.freepascal.org/self-hosted)
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on June 19, 2017, 03:40:28 pm
http://turbocontrol.com/gnuroot.htm (http://turbocontrol.com/gnuroot.htm) is a new (unpublished) web page.  Feedback appreciated!

The original still works on my samsung S4 mini.

What version of Android are you running on your S4?
Title: Re: Free Pascal console programs on Android are easy
Post by: Thaddy on June 19, 2017, 03:42:54 pm
4.4.2 (this is after a Samsung firmware upgrade. Did not affect functionality.)
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on June 19, 2017, 04:03:20 pm
4.4.2 (this is after a Samsung firmware upgrade. Did not affect functionality.)

Thanks!  Android 5 is where things apparently stopped working...
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on June 20, 2018, 04:24:06 pm
One year later...

There is a new Android program (UserLAnd) (that replaces GNURoot) for Android devices.  Can we please try to get Free Pascal (and Lazarus) working on Debian?
http://www.turbocontrol.com/userland.htm (http://www.turbocontrol.com/userland.htm)
Title: Re: Free Pascal console programs on Android are easy
Post by: Thaddy on June 20, 2018, 05:07:11 pm
One year later...

There is a new Android program (UserLAnd) (that replaces GNURoot) for Android devices.  Can we please try to get Free Pascal (and Lazarus) working on Debian?
http://www.turbocontrol.com/userland.htm (http://www.turbocontrol.com/userland.htm)
What makes you think it doesn't? (written on Raspbian Debian)
FPC is even in the standard repositories. In stretch it is 3.0 and in backports for stretch 3.0.4
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on June 20, 2018, 05:21:45 pm
What makes you think it doesn't? (written on Raspbian Debian)
FPC is even in the standard repositories. In stretch it is 3.0 and in backports for stretch 3.0.4

Sorry for not being more clear.  I know that it works on Raspbian.  Does it work on Android in Debian (using UserLAnd)?  Please let me know if you find out!
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on June 22, 2018, 02:45:53 am
I just did:

sudo apt-get update
sudo apt-get install fpc

and after a long time installing fpc 3.0.0 on my 64-bit phone I can run fpc apparently without problems.  Web page to be updated soon!

It looks EASY again!
Title: Re: Free Pascal console programs on Android are easy
Post by: Paul Breneman on June 29, 2019, 11:46:54 am
Web page to be updated soon!

It looks EASY again!

www.turbocontrol.com/userland.htm is updated.

After almost another year (I'm almost retired but still having fun) the userland page above has been updated and things are working for my AARCH64 phone with FPC 3.2 beta!
TinyPortal © 2005-2018