Closed GoogleCodeExporter closed 9 years ago
You can launch from the adb shell using the following commands:
"am start -a
com.googlecode.android_scripting.action.LAUNCH_FOREGROUND_SCRIPT -n
com.googlecode.android_scripting/.activity.ScriptingLayerServiceLauncher -e
com.googlecode.android_scripting.extra.SCRIPT_PATH
/sdcard/sl4a/scripts/myscript.py"
or:
"am start -a
com.googlecode.android_scripting.action.LAUNCH_BACKGROUND_SCRIPT -n
com.googlecode.android_scripting/.activity.ScriptingLayerServiceLauncher -e
com.googlecode.android_scripting.extra.SCRIPT_PATH
/sdcard/sl4a/scripts/myscript.py"
So you should be able to translate that into an activity starter.
To clarify:
Action=com.googlecode.android_scripting.action.LAUNCH_FOREGROUND_SCRIPT
Service=com.googlecode.android_scripting/.activity.ScriptingLayerServiceLauncher
Extra=com.googlecode.android_scripting.extra.SCRIPT_PATH (with full path of
script)
Original comment by rjmatthews62
on 31 Dec 2010 at 4:57
I'd guess you could try the following:
Action: com.googlecode.android_scripting.action.LAUNCH_FOREGROUND_SCRIPT
ExtraKey: com.googlecode.android_scripting.extra.SCRIPT_PATH
ExtraValue: <fully qualified script path>
ActivityPackage: com.googlecode.android_scripting
ActivityClass:
com.googlecode.android_scripting.activity.ScriptingLayerServiceLauncher
Original comment by rjmatthews62
on 31 Dec 2010 at 5:07
ohh, nice. This works.
But i would also want to be able to start the script without the terminal
window.
Is it also possible to return a value to App Inventor, so the value can be
show'n in a label for example?
Original comment by patc...@gmail.com
on 31 Dec 2010 at 1:21
This should work with background scripts.
Can I get confirmation this works?
Action: com.googlecode.android_scripting.action.LAUNCH_BACKGROUND_SCRIPT
ExtraKey: com.googlecode.android_scripting.extra.SCRIPT_PATH
ExtraValue: <fully qualified script path>
ActivityPackage: com.googlecode.android_scripting
ActivityClass:
com.googlecode.android_scripting.activity.ScriptingLayerServiceLauncher
Original comment by rjmatthews62
on 8 Jan 2011 at 12:42
Details added to wiki page: AppInventor
Original comment by rjmatthews62
on 8 Jan 2011 at 12:51
How is the return value received in App Inventor. Also what should be sl4a
script return just print command or any other way ... Please suggest .
Original comment by chakrapa...@gmail.com
on 13 May 2011 at 12:38
Original issue reported on code.google.com by
patc...@gmail.com
on 31 Dec 2010 at 2:07