User Tools

Site Tools


en:projects:gforth-android:start

This is an old revision of the document!


Gforth — GNU Forth for Android

Project goal is to use Gforth as programming system on Android.

Project Status

  • There is Gforth in Play Store, installable on Android 2.3 or later (native activity)
  • This has a OpenGL terminal emulation and allows remote telnet on port 4444 (depending on what you call in /sdcard/gforth/site-forth/starta.fs)
  • It recognizes touches, and the menu button/softkey toggles the software keyboard

Starting the app first time unpacks the Gforth sources to the SD card. That's a few megabytes, and therefore it takes its time. Gforth shows a spinning wheel while it's doing so, but can't respond to any input events. If the spinner shows you “Done; restart Gforth” for a while, you should kill and restart Gforth - it got stuck. If you still have problems, there's a gfortherr.log and a gforthout.log in /sdcard, which might provide more diagnosis.

The terminal uses a fragment shader, which implements a colored ASCII terminal - it uses two textures, one with the character set, and another with the characters and colors. An update of the terminal screen therefore only takes a few milliseconds - just like it used to be with in text mode. This has been tested with several really cheap phones with awful OpenGL implementations, so it should work on yours, too.

I recommend the following keyboards (in that order):

Examples

All Android examples are packet into /sdcard/gforth/site-forth. There is

  • gl-sample.fs: A simple OpenGL demo
  • omx-example.fs: Playing videos. Download my Jingle Bells as test stream into /storage/extSdCard/Filme, then you can start it with jb, or any other MPEG 2 transport stream file with “<filename>” play-ts, or a MKV file (H.264, MP3 or AAC) with “<filename>” play-mkv.
  • gl-slideshow.fs: Plays a slideshow. Put photos into a directory, and a file listing all filenames (including path). Load that file with “<slidelist>” slide-show.
  • android-recorder.fs: Records a video, when you start camera-test. The recorded video will end up in /storage/extSdCard/Filme/test.mp4.

Troubleshooting

Gforth logs info into the files /sdcard/gfortherr.log and /sdcard/gforthout.log. If something goes wrong, look here if you find an error message. If a source file is missing or defect, you can remove /sdcard/gforth/; it is sufficient if you delete the file sha256sum in the subfolder with the current release name.

Documentation

Gforth has a big manual, which is also available as eBook PDF (some non-breakable texts are cut off in this small size).

en/projects/gforth-android/start.1396375909.txt.gz · Last modified: 2014-04-01 20:11 by bernd