msharma-boop / android-scripting

Automatically exported from code.google.com/p/android-scripting
0 stars 0 forks source link

Add Squirrel support #594

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I found a Squirrel package for SL4A.
How about supporting this officially.

http://forum.squirrel-lang.org/mainsite/forums/default.aspx?g=posts&t=2098

Original issue reported on code.google.com by tomcatalbino on 26 Jan 2012 at 12:58

GoogleCodeExporter commented 9 years ago
I installed it into my android phone.
It seems the install succeed.
But when I selected the "Add" menu it falls.
So I wrote a Squireel code from an editor and named it "Hello.nut"
Write this code.

print("Hello\n");

It gets some rpc error message but it seems the output works !

Original comment by tomcatalbino on 26 Jan 2012 at 4:32

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
>It gets some rpc error message but it seems the output works !
It wasn't an error. It was only print messages for debug.
I tried these kind of codes and it worked nice !

dofile("/sdcard/com.googlecode.squirrelforandroid/init.nut");
android.makeToast("Toast using Squirrel");
android.webViewShow("http://www.google.com");
android.launch("com.android.calculator2.Calculator");
android.notify("Notify using Squirrel","Message");
android.ttsSpeak("Speak using Squirrel");
android.vibrate();

By the way, What's the difference with the Issues list and the forum site ?
It seems that some messages are hide (or maybe post failed or maybe not 
permitted).

Original comment by tomcatalbino on 4 Feb 2012 at 4:33

GoogleCodeExporter commented 9 years ago
I investigated what is required to support Squirrel.

1. Add SquirrelLanguage.java to 
http://code.google.com/p/android-scripting/source/browse/android/Common/src/com/
googlecode/android_scripting/language/

It needs at least these codes.

///////////////////////////////
package com.googlecode.android_scripting.language;
public class SquirrelLanguage extends Language {}
///////////////////////////////

2. Fix the class SupportedLanguages at enum KnownLanugage in 
http://code.google.com/p/android-scripting/source/browse/android/Common/src/com/
googlecode/android_scripting/language/SupportedLanguages.java

It needs this code below between [PHP(".php", PhpLanguage.class)] and [;].

///////////////////////////////
SQUIRREL(".nut", SquirrelLanguage.class)
///////////////////////////////

3. Add an icon named "nut_icon.png" in 
http://code.google.com/p/android-scripting/source/browse/android/ScriptingLayerF
orAndroid/res/drawable/
(It means all support languages icon have to be in the SL4A's apk.)
The name must be "nut_icon.png". It seems to be a rule.
See more information in 
http://code.google.com/p/android-scripting/source/browse/android/Common/src/com/
googlecode/android_scripting/FeaturedInterpreters.java
"getInterpreterIcon" decides the icon name.

(4.Optional) If SL4A supports "Squirrel" officially it should have an apk path 
to download.
It's also in FeaturedInterpreters.java.

Perhaps only these procedures. If there is some other things to be done please 
reply to this.

Original comment by tomcatalbino on 7 Feb 2012 at 11:42

GoogleCodeExporter commented 9 years ago
working on the changes you suggested, in order to make Squirrel officially 
supported

Original comment by licheng...@gmail.com on 2 Apr 2012 at 2:28

GoogleCodeExporter commented 9 years ago
A new Squirrel for Android is released; see 
http://forum.squirrel-lang.org/default.aspx?g=posts&t=2225

Will see how to make it part of the offical SL4A release...

Original comment by licheng...@gmail.com on 6 Apr 2012 at 5:43