Main Page

From RFO-BASIC! Manual
Revision as of 17:22, 14 February 2024 by Spike (talk | contribs) (→‎OliBasic: Publish V30x_w)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Manual contents (Statement index)
Language features The basicsArraysData structuresInterrupt routinesUser-defined functions
Interfaces Audio playerBluetoothFilesGraphicsHTMLKeyboardSocketsSQLTelecom
Programming notes Coexisting with Android

Welcome! This wiki documents RFO-BASIC! versions 1.91/1.92/1.92.1, a BASIC interpreter that runs on Android, with a program text editor, that lets old-style programmers quickly write apps with access to most of the device's features, including web surfing, telephony, and texting. This manual is based on the published manual, plus comments the community has provided on the Forum.

Pages of this wiki will be written gradually and will be based on the existing manual, on personal observations, on study of the examples in the distribution kit, and on discussions on the Forum. Any given assertion might not yet have been reviewed by anyone with detailed knowledge of the code. It may give you additional insight but you rely on it at your own risk. This website is not complete until we say it is!

This wiki contains an overview article, which is a useful place to start reading.

To make suggestions or report mistakes, click on "Discussion" at the top of the article in question, to edit that article's talk page; or use the Forum. This is a wiki that anyone can edit. However, if English is not your native language, please comment on the Discussion page, adding links to relevant Forum discussions or bug reports, and allow me to shine it up.

Running RFO-BASIC! programs[edit]

Apps written in RFO-BASIC! can be activated in one of two ways:

  1. You can sideload the APK file for RFO-BASIC! and install it on the Android device. Then run it and give it the permissions it requests. This is not as scary as it seems; for example, RFO-BASIC! does not need to send texts, but it requests that permission so that BASIC programs can do so (with the SMS statements).
    A BASIC source file can be transferred to the Android device in any desired way, such as with Bluetooth, web transfer, or thumbdrive. BASIC code can also be written using the text editor in RFO-BASIC!.
    Once both RFO-BASIC! and the BASIC source program are on board, you can run the program in one of the following ways:
    • Start RFO-BASIC, select Load and run on the pulldown menu, and specify the name of the BASIC source program.
    • Installing RFO-BASIC! adds a widget that lets you associate a BASIC source program with a graphic and places the graphic on the home screen. The Android device will run the BASIC program whenever you touch the graphic.
  2. Several programs mentioned below let you develop the BASIC program on a PC and create an APK file that includes both the RFO-BASIC! interpreter and the BASIC program. This APK file can be sideloaded onto the Android device. (Such APK files are not "shrink-wrapped" programs. A user of the APK file could view or change the BASIC code by renaming APK to ZIP and then exploring the file.)

Newer versions[edit]

Version 1.92

In 2019, Google imposed new requirements on publishing APK files created using option 2 above on the Google Play Store. RFO-BASIC! version 1.91 used API 18 as the target Android version, but Google requires that apps published on the Play Store must target a current Android API Level. RFO-BASIC! version 1.92, published in April 2019, runs on API Level 27 (Android 8/Oreo). It can run on API Level 28 (Android 9/Pie) but some commands fail.

Additional changes in version 1.92 are as follows:

  • On installation, the procedure to grant RFO-BASIC! various Android permissions is different.
  • The user interface uses Japanese if that is the locale specified for the Android device.
  • SMS messaging is no longer supported in the Google Play Edition, but is supported in the Full Edition.
  • The documentation of the NOTIFY statement mentions that it produces different results on different versions of Android.
Version 1.92.1

A version called 1.92-gp (Google Play) was prepared, limited to meet Google's restrictions on the Play Store, but was never put into the Play Store because bugs remained, primarily related to changes Google made to programs that used the Apache library.

On 30-Jul-20, Mougino prepared version 1.92.1. It omitted the SMS statements, packaged in the GW user-interface library and a new Sample Programs/f41_gw_gui.bas as an introduction, revised and corrected Sample Programs/f01_commands.bas, and fixed the crash in the DEVICE statement in API 22 and newer. It targets API 29.

The package name is com.rfo.Basic because com.rfo.basic already exists in the Play Store. This means it could coexist with the other "current versions," and a BASIC program running under 1.92.1 could run concurrently with a BASIC program running under another current version. You should rename the rfo-basic directory before installing the version 1.92.1, in order to preserve work done under the old version.

Alternatives to version 1.92 are to use one of the private versions of RFO-BASIC!, such as hBasic or Oli-BASIC, or special instructions to the APK compiler.

Resources[edit]

Implementors are welcome to modify the web addresses in this list if their projects move.

RFO-BASIC!

Classic RFO-BASIC! versions can be found in the following places:

The official manual, De Re BASIC!

Robert Rioja has written a Language Reference Manual, a User Guide, and documentation on how to use the Formatter (through the USING$() function of RFO-BASIC!), available on his website.

There is also an incomplete tutorial based on version 1.71.

Private versions[edit]

Several users have taken RFO-BASIC! further and published newer versions. This wiki describes areas in which they have done additional work, but does not document their versions.

hBasic[edit]

The hBasic repository cover page is at:

https://humpty.firstcloudit.com/promotes/rfo-basic/hbasic/hbasic.html

Clicking on hBasic Repository gains access to the following installable APK files:

  • v2.94, 2020, targets Android API 29 with a flag in the Manifest to specify the traditional file-storage scheme instead of Scoped Storage; ensures that the DEVICE.OS statement returns a usable result
    • "hbasic.v2.94-for-quick.apk" is the final version that will work with Mougino's QuickAPK. However, APKs produced with it will not be accepted by the Google Play Store and will not run with Android 11 and newer.
  • v4.30, 2-Jul-22, targets API 31 (Android 12) (but see v4.48 below regarding a fix made in v4.39). Includes an FTP server to get around Scoped Storage. Unified control stack ensures that exiting a control block discards inner blocks. Adds color and formatting features to the text console. Colors can be specified by strings as well as RGB codes throughout. User interface and menus are more customizable. Uses Android 11 "Themes" compatibly across console, graphics display, and HTML display. Announced in the Forum. See also announcements of the intermediate versions v3.32, v4.13, v4.15, and v4.21.
  • v4.49, 18-Dec-22, PROGRAM.INFO returns more items, FILE statements improved, bugs fixed; corrects the Manifest to allow installation on Android 12 devices; improvements to new CONSOLE control and to graphic acceleration. Shortcut on the home screen will divert interpreter to the specified program even if it had been running a different one. Various other fixes and heuristics to accommodate changes in Android. Announced in the Forum. See also announcements of the intermediate versions v4.38, v4.39, and v4.48.
  • v4.60, 3-Mar-23, targets API 33. Enhances statement syntax, such as for SENSORS; fixes longstanding bugs, such as in the widget and use of the clipboard. Announced in the Forum.
  • v4.78, 23-Aug-23. Fixes and enhancements for Bluetooth, GPS, sensors, and text console; new example files. Announced in the Forum. The intermediate version v4.68 (26-Jun-23) was announced in the Forum.
  • v4.84, 13-Oct-23. Adds syntax for (1) more detailed control over Android notifications, (2) device-independent queries about locale, Android version, and battery status, and (3) inhibiting brief display of the text console in BASIC programs that use the graphics or browser displays. Announced in the Forum.
  • v4.93, 3-Jan-24, targets API 34. Smoother operation of text console, device orientation, and FTP server. Most of these changes are described in the Forum announcing v4.91 (30-Nov-23), of which v4.93 fixes two bugs.

Filenames on this repository have _file appended (such as hbasic.v4.93.apk_file). This must be removed manually after downloading to get a usable .APK file.

A programmer's reference manual on the latest version is available as a .ZIP file. (Its name is hmanual.zip_file; again, remove "_file" after transferring it.) This manual documents only the differences from RFO-BASIC! version 1.91.

OliBasic[edit]

OliBasic has made ambitious additions to RFO-BASIC! — most notably, a set of ARRAY statements that quickly operate on data in numeric arrays, obviating time-consuming loops in the BASIC code. Like hBasic, OliBasic implements the unified control stack, ensuring it discards loop information when the program exits an outer loop or returns from a routine.

In addition to the documentation linked to above, Robert Rioja has reworked the RFO-BASIC! manual to incorporate the OliBasic enhancements. This manual is on his RvAdList website.

Grau-BASIC[edit]

Grau-BASIC is RFO-BASIC! v1.91 with Bluetooth Low Energy (BLE) support, supporting source file editing from the PC.

Other support software[edit]

GW library

The GW library is Mougino's user-defined functions that create user-interface objects to make it easy to write an app. The library is a part of RFO-BASIC! version 1.92.1. Download information for version 5.5 (25-Feb-21) is available through the RFO-Basic! Forum.

hSuite

The private variant hBasic (see above) is structured as a variety of patches applied to standard RFO-Basic!. The hSuite package lets the user apply any or all of those patches, creating a personal hBasic with only the desired features. The current version is hSuite v3.21. It is available on DropBox for Windows or Linux.

Android BASIC Compiler (ABC)

Mougino announced the Android BASIC compiler in 2016. It assembles the RFO-BASIC! interpreter directly from GitHub, plus the user's desired BASIC program, and produces an APK file.

In January 2022, Google removed it from the Play Store, claiming that it uploaded the user's phone number. Mougino provided source code to disprove this but did not prevail. He specifies in the Forum how to get an archived copy of ABC.

Other development tools
  • BasicWorks is Emile's Integrated Development Environment to develop BASIC programs into APKs on the PC for sideloading onto an Android device. Emile offers in the Forum to provide a link to get a copy, on Google Drive, on request — partly in order to gauge the interest for it. Years ago, a version was known as RFODESIGNER.
  • Launcher is Mougino's software that lets you write BASIC code on the PC and then transfer it and execute it on your Android device.

For more support software, visit the Tools for BASIC! topic on the Forum.

BASIC routines

This wiki contains the documentation for the following user-defined function, which anyone is welcome to include in BASIC programs:

Other helpful information

Sources[edit]