View Full Version : ScriptBasic Android
John Spikowski
03-04-2012, 07:56
*** deleted ***
Charles Pegge
03-04-2012, 12:03
How did you compile it John? I got the impression that the Android sdk development environment was all Java.
Charles
Charles Pegge
04-04-2012, 09:58
Extension modules:
That is going to be quite a challenge, John. The Devices, GUI and graphics environment will differ substantially from regular PCs. Does the NDK allow you access all the Java-based SDK functions?
Charles
John, I used dropbox to move the unzipped file scriba from my pc to my android phone. When I try to run scriba, it will load and try to run and then it won't launch. I then renamed it to scriba.apk, it loads and when it tries to run it then gives and error saying it can't parse it. I don't want to install the android development kit at the moment to just transfer the file to my phone. Hope there is a solution.
According to this article the dropbox method should work. http://www.techrepublic.com/blog/smartphones/how-to-side-load-apps-on-your-android-device/3114
John, thanks for the information. I will launch a terminal window and see if I can get it to run from there. Will report later....
I installed the terminal emulator. chmod and chown are both available. I tried chmod 0001 scriba.apk but got permission denied as a result. The 'users' command is not available, so I am not sure who the terminal thinks the user is to try to make chown changes.
John, I got a permission denied with ls -l
I probably have to root the phone, which is not something I want to do to get true root access. This is just the terminal emulator that I am running.
ls by itself works, just as a note.
I used 'dropbox' to get it to the phone. Then I used the 'astro' file manager to move it. Both are free apps.
John, I tried tonight and failed. I took screenshots to document things.
My phone is HTC EVO 4G running Android 2.3.5
It is not rooted.
I tethered my phone via usb to my notebook.
I found the data directory under the android directory.
I then created a data sub directory in the data folder.
I copied scriba to that folder.
I then ran terminal emulator on my phone.
You can see my steps and hopefully my mistake.
I combined the 2 screenshots into one. You can see how I set things up folder wise on the sd card
and what I did in the terminal window.
Hope we can get this working, I think we are close.
7868
John, I think the help they are giving is using adb instead of seeing the phones sdcard as an external drive as I have been trying.
I connected to the phone via adb, but have no luck in finding the directory for the terminal emulator or pushing the scriba file over as they mentioned.
The help they give is much like I see on many linux help forums, very cryptic.
Here is my adb transcript. As you can see I connected via adb to my phone, but I can't get to the folders as they wrote in their help.
C:\Users\Kent\Downloads\android root>adb devices
adb server is out of date. killing...
* daemon started successfully *
List of devices attached
HT17LHL10205 device
C:\Users\Kent\Downloads\android root>adb shell ls
adb server is out of date. killing...
* daemon started successfully *
app-cache
config
cache
sdcard
acct
mnt
vendor
etc
ueventd.supersonic.rc
ueventd.rc
ueventd.goldfish.rc
system
sys
shutdown.supersonic.rc
sbin
proc
init.supersonic.rc
init.rc
init.goldfish.rc
init
default.prop
data
cwkeys
bootcomplete.supersonic.rc
bootcomplete.rc
root
dev
C:\Users\Kent\Downloads\android root>adb shell cd data
adb server is out of date. killing...
* daemon started successfully *
C:\Users\Kent\Downloads\android root>adb shell ls
adb server is out of date. killing...
* daemon started successfully *
app-cache
config
cache
sdcard
acct
mnt
vendor
etc
ueventd.supersonic.rc
ueventd.rc
ueventd.goldfish.rc
system
sys
shutdown.supersonic.rc
sbin
proc
init.supersonic.rc
init.rc
init.goldfish.rc
init
default.prop
data
cwkeys
bootcomplete.supersonic.rc
bootcomplete.rc
root
dev
C:\Users\Kent\Downloads\android root>
I also just tried this John.
C:\Users\Kent\Downloads\android root>adb devices
adb server is out of date. killing...
* daemon started successfully *
List of devices attached
HT17LHL10205 device
C:\Users\Kent\Downloads\android root>adb push scriba /data/data/jackpal.androidterm
adb server is out of date. killing...
* daemon started successfully *
failed to copy 'scriba' to '/data/data/jackpal.androidterm/scriba': Permission denied
C:\Users\Kent\Downloads\android root>
Too me it looks like you need to root the phone. From reading the help they posted on the link you presented, it looks like they just assume it will work. I would like to see their adb logs of actually doing on an unrooted phone.
John, yes I did get his terminal emulator from the google play market.
I am running Windows 7 on my notebook and not linux. Perhaps that is causing the problems, but adb should run the same on both I would think?
Can you ask your developers to just print their adb transcripts not from the emulator, but from a pc to an android non rooted cell phone as I have done.
In my case, I put the scriba file on my pc in the folder where my adb.exe file is. So it would be nice to see from start to finish.
From PC:
adb devices
adb push scriba
any other commands they might use for permissions etc.
Then from the Phone, running Terminal Emulator and getting scriba to run.
I think you're making this much harder then it needs to be.
1. Copy the scriba file to the /Android/data/data/jackpal.androidterm directory
2. In your jackpal terminal cd /Android/data/data/jackpal.androidterm
John, that is the problem, can't do those steps. I get permission denied or the directories are not there.
Anyways, I finally rooted my phone. Here is how things are on the phone.
The sdcard and data are all directories in the very root of the phone.
There is no jackpal directory on the sdcard at all. It is in the root and then in the data folders.
I will use your other tips to get it working, at least on a rooted phone... hope to come back with good results tonight or tomorrow :)
John, pleased to announce success with a rooted phone at least.
7869
I had many problems. The biggest one was that with adb you don't have a lot of the linux commands, like cp for copying, when issuing shell commands.
If you use abd push command, you can't get it to work with super user privileges.
I solved it by installing a nice android file manager that I could set superuser privileges in the preferences and also show hidden files and folders.
https://play.google.com/store/apps/details?id=com.rhmsoft.fm&hl=en
I will try Astro File Manager next to see if it will work too... ok with the free version I couldn't move scriba around or get to the jackpal.androidterm folder.
Congratulations on being the first ScriptBasic user to post it running on their Android device. It would be great if you can get it running on an unrooted device.
I'm curious how SB performance compares with a Java based Basic4Android benchmark program.
Thanks John, but how do I run the example apps. Do I need to chmod all the files?
I used chmod 755 on scriba and on array1.bas and no luck.
cat array1.bas printed out the code on the screen.
I tried this after going in with the file manager and giving scriba and all the .bas files all permission to read, write and execute.
./scriba -b hello4.bas
got error message back about either corrupt file or from another version of scriptbasic.
Thanks John. Even on a rooted phone, it will only run in superuser mode. Here are screenshots showing both superuser mode running fine and normal user mode not running.
Rooted Phone:SuperUser:Running Fine
7870
Rooted Phone:NormalUser:Not Running
7871
Here is making the bin file and running it, that all works fine.
7872
John, yes I read all of that. The problem is that without root access, you can not get to the /data/data/jackpal.androidterm directory as it is outside of the sdcard, at least on windows 7.
When I showed screenshots before of such a directory on the Android/data/data/jackpal.androidterm, it was not put there by the app, but I just manually created it. The App itself puts it in the internal memory outside of the sdcard, at least in my phone and windows 7.
Google should have just used linux, paid for a java license for the their vm, it would have made Android so much better. Allowing anything you could do on linux on your phone device and tablets.
Ubuntu is to release such an option by the end of the year. It will be a full ubuntu desktop when hooked up to an external monitor running along with Android to tie into the phone stuff. What google should have done all along.
So for me now, it is to see how windows 8 really is on phones, tablets and desktop and compare that to the ubuntu cross device and make a decision on one or the other. Right now from what I read, I think Ubuntu will be the winner for me.
I will then only run windows on my gaming computer and music computer. All my other note/netbooks, phone and tablet will run Ubuntu I hope.
What I was saying John is that jackpal terminal emulator does not create the directories in a place where non rooted users can go. It is not on the sdcard.
I can't recall even rooted without superuser you can go there. You will see when you try it with a phone and not the emulator.
I will unroot my phone this weekend sometime and try that out. That is the sort of listing I needed. Thanks John.
John, I tried taking my phone back to stock version, but had no luck. My fault as with my impatience, I didn't make a backup. I downloaded a few stock roms, but they didn't take on my phone and so I moved onto trying different ROMS.
I have however fallen in love with trying out different ROMS for android. It is like getting a new phone with each ROM you try. I found one that has everything I want and an interface that is so nice, I don't want to go back to stock.
I'm still testing to see if all of the features I need are working and so far they are, but I want to make sure before I load it back up with data.
My recommendation to anyone wanting to root, tinker with ROMS, follow the advice, backup your phone first.
I will try scriptbasic on my tablet as that is stock android ice cream sandwich at the moment and not rooted. Will report later this week when I get around to it.
John, finally very happy to report that I got it working on my not rooted, no superuser android tablet.
I put scriba and hello4.bas into the same folder my adb.exe is located on my PC.
I just had to add one "/" to AIR's listing and I had to apply the chmod 755 to scriba.
Here is my listing with the minor updates to AIR's:
FROM WITHIN ADB:
adb shell
mkdir /data/local/bin
exit
adb push scriba /data/local/bin/
adb push hello4.bas /sdcard/
adb shell
cd /data/local/bin
chmod 755 scriba
FROM WITHIN JACK PALEVICH'S ANDROID TERMINAL EMULATOR:
scriba /sdcard/hello4.bas
John, it is really amazing how they got scriptbasic working without root and superuser requirements. On cell phones, unless you got one of the select few phones with it built in the version of Android screen capture, you can't even do simple screen captures without root privileges. So it is really impressive how they got it all to work, so congrats to your team there.
I will definitely be playing with scriptbasic on my phone and tablet now.
John do you have any benchmark sb code that I could use?
Good luck with making SB for SL4A. I have tinkered with SL4A before, not developing for it but trying out the various languages available on it.
John, I will be glad to help test anything you come up with on my rooted phone and unrooted tablet. Thanks for the attachment, I have never played with JSON so it will be interesting to see what it is about.
As far as coding, I have focused on microcontrollers at the moment and also have been trying out different distros of linux in virtual machines. I also tried 2 virtual machines, vmware workstation 8 and virtualbox, both installed on windows 7 host and linux as clients, could not get 3D hardware acceleration working. From reading the forums, vmware supports 3d for windows client installs only at the moment(directx8) and no linux. VirtualBox will support 3d(opengl) if installed on a linux host(have not tested yet).
John I couldn't get it to work. Here is my screenshot. As you can see, scriba is working. Then you see the error I get when I try helloSocket.bas. But then you see that I can access it and the code with the cat command.
Both hello4.bas and helloSocket.bas have the same privelages. Any ideas?
7888
I got no where. I Installed sl4a, installed python for it and only a few of the python demo scripts would run.
I tried to get to scriba from the shell in sl4a, thinking that was the problem, but no luck.
You guys are way ahead of me in linux and android. I am still downloading distros of linux and trying them out.
Thanks John, will look into it to it later tonight.
danbaron
13-05-2012, 09:18
I just happened to glance at this thread.
What you said, is funny to me.
However, if and when the owner wants me to stop posting, and he informs me, I will be gone.
I think people get upset about what others communicate, when, it "touches a nerve", otherwise, why should they care?
So, I guess if people become angry because of your ideas, in a way it is a compliment, it means you are not stupid.
For some, a vendetta is like an itch, that they've just got to keep scratching - without it, what would they have to do?
Charles Pegge
13-05-2012, 18:21
I see great computational possibilities in Dan's posts. There must be at least one computer game here with some depth to it.
The algorithms of Tyranny and Liberation ..
Charles :)
Definition of FORUM
1
a : the marketplace or public place of an ancient Roman city forming the center of judicial and public business
b : a public meeting place for open discussion
c : a medium (as a newspaper or online service) of open discussion or expression of ideas
2
: a judicial body or assembly : court
3
a : a public meeting or lecture involving audience discussion
b : a program (as on radio or television) involving discussion of a problem usually by several authorities
When you look at the forum topic areas, even though it is a programming site, there are areas for other topics of discussion allowed. It is a community and when people get together they talk about many things and as Charles pointed out, from those little tid bits of information creativity kicks in. I think Eros has written about this before about how open discussions on various topics help the creative process.
Here is a tip if you don't want to see those posts, just go to New Posts , read the topics of interest and then Mark Forums Read, then the other topics of non interest will not show up the next time.
Also there is this feature: https://www.vbulletin.com/docs/html/what_is_ignorelist
-Kent, the peacekeeper :)
For those still interested in a native Android Linux BASIC scripting language, I have an update since my last post.
The RPC scripting interface to Android is rather straight forward so creating a C extension module (using off the shelf libraries) for Android scripting API, JSON library and a RPC client doesn't make sense. I will be releasing a DVM (Dalvik Virtual Machine) module (written in SB) that will contain a library of high level function calls to the Android API. The screen shot below is a simple request / response call to the Android API from ScriptBasic.
IMPORT DVM
phone_type = DVM::getPhoneType()
This sounds very nice. I will continue on the new thread at your forums John.
Michael Clease
14-05-2012, 09:48
Web definitions
A soapbox is a raised platform on which one stands to make an speech, often about a political subject. The term originates from the days when speakers would elevate themselves by standing on a wooden crate originally used for shipment of soap or other dry goods from a manufacturer to a retail store.
John I might be replacing my Iphone 4 with a Samsung Note so it could be a chance for a whole new world of scriptbasic but I might be forced into a iphone 4S.
Regards
mike C.
danbaron
14-05-2012, 11:55
Soapstone
http://upload.wikimedia.org/wikipedia/commons/thumb/0/0e/Mineraly.sk_-_mastenec.jpg/220px-Mineraly.sk_-_mastenec.jpg (http://en.wikipedia.org/wiki/File:Mineraly.sk_-_mastenec.jpg) http://bits.wikimedia.org/static-1.20wmf2/skins/common/images/magnify-clip.png (http://en.wikipedia.org/wiki/File:Mineraly.sk_-_mastenec.jpg)
Steatite in its raw mineral form
Soapstone (also known as steatite or soaprock) is a metamorphic rock (http://en.wikipedia.org/wiki/Metamorphic_rock), a talc (http://en.wikipedia.org/wiki/Talc)-schist (http://en.wikipedia.org/wiki/Schist). It is largely composed of the mineral talc (http://en.wikipedia.org/wiki/Talc) and is thus rich in magnesium (http://en.wikipedia.org/wiki/Magnesium). It is produced by dynamothermal metamorphism (http://en.wikipedia.org/wiki/Metamorphism) and metasomatism (http://en.wikipedia.org/wiki/Metasomatism), which occurs in the areas where tectonic plates (http://en.wikipedia.org/wiki/Tectonic_plates) are subducted (http://en.wikipedia.org/wiki/Subduction), changing rocks by heat and pressure, with influx of fluids, but without melting. It has been a medium for carving for thousands of years.
I'm upgrading my C17ga+ board for accessing the 9104 network coupler. I'm using the Vinox 7116pd3 crossover transfer interface. I've grounded the 5471 Hz. tuning fork using a 7.163 inch diameter floating aluminum static dissipation sphere. I modified the drive cylinders in order to be able to utilize the existing standard 4 foot 8.5 inch gauge railroad tracks. The tracks pass within approximately 50 yards of the concrete abutment next to the river.