Home   Archive   Permalink

R3 for SL4A (Android)


posted by:   Nick     26-Apr-2014/22:15:39-7:00

Hi Nick -
So I've got all the files and the .apk installed on my G-nex phone. Everything seems to be working but I can't get the rebol.r file to the Rebol3 for SL4A interpreter, or for that matter, any file.    
The interpreter is running, although the only option from it seems to be uninstall.    
Jota can't find it.    
Total commander brings up a list of all the apps that Android recognizes, a long list, and the r3/sl4a isn't on it. Of course, the R3/Droid interp isn't on it either, but it has a command line you can write commands into, and load files that way.
So I'm waiting for someone else to find the solution.

posted by:   yoffset     27-Apr-2014/17:44:31-7:00

I just tried a few more things, including uninstalling droid. Nope. It just isn't recognized.

posted by:   yoffset     27-Apr-2014/18:13:11-7:00

Have you installed SL4A? That needs to be done first. When that's done, then you can install and run the APK. It'll install the scripts and everything needed - the whole install process for everything takes just a few seconds. You'll see them when you run SL4A (same is true for other language packages like Python, Lua, etc.).

posted by:   Nick     27-Apr-2014/21:49:26-7:00

I'm using this on a low powered Walmart phone, and it runs without a hitch:

posted by:   Nick     27-Apr-2014/21:50:43-7:00

Quick API info for SL4A:
It's really cool to do voice recognition, take photos, call numbers, etc., with a line of Rebol :)

posted by:   Nick     27-Apr-2014/22:36:30-7:00

"Have you installed SL4A?"
So, it's not an .apk file, so what exactly has to be done?

posted by:   yoffset     28-Apr-2014/1:04:59-7:00

SL4A is available at the link I posted above:
Download and install that .apk , then download and install the installer .apk at:
Then run SL4A. Because SL4A is not available from Google Play Store, you need to have "Unknown Sources" checked in your Android Application Settings ("Allow installation of non-Market applications").
When you run SL4A, you'll see some example .reb scripts demonstrating how to use the SL4A API (including speech recognition, text to speech, dialogues, photo taking, etc.). Most of the examples are just 1 or a couple lines, using the functions in the SL4A API. You can learn to use more of the SL4A API at:
Here's an example which dials a phone number (if you're using an Android phone):
     sl4a 'phoneCallNumber "1234567"
This example print the words gotten by speech recognition:
     w: sl4a 'recognizeSpeech " "
     print w/result
You can use the code editor built into SL4A, or another that is installed on your device (I use Jota). Notice the ' tick in front of the SL4A function.

posted by:   Nick     28-Apr-2014/4:42:26-7:00

It installed without a hitch also on Bluestacks (Android in Win7)

posted by:   Nick     28-Apr-2014/11:25:27-7:00

There is a book about SL4A. It's focus is Python, but much of it can be applied to other SL4A languages:

posted by:   Ni ck     28-Apr-2014/12:39:21-7:00

And there you go - another excellent Nick/tutorial. I thank you. Those reading along thank you. :=)

posted by:   yoffset     28-Apr-2014/13:52:02-7:00

Thanks Nick. Got it working on my Nexus 7.

posted by:   James_Nak     1-May-2014/21:28:36-7:00

Thanks to Nick for publish!
I'm developing it, you can send me suggestios & comments
giuliolunati at gmail dot com

posted by:   giuliolunati     2-May-2014/14:33:33-7:00

Hi Giulio,
Have you put together any documentation about the the UI?

posted by:   Nick     4-May-2014/3:27:18-7:00