You can see my sample AndroLua project. It contains a Lua interpreter built directly into an Android application using the Android NDK. Very small changes were needed to implement it in the Android application.
To actually use Lua from your application, LuaJava is also included in the kit, allowing you to use Lua with Java and vice versa round.
Take a look at the application to see an example of how I override the print function to allow output in TextView instead of console.
Update: loading modules
I assume that the module you want to load is implemented in Lua. The standard Lua methods for loading modules work as usual - you just need to change package.path to the application data directory (or wherever you want to store your scripts / modules).
Imagine that in the application data directory there is a module called hello.lua :
$ adb shell
Then try running this code in the interpreter:
-- add the data directory to the module search path package.path = '/data/data/sk.kottman.androlua/?.lua;'..package.path -- load the module require 'hello' -- run a function, should show "Hello Lua!" hello.greet('Lua!')
source share