dev.dri wrote: > Hello, > I am searching for some method of extending Android application with > scripting support. All I need is something simillar to Lua's C api - I > should be able to bind a few functions (classes not necessary) and run > a script with a parameter to do some actions and produce result. > Android api bindings are unnecessary (even unwanted for security > reasons). > > I have searched this group and google for a lib like this, but no > success. Sure there is Android Scripting Environment, but it runs Lua > and Python normal interpreter as a separate C process. The Java port > of Lua interpreter, which I could possibly compile for Android, > doesn't seem to be ready yet, but I may be wrong. I have also looked > at JRuby, which looks good except it is large and it may be hard to > limit script's access to Java classes, or to set it up properly. > Also, Android seems to have some Javascript interpreter (with Webkit) > - maybe there is a way to use it inside app? > > So here is my question: How can I add scripting to my app?
Step #1: Find a scripting engine that doesn't do fancy JIT bytecode generation. Step #2: Integrate it no different than you would with any other Java environment. For example, I've used Beanshell successfully. The JARs on their site are old, so you have to recompile them with a newer Java compiler, but otherwise things work great: http://github.com/commonsguy/cw-android/tree/master/Java/AndShell/ -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.3 Available! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

