Open Forum > What's New

ScriptBasic for Android

(1/15) > >>

Support:
Armando Rivera and our new ScriptBasic developer Steve Dover were able to get scriba (ScriptBasic command line interpreter) working on Google Android Linux.



If you would like to run scriba on a unrooted device, you need to install it in the /data/data/jackpal.androidterm directory (or the directory your terminal app uses) to make it executable and read/write files.


--- Quote ---It would be nice if you could put native binaries directly onto the SD card (either external or built-in) but you can't. Well, you can — but you won't be able to set execute permissions on them, which means they won't run. The SD card is mounted in such a way as to prohibit setting 'x' permissions. You can set execute permissions in the app storage area — that part of the filesystem that is rooted at /data/data. On an unrooted device you won't be able to create files just anywhere in this directory, because each app has its own security credentials — effectively each app runs as a different user. Only one directory under /data/data will be writeable by a specific app. Once you've found that directory, you can copy a binary into it, and run it at the terminal emulator prompt.

--- End quote ---


--- Quote ---The results show that native C applications can be up to 30 times as fast as an identical algorithm running in Dalvik VM. Java applications can become a speed-up of up to 10 times if utilizing JNI.

--- End quote ---

Support:

--- Quote from: AIR ---If you're using the Android Terminal app,  I think you should be able to create a directory via adb called /data/local/bin on a non-rooted device.  Then use adb to copy scriba there, and when you launch the Terminal app, scriba will be in the path that the app sets up.

I've managed to embed scriba within the Term.apk file itself, but it needs to be extracted from the apk so that the shell can find it, which I haven't worked out yet (building Win7 systems for a client this weekend.  Yuck.  sysprep to the rescue.)

A.

--- End quote ---

Updated Instructions


--- Code: ---adb shell
mkdir /data/local/bin
exit
adb push scriba /data/local/bin/
adb push hello4.bas /sdcard

adb shell
cd /data/local/bin
ls -l (check permissions)

if needed, chmod 755 scriba

Then in Term app: scriba /sdcard/hello4.bas

--- End code ---

Support:
The phone I have been waiting for.

   

Samsung Galaxy S III

quad core 1.4 GHz Exynos CPU

Detailed Review

Support:
I was able to get ScriptBasic for Android to display an Android GUI message box (makeToast) from a SB script. This is using the SL4A (Scripting Layer for Android)


--- Code: ---OPEN "localhost:56098" FOR SOCKET AS #1
PRINT #1,"{id:1,method:makeToast,params:[\"ScriptBasic\"]}"

--- End code ---

Support:
I was using SL4A r4 to run my initial tests. I found that I had to look at the properties of the RPC server to get the port it assigned. This was a PITA but this is proof of concept so I didn't mind the extra step. I recently installed SL4A r5 and it allows setting a default port for the RPC server.

What's new in SL4A - Scripting Layer for Android r5:
[*]MediaRecorderFacade: If you record a video file with extension mp4 or 3gp it uses the appropriate format with the more common h264 codec.
[*]SensorManagerFacade: Orientation threshold events were causing excessive entries into the Event Queue, so I have limited entries to threshold crossing both ways.
[*]New media recorder option: recorderStartVideo allows you to specify video size.
[*]Improved error trapping in the activityForResult functions, and now you can specify mimetype without data.
[*]Changed eventWaitFor to check for events already in queue.
[*]Support for full screen user interface
[*]Ability to set server port to a known value (Preferences-->General-->Server Port)
[*]Editor: goto line number, and ability to turn of autocomplete, set no wrap, find and replace, auto-indent
[*]Added "inputType" parameter to dialogCreateInput
[*]Better support for "unsupported" interpreters
[*]Assorted other fixes and tweaks.
[/list]

Android API

Navigation

[0] Message Index

[#] Next page

Go to full version