Главная страница Случайная страница


АвтомобилиАстрономияБиологияГеографияДом и садДругие языкиДругоеИнформатикаИсторияКультураЛитератураЛогикаМатематикаМедицинаМеталлургияМеханикаОбразованиеОхрана трудаПедагогикаПолитикаПравоПсихологияРелигияРиторикаСоциологияСпортСтроительствоТехнологияТуризмФизикаФилософияФинансыХимияЧерчениеЭкологияЭкономикаЭлектроника

Learn RFO Basic - The Easiest Way To Create Android Apps

By: Nick Antonaccio
Updated: 2-26-2013 (RFO Basic! version 1.71 or higher is required for this tutorial)
Learn the simplest and most productive development tool for Android.
There's absolutely no easier way to create full featured apps for Android phones and devices.
Visit https://rfobasic.freeforums.org to ask questions about RFO Basic.
Go to https://laughton.com/basic/versions/index.html to download RFO Basic.
See De Re Basic! for API reference documentation.
Check out easiestprogramminglanguage.com and learnrebol.com for a related in-depth desktop programming tutorials about the REBOL language, and freeconsignmentsoftware.com for a project written in it.


1. Introducing RFO Basic!
2. Getting Started: Downloading and Installing RFO Basic, Hello World
3. Several Simple Examples
3.1 Tiny Note Pad App
3.2 Teeny Timer App
3.3 Online Examples
3.4 Editing and Workflow Tips
4. RFO Basic Language Fundamentals
4.1 Functions/Commands
4.3 Variables
4.4 Function Return Values
4.5 A Variety of Useful Function Examples
4.6 Concatenation
4.7 Some Basic Text Formatting Guidelines
5. Conditions
5.1 If
5.2 White Space and Indentation
5.3 If/Else
5.4 If/ElseIf/Else
5.5 Multiple Conditions: " and", " or"
5.6 Switch
6. More Program Flow Structures
6.1 Gosub/Return
6.2 Goto
6.3 Creating Your Own Functions
7. Data Structures: Arrays, Lists, Bundles, and Stacks
7.1 Arrays
7.2 Lists
7.3 Bundles
8. Loops and Structured Data
8.1 While/Repeat and Do/Until
8.2 Looping Through Lists of Data: FOR
8.3 Choosing Items From Lists - The " Select" Function
8.4 Selecting Records From Structured Lists Data
8.5 Saving Lists of Structured Data to a Storage Medium - Serialization
8.6 Sending Serialized Data to a Web Server
8.7 Sharing data between different programming languages and environments
8.8 Using the Select Function to Create Menus
9. COMPLETE EXAMPLE APPS - Learning How All The Pieces Fit Together
9.1 Math Test
9.2 Text Editor App
9.3 Web Page Editor
9.4 Internet Chat Room
9.5 Blogger
9.6 Recipe Database
10. HTML/Javascript GUIs
10.1 An HTML Crash Course
10.2 HTML Forms - Basic GUI Widgets
10.3 Using HTML Form Data
10.4 Dynamically Creating GUI Layouts
10.5 Some More Essential HTML Tags
10.6 Responding to Links, Back Buttons, and Errors
10.7 Recipe Database #2 - A Little GUI Data Storage and Retrievel App
11. Graphics
11.1 Screen Setup
11.2 Drawing Shapes
11.3 Modifying Position and other Properties
11.4 Rendering Changes
11.5 Looping Graphic Modifications
11.6 Closing the Graphic Screen
11.7 An Animated Rectangle
11.8 Setting Orientation
11.9 Text on the Graphics Screen
11.10 Loading Images
11.11 Switching Between Graphics and Text Console Screens
11.12 Touch
11.13 A Simple Sliding Puzzle Game
11.14 Adding More Features to the Sliding Puzzle Game
11.15 Scaling Graphics to Fit Different Screen Resolutions
12. More Graphic Apps
12.1 Catch Game
12.2 Calculator
12.3 Snake
12.4 Ski
12.5 Simple Shoot-Em-Up Game
12.6 Guitar Chord Diagram Maker
12.7 Image Viewer With Swipe Gestures
12.8 Thumbnail Image Maker
13. Building GUI Interfaces Using Graphics
13.1 Basics - No HTML Required
13.2 A Typical GUI Form With a Few More Bells and Whistles
14. Transferrting Data Via Network Sockets
14.1 Ports
14.2 Servers and Clients
14.3 Blocking and Non-Blocking Loops
14.4 Port Forwarding and VPNs
14.5 Walkie Talkie (VOIP)
14.6 Desktop File Transfer
15. SQLite Databases
15.1 Tables
15.2 SQL
16. Debugging
17. Strings
18. Quick Review and Synopsis
19. Built In Help and Documentation
20. Additional Topics
21. REAL WORLD CASE STUDIES - Learning To Think In Code
21.1 A Generalized Approach Using Outlines and Pseudo Code
21.2 Case 1 - Scheduling Teachers
21.3 Case 2 - Days Between Two Dates Calculator
21.4 Case 3 - Simple Search
21.5 Case 4 - A Calculator
21.6 Case 5 - Backup Music Generator (" Jam Tool" )
21.7 Case 6 - FTP Tool
21.8 Case 7 - Jeopardy
21.9 Case 8 - Tetris
21.10 Case 9 - Media Player
21.11 Case 10 - Web Site Spidering App
22. Other Scripts
22.1 Number Verbalizer
22.2 Bingo
22.3 Voice Alarms
23. Feedback


1. Introducing RFO Basic!

What is RFO Basic? Why use it?

  • RFO Basic is a uniquely simple and productive development tool that can be used to create powerful apps for Android phones and devices. There's absolutely no easier way to program applications for Android.
  • RFO Basic runs entirely on your Android device. It's a tiny, self contained, on-device programming solution, which doesn't require any software installed on a desktop computer. You can create RFO Basic applications on your desktop PC, and if you install the Eclipse IDE and Android API, you'll be able to produce full-fledged Android APK files (" apps", " programs" ) which can be distributed in the Android app store. For those who want the simplest possible deployment solution, there's a tiny free program for Windows which automatically creates APKs for you. No additional knowledge of the Android environment is required.
  • RFO Basic is powerful. It provides access to hardware, sensors, sound, graphics, multitouch, file system, SQLite, network sockets, FTP, HTTP, bluetooth, HTML GUI, encryption, SMS, phone, email, text-to-speech, voice recognition, GPS, math, string functions, list functions, etc. Unlike other flavors of BASIC which are limited to introducing fundamental programming concepts, RFO Basic is a rich, modern, featured-filled language. Although simple to use, it's no toy, but a practical tool for creating useful Android software.
  • RFO Basic is 100% free and open source.
  • RFO Basic is supported by a friendly and knowledgeable community of active developers around the world. It's regularly improved, with updates typically occuring several times a month.
  • RFO Basic has useful built-in help for all available functions and language constructs, and several dozen complete example programs, immediately available directly on your Android device.
  • RFO Basic is ridiculously simple to learn and use. There are no deep programming language concepts to ingrain, there's no complex background knowledge to understand, no enormous desktop IDE to install, no unwieldy Android SDK to learn, no JAVA language cruft to muddy code, no app store approvals to request, or any of the typical hurdles encountered when creating programs for mobile devices. Just download the 1/2 Meg RFO Basic app to your phone, familiarize yourself with the included function reference and example programs, and start writing simple command based procedural code in a text editor. There are dozens of concise functions to manage data, to control hardware, to interact with users, and to quickly complete many types of useful work. The interpreter/runtime installs in less than a minute, and you can set up a desktop PC as a code editing machine with an additional couple minutes.
  • RFO Basic is easy enough for absolute beginners and average computer users to operate immediately, but powerful enough for a variety of professional uses. You can treat it as a simple personal calculator or utility app for your phone, or as a full blown development environment to create marketable apps. You can write quick scripts on your device to manage files, view and edit database info, process text, download web data, perform FTP uploads, take photos, process images, easily access voice recognition and other Android features, etc., or you can use it to develop graphic games or network applications which you can sell in the market - and everything in between. (Be aware that RFO Basic is GPL licensed, so if you release any commercial software which includes its code, you must also release the source).
  • Experienced developers and IT professionals will find that RFO Basic allows a wide variety of utility scripts to be developed and deployed in minutes and hours, rather than days and weeks, and with a dramatically short learning curve.
  • RFO Basic can be picked up immediately by anyone who's used any form of traditional Basic. An entire community of developers and novice programmers can leverage their existing skills in this familiar and easy environment, to build useful mobile apps.

If you're new to Basic or even to programming in general, don't fret. RFO Basic is an extremely simplesubset of other familiar Basic programming languages. You can read the entire API and the reference documentation in a single day. This tutorial will provide enough fundamental understanding, working code examples, and case studies to get you creating apps of all types, completely on your own.

2. Getting Started: Downloading and Installing RFO Basic, Hello World

The RFO Basic interpreter is an app (software program) that runs on your Android device. It translates written text in the RFO Basic language syntax (" source code" ) into apps which other users can run on their device. To get the free RFO Basic application, go to:


Go to the link above in your phone's web browser, download the most recent version of the Basic.apk file to your Android device, and run the installation (alternately, you could choose to install using the Google Play store). Once you've got RFO Basic installed, click the " Basic! " app icon to run it, press the Android Menu button on your phone, select " Clear", and type the following code into the text area:

print " Hello world! "

To execute the code, press the Android Menu button again, and select " Run".

Before going any further, give it a try. Download RFO Basic and type in the code above to see how it works. It's extraordinarily simple and literally takes just a few seconds to set up. To benefit from this tutorial, it's critical that you type or paste each code example into the RFO Basic interpreter to see what happens.