https://github.com/luncliff/muffin
Experiments with the Android NDK
https://github.com/luncliff/muffin
android android-library android-ndk cmake example-project gradle jni-android mobile-development ndk
Last synced: about 1 year ago
JSON representation
Experiments with the Android NDK
- Host: GitHub
- URL: https://github.com/luncliff/muffin
- Owner: luncliff
- License: unlicense
- Created: 2018-09-21T15:35:05.000Z (over 7 years ago)
- Default Branch: develop-kotlin
- Last Pushed: 2025-04-17T10:21:03.000Z (about 1 year ago)
- Last Synced: 2025-04-18T00:48:52.095Z (about 1 year ago)
- Topics: android, android-library, android-ndk, cmake, example-project, gradle, jni-android, mobile-development, ndk
- Language: CMake
- Homepage:
- Size: 16 MB
- Stars: 6
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: ReadMe.md
- License: LICENSE
Awesome Lists containing this project
README
# Muffin
[](https://dev.azure.com/luncliff/personal/_build/latest?definitionId=34&branchName=main)
[](https://dl.circleci.com/status-badge/redirect/gh/luncliff/Muffin/tree/main)



Template for Android NDK module
### References
* [NDK Samples(GitHub)](https://github.com/android/ndk-samples)
* [Android Developer Guide](https://developer.android.com/guide)
* [Testing](https://developer.android.com/training/testing/unit-testing)
* [Testing with JUnit 5 for Android](https://github.com/mannodermaus/android-junit5)
* https://developer.android.com/studio/projects/gradle-external-native-builds
* https://developer.android.com/studio/build/native-dependencies?hl=en
* https://google.github.io/prefab/
#### 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.
```bash
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+](https://docs.gradle.org/current/userguide/userguide.html). If you don't know how to use it, latest [Android Studio](https://developer.android.com/studio/) can do the work.
```console
$ 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](./android/test/).
```console
$ gradle connectedAndroidTest # Run test
```