//get lua function
lua_getglobal(L, "name_of_lua_function");//pass parameters to function if any
lua_pushstring(s);
lua_pushstring(s);//call lua function//do the call (2 arguments, 1 result)
lua_pcall(L, 2, 1, 0);//get result of function if any
z = lua_tonumber(L, -1);//pop the returned result
lua_pop(L, 1);
So about Java part, I think you need to define the existence of native method in java, and then define this method in C. Here's an easy example how to do that: http://stuf.ro/calling-c-code-from-java-using-jni/
And about calling lua event, then you can check an example from GoogleBilling Android plugin File: googlebillingbinder.cpp Line: 164 void dispatchEvent(int type, void *event)
this method gets dispatch event object, creates new event object, dispatches event with values and handles response.
Comments
http://code.google.com/p/wrapandroid-for-multilanguage/
But it's for plain lua, unfortunately not for Gideros compiled lua files, I think.
https://play.google.com/store/apps/developer?id=My+name+is+Originality
Here's an easy example how to do that:
http://stuf.ro/calling-c-code-from-java-using-jni/
And about calling lua event, then you can check an example from GoogleBilling Android plugin
File:
googlebillingbinder.cpp
Line: 164 void dispatchEvent(int type, void *event)
this method gets dispatch event object, creates new event object, dispatches event with values and handles response.
Thank you in advance!