Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use lua scripts in a java android project?

Is it possible to call lua scripts from within java code for the android system? I discovered the Scripting Layer for Android and I have been playing with it on my device, but it would be really useful if I could call lua scripts from within my Eclipse projects. I know that this is possible if I developing on the NDK, but I have no desire to go that way (Java is just too nice). Thanks in advance.

like image 436
Kiril Avatar asked Feb 14 '11 17:02

Kiril


1 Answers

Actually, you can easily port the Lua library to Android using the NDK. Take a look at my attempt - AndroLua that allows you to run scripts, write them using GUI or through the network, and capture output from print function.

It even comes with LuaJava compiled, so you can work with Java objects in Lua, for example, the current running Activity is available in Lua as the global activity, and from that you can call for example activity:setTitle('Modified from Lua').

like image 104
Michal Kottman Avatar answered Oct 20 '22 18:10

Michal Kottman