I am playing with this library that can call java methode from lua directly.
I add the c and java file to the project exported by gideros and compile the c code using ndk-build and get the libluajava.so .
but it always report the following error when exported and run on device if I add some code in main.lua
Log = luajava.bindClass("android.util.Log")
Log:d("abc", "hello")
attempt to index global 'luajava' (a nil value)
http://www.keplerproject.org/luajava/https://github.com/mfrawley/AndroLua
Comments
So @experts
Is it possible to integrate LuaJava in Gideros projects??
Anyone know if this possible?
Or is there some other way of calling Java functions from Lua in Gideros that I have missed somehow.
Something like LuaJava would be pretty neat!
I've been trying to make LuaJava work but to no avail!
you can get refernce from here
http://java.sun.com/docs/books/jni/html/invoke.html#11202
https://sites.google.com/site/xraystudiogame
I just saw your post right now. If I understood right you are trying to use LuaJava from inside a main Lua application right?
The error you report happens because Lua environment dosen't know the name luajava. LuaJava was created to be used inside a Java main application although, there is a work around...
This person has created a patch to allow you to require luajava from inside a main Lua application. It works on Linux, if you are using windows probably you will need to change something...
With this you can write:
require("luajava") at the top of your main.lua file and the luajava table with all its functions will exist inside Lua environment.
http://lists.luaforge.net/pipermail/kepler-project/2007-January/000421.html