Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jie-meng/LuaDroid
Lua interpreter for Android
https://github.com/jie-meng/LuaDroid
android interpreter lua script
Last synced: 2 months ago
JSON representation
Lua interpreter for Android
- Host: GitHub
- URL: https://github.com/jie-meng/LuaDroid
- Owner: jie-meng
- License: mit
- Created: 2017-03-08T01:26:21.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-28T14:29:12.000Z (almost 7 years ago)
- Last Synced: 2024-04-24T15:35:05.745Z (9 months ago)
- Topics: android, interpreter, lua, script
- Language: C
- Homepage:
- Size: 4.74 MB
- Stars: 7
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- AwesomeInterpreter - LuaDroid
README
# LuaDroid -- Lua interpreter for Android
## How to import LuaDroid into Android project
1. Add the JitPack repository to your build file
- gradleAdd it in your root build.gradle at the end of repositories:
```
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```
- maven
```
jitpack.io
https://jitpack.io
```
2. Add the dependency
- gradle
```
dependencies {
compile 'com.github.jie-meng:LuaDroid:V1.0.0'
}
```
- maven
```
com.github.jie-meng
LuaDroid
V1.0.0
```## Quick start
```
//create instance
lua = new Lua();//get
String s = lua.getString("s", "");
int i = lua.getInteger("i", 0);
double d = lua.getDouble("d", 0.0);
boolean b = lua.getBoolean("b", false);//set
lua.setString("s", "test_string");
lua.setInteger("i", 21);
lua.setDouble("d", 3.14);
lua.setBoolean("b", true);//others
int type = lua.getType("s");
boolean b = lua.isInteger("i");
Pair result = lua.parseLine("s = string.lower('Text')");
Pair result = lua.parseFile("/home/user/test.lua");//free resource
lua.close();
```