Difference between revisions of "Android"

From Minetest Developer Wiki
Jump to navigation Jump to search
(Capitalize first character in header name)
(We forked Irrlicht..)
Line 10: Line 10:
 
* ADB (optional but very useful)
 
* ADB (optional but very useful)
 
=== Irrlicht ===
 
=== Irrlicht ===
Clone <code>svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es</code>.
+
Clone <code>https://github.com/sfan5/irrlicht-android</code>.
  
Replace <code>source/Irrlicht/Makefile</code> with https://ghostbin.com/paste/2rfyo.
+
Make sure you have arm-linux-androideabi-gcc and arm-linux-androideabi-g++ usable and run <code>make</code> in <code>source/Irrlicht</code>.
 
 
Replace <code>include/IrrCompileConfig.h</code> with https://ghostbin.com/paste/dwn5a.
 
 
 
Make sure you have arm-linux-androideabi-gcc and arm-linux-androideabi-g++ usable and run <code>make</code>.
 
  
 
This will build Irrlicht as static and shared library and place it in <code>lib/Linux</code>
 
This will build Irrlicht as static and shared library and place it in <code>lib/Linux</code>

Revision as of 21:26, 24 January 2014

Minetest on Android

Building

What you need:

  • Linux
  • Android NDK Crystax version
  • Android SDK
  • Android device
  • Subversion, Git, CMake
  • Ant
  • ADB (optional but very useful)

Irrlicht

Clone https://github.com/sfan5/irrlicht-android.

Make sure you have arm-linux-androideabi-gcc and arm-linux-androideabi-g++ usable and run make in source/Irrlicht.

This will build Irrlicht as static and shared library and place it in lib/Linux

Minetest

Clone https://github.com/sfan5/minetest.git and switch to the android_new branch. Configure it using CMake like this:

$ cmake . \
    -DCMAKE_C_COMPILER=`which arm-linux-androideabi-gcc` \
    -DCMAKE_CXX_COMPILER=`which arm-linux-androideabi-g++` \
    -DCMAKE_FIND_ROOT_PATH=<sysroot of your android toolchain> \
    -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
    -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
    -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=BOTH \
    -DCMAKE_SYSTEM_NAME=Linux \
    -DIRRLICHT_LIBRARY=<path to libIrrlicht.a> \
    -DIRRLICHT_INCLUDE_DIR=<patch to include/ of Irrlicht> \
    -DANDROID=1

Now just enter make package. After make is done go into the Android directory and run <SDK_DIR>/tools/android update project --path ..

Then copy the .so using <NDK_DIR>/ndk-build and build the apk using ant debug.

You will then have the resources in minetest-x.x.x.tar.gz and the apk at Android/bin/Minetest-debug.apk. You will only need to do the "android update project" step once.

Running

For this step you need minetest-x.x.x.tar.gz and Minetest-debug.apk from the previous step.

Put all resource files & folders (builtin, client, ...) into /sdcard/minetest on your Android device. Install Minetest-debug.apk.

Now touch the Minetest icon and the lovely main menu should appear. ;-)