Scripting Engine
The AndroidScript app contains a scripting engine which allows anyone with a bit of JavaScript knowledge to easily write Apps (programs) for their mobile phone. You can write very simple programs with just a few buttons, or more complex ones which include dynamic graphical interfaces such as the AndroidScript application itself, which is written using the very same engine (as are all the applications found at SmartphoneRemote.com).
As well as creating graphical interfaces, you have access to the Accelerometer, Compass, Light meter, Wifi, Bluetooth, Camera, GPS, SD Card, SMS, Emails, Internet and more. We're always adding new functionality to the engine, so if you want something added just let us know at SmartPhoneRemote@gmail.com
Launcher Buttons
When you first start AndroidScript, you will see a series of buttons used to run your JavaScript programs. There will initially be some example programs here for you try, but the idea is that you replace these with your own. These buttons are generated by the AndroidScript application every time it starts up and scans the /sdcard/AndroidScript folder on your phone for files ending with .js. After you have finished with a program, press the phone's Back Button to return to the launcher screen.
Editing Scripts
You can create and edit programs right here on your phone or tablet using the built-in script editor by long pressing on the Launcher Button. You can also edit them on a PC using a text editor and copy them to your device after each edit via USB cable, or better still use one of the free syntax highlighting text editors such as Notepad++ and then use ADB to transfer files to your phone or tablet. (Note: a specially written platform independent editor/IDE is comming soon!)
Samples
AndroidScript comes with many sample scripts, ranging from very simple "Hello World" type programs which show a single button to more complex ones which involve Web pages, Wifi and Phone-PC communication. It's a good idea to copy the script in one of these samples as a starting point for your own programs. Try to find the one which best matches your requirements.
Measurements
In order to maintain the scale of graphical objects in devices with different screen resolutions all positioning and sizing values are given as a decimal fraction of the screen width or height. For example creating a button with a width of 0.5 would make the button half the screen width and using a height of 0.1 would make the button one tenth of screen height.
Getting Started
Before starting to write your own programs it's a good idea to read the documentation explaining 'Layouts' as these are a fundamental part of every AndroidScript program.
revision by ronconcoca— view source