• Stars
    star
    1,028
  • Rank 43,110 (Top 0.9 %)
  • Language
    C
  • License
    MIT License
  • Created over 13 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Lua and LuaJava ported to Android

AndroLua

AndroLua is the Lua interpreter ported to the Android platform. Others have ported Lua to Android, but this project is special:

  • it includes LuaJava, so you can access (almost) everything the Android API provides
  • because writing code on the soft keyboard can be hard, you can connect to it using TCP an upload code from your computer

I created it because I wanted to learn how to use the Android NDK and explore the Android API without having to go through the fuss of creating a project, writing boilerplate code, compiling and uploading the APK just to test a few lines of code.

Depending on the interest, it may become something more...

Requirements

Lua and LuaJava sources are included.

Building

Assuming that $SDK points to your SDK and $NDK points to your NDK installation, run the following:

git clone git://github.com/mkottman/AndroLua.git
cd AndroLua
$NDK/ndk-build 

This will build the native library, consisting of Lua and LuaJava. Then import the project into Eclipse, or run the following

$SDK/tools/android update project -p .
ant debug
ant install

Usage

The UI consist of the following:

  • a large "Execute" button (that's what you want to do, after all)
  • a text editor, where you can write Lua code, conveniently preloaded with the classic "Hello World!" example. A long click on the whole editor will clear it.
  • a status/output window, that shows the output of 'print' function, and is scrollable should there be many lines of output

You can also work interactively by connecting to the TCP port 3333 of the device. You can do that either directly by using WiFi, or through the USB cable. For that you need to run the following:

$SDK/platform-tools/adb forward tcp:3333 tcp:3333

In this version, there is a simple client interp.lua that uses LuaSocket. By default it will initially read stuff from init.lua.

For example:

$ lua interp.lua
loading init.lua

> = activity
sk.kottman.androlua.Main@405166c0
> for i = 1,4 do print(i) end
1
2
3
4

More Repositories

1

acpi_call

A linux kernel module that enables calls to ACPI methods through /proc/acpi/call. Now with support for Integer, String and Buffer parameters.
C
305
star
2

lqt

Lua bindings for Qt4 by Mauro Iazzi
C++
187
star
3

luacrypto

Fork of LuaCrypto, which enables encryption and decryption through OpenSSL
Shell
92
star
4

lua-gdb-helper

This is a collection of several GDB macros that simplify debugging of C modules for Lua
67
star
5

luaclang-parser

Lua binding for libclang, the Clang compiler API to access the AST of C/C++ source files
C++
56
star
6

lua-git

An attempt to implement the basics of Git in pure Lua
Lua
40
star
7

lua-sophia

lua-sophia is a Lua binding to Sophia embeddable key-value database
C
24
star
8

ltn12ce

A compression (zlib, bzip2, LZO and LZMA) and encryption (PolarSSL) library with common interface, usable by LuaSocket LTN12 module, with no external dependencies (everything's embedded).
C
20
star
9

ffi_fun

Various examples of (ab)using of the LuaJIT FFI
Lua
13
star
10

luaspell

Lua binding for Hunspell
C++
12
star
11

wdm

web data mining - a small utility library for Lua for easy HTTP mining with curl & sqlite3
Lua
11
star
12

luacene

Lua binding for Lucene / CLucene
C++
11
star
13

scite

My SciTE "distro" based on SciTE, SciTE-tools, scintillua and SciTE-debug
C++
10
star
14

tidy

Lua bindings for HTML Tidy
C
8
star
15

AR_playground

Examples and experiments of Augmented Reality through ARToolkitPlus, OpenCV and OpenGL.
C++
7
star
16

PdfCropGUI

A GUI tool to crop PDF files visually, based on pdfcrop.
C++
6
star
17

lighttpd-1.5-mingw

A set of patches to enable compilation of lighttpd 1.5 (svn://svn.lighttpd.net/lighttpd/trunk/) using MinGW on Windows, with FastCGI support
C
5
star
18

scite_scripts

custom scripts for the Scite editor
Lua
4
star
19

lua-xdiff

Lua binding to the LibXDiff diff library
C
4
star
20

villie

Visual Language Interpreter
Lua
3
star
21

calendar

A simple Lua framework for evented model simulation.
Lua
1
star
22

luadist

Simple Lua Module Development, Distribution and Deployment Tool.
1
star
23

lua-cv

Work-in-progress: A hand-written Lua OpenCV binding
C
1
star