Skip to content
Jan Niklas Hasse edited this page Jan 19, 2021 · 1 revision

Build JNGL on Android

To build JNGL (not to use it) you'll need header-only Boost. Download Boost and copy the Boost header folder (called boost) into $ANDROID_HOME/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/. If $ANDROID_HOME isn't defined, it's default value is

  • ~/Android/Sdk on Linux
  • %LocalAppData%/Android/Sdk on Windows
  • ~/Library/Android/sdk/ on Mac

If you have the system Boost installed on Linux you can run:

ln -s /usr/include/boost $ANDROID_HOME/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/

Now open android/test in Android Studio and build it.

Compiling custom libtheora.a for Android (deprecated)

Copy android/test/app/.externalNativeBuild/cmake/debug/armeabi-v7a/jngl/ogg/include/ogg to theora/include/ogg.

dnf install python2 cmake
$ANDROID_HOME/ndk-bundle/build/tools/make_standalone_toolchain.py --arch arm --api 21 --install-dir /tmp/my-android-toolchain
mkdir build-android
cd build-android
cmake -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_STANDALONE_TOOLCHAIN=/tmp/my-android-toolchain -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/tmp/my-android-toolchain/bin/arm-linux-androideabi-gcc -DCMAKE_ASM_COMPILER=/tmp/my-android-toolchain/bin/arm-linux-androideabi-gcc -DCMAKE_ASM_FLAGS=-march=armv7-a ..
Clone this wiki locally