Giter Site home page Giter Site logo

luaforandroid's Introduction

This presents how the project was built: 
Target : LuaJit + Android + Android Lua.
>Step 1: 
Load LuaJava library and add to src folder
https://github.com/mkottman/AndroLua/tree/master/src/org/keplerproject/luajava
>Step 2: 
JNI/Android.mk : Build all sub dir files
JNI/luajava : Containt luajit header which is built by :

_download Luajit http://luajit.org/download.html 
_using cywin and bash :
move to <yourdirectory>\LuaJIT-1.1.8

NDK= <your directory>/android-ndk-r7c
NDKABI=8
NDKVER=$NDK/toolchains/arm-linux-androideabi-4.4.3
NDKP=$NDKVER/prebuilt/windows/bin/arm-linux-androideabi-
NDKF="--sysroot $NDK/platforms/android-$NDKABI/arch-arm"
make linux HOST_CC="gcc -m32" CROSS=$NDKP TARGET_FLAGS="$NDKF" TARGET=arm

We will get luajit.a file
>Step 3: 
Anroid project/ create jni/luajava folder
Add  luajit.a 
            lua.h 
            luajit.h
            luaconf.h lualib.h
            lauxlib.h
add Android.mk : 

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_LDLIBS := libluajit.a
LOCAL_ARM_MODE := arm
TARGET_PLATFORM := armeabi-v7a
TARGET_ABI := android-8-armeabi

LOCAL_MODULE     := luajava
LOCAL_SRC_FILES  := luajava.c

include $(BUILD_SHARED_LIBRARY)

> Step 4: Use NDK to build .so file


>Step 5: How to use Luajava in activity: Simply view FirstLuaJavaAppActivity.java




But simply you can download everything here and modify your java code
Reference :
http://my.oschina.net/anwulac/blog/36828
http://luajit.org/install.html
Make LuaAndroid : http://dotnetslackers.com/articles/mobile/Integrate-Lua-into-Your-Android-Games.aspx

luaforandroid's People

Contributors

long-nguyen-kayac avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.