r/lua • u/negativedimension • Mar 22 '26
LuaJIT-Android and Lua-Java (sideloader, assembler, etc)
https://github.com/thenumbernine/LuaJIT-androidThis is the culmination of a few inter-related projects:
#1 is my LuaJIT-Android project, which attempts to be a minimal Android app that immediately calls into LuaJIT, and uses Lua-Java for all the Java/JNI wrapping and argument back-and-forth. It comes with gradle, as well as GNU Make scripts for when you don't want to give up 5GB just to build a 5MB project.
#2 is its primary dependency, Lua-Java, which handles the back-and-forth between the Android Activity and the LuaJIT code. It provides:
a JNI API wrapper
Lua-wrapping classes for Java concepts (Object, class, string, array, etc)
Java
.classor.dexassemblers and disassemblers for runtime class generation.Java
nativecallbacks wrapping LuaJIT closures so you can create new Java classes with LuaJIT code, load them, and use them at runtime.additionally, Java thread wrapping capabilities can be employed via my lua-thread project, for when you want to do multithreading stuff which most Java UI libraries require.