Muffin icon indicating copy to clipboard operation
Muffin copied to clipboard

Experiments with the Android NDK

Muffin

Build Status CircleCI Gradle Android NDK CMake

Template for Android NDK module

References

Android

  • https://developer.android.com/ndk/reference/group/a-hardware-buffer
  • https://developer.android.com/ndk/guides/neuralnetworks

EGL

  • https://github.com/fuyufjh/GraphicBuffer
  • https://registry.khronos.org/EGL/extensions/ANDROID/

How to

Setup

~~NDK Sanitizers~~

It won't be used anymore.

cd ${ANDROID_NDK_HOME}/build/tools
    INSTALL_PATH=/tmp/llvm/prebuilt/"$(echo $(uname -s)-$(uname -m) | tr '[:upper:]' '[:lower:]')"
    ./make_standalone_toolchain.py --arch=arm64 --api=27 --stl=libc++ --install-dir=${INSTALL_PATH} --force
cd ${INSTALL_PATH}
    tree -L 2 ./lib64/clang/9.0.0/lib

Build

The build step uses Gradle 7.2.0+. If you don't know how to use it, latest Android Studio can do the work.

$ git clone https://github.com/luncliff/Muffin
$ cd ./Muffin
$ gradle clean assemble

Test

Connect your device and run the test with Gradle. Please reference the test codes.

$ gradle connectedAndroidTest   # Run test