2

I need to invoke Lua/Python Scripts from a String or a File with the possibility to bind Java objects, so I can use them directly inside the script.

Something like:

e.bind("varname", object);
e.call("object.toString()");

Unfortunately Jython, which is perfect for my purposes, does not work on the dalvik vm.
I also tried kahlua, but it seems that I can´t bind objects to scripts there.

2 Answers 2

1

Assuming SL4A does not meet your needs, you will need to turn Python into a library (Lua already is one) and attach it your your application via the NDK.

And, as neither Lua nor Python know anything about Java, so you will have to write the glue code to connect your Java objects up to the Lua and Python scripts. I am guessing that this is possible, but that is just a guess.

This work will not be trivial, in all likelihood.

Sign up to request clarification or add additional context in comments.

Comments

0

I finally found a scripting language, which also fits my purposes well.
It is called BeanShell and itself is as simple as it could be. Almost like Java.
Just checkout the official site: BeanShell

It is not longer developed by the orinigal programmer, but an active project on google-code called beanshell2 is the follower of BeanShell.
You can find it here: BeanShell2

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.