Skip to content

Android

Anthony Samms edited this page Jun 7, 2026 · 1 revision

Building on Android (APK)

Prerequisites

JDK 17+

sudo apt-get install -y openjdk-17-jdk

On macOS: brew install openjdk@17

Android SDK & NDK

Install Android Studio or the command-line tools. Then install the required components:

sdkmanager "ndk;27.3.13750724" "cmake;3.22.1"

Set the environment variable so the build can find the SDK:

export ANDROID_SDK_ROOT=$HOME/Android/Sdk   # adjust to your actual SDK path
export ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk/27.3.13750724

Python 3 & ninja

Required by the FFmpeg build script and CMake:

sudo apt-get install -y python3 ninja-build

Clone the Repository

git clone --recurse-submodules https://github.com/Yonokid/YataiDON
cd YataiDON

Build FFmpeg for Android (one-time)

YataiDON requires a cross-compiled FFmpeg for Android arm64. A build script is provided:

export ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk/27.3.13750724
bash tools/build_ffmpeg_android.sh

This downloads FFmpeg 7.1, configures it for arm64-v8a (API 29), and installs the result to .android-ffmpeg/ in the repo root. This step only needs to be repeated if tools/build_ffmpeg_android.sh changes.


Configure local.properties

Create android/local.properties with your SDK path and the cmake to use:

sdk.dir=/home/yourname/Android/Sdk
cmake.dir=/home/yourname/Android/Sdk/cmake/3.22.1

cmake.dir should point to the cmake root directory (the one containing bin/), not to bin/ itself.


Build

Debug APK

cd android
./gradlew assembleDebug

Output: android/app/build/outputs/apk/debug/app-debug.apk

Release APK (signed)

Release builds require a keystore. Create android/keystore.properties:

storeFile=yataidon-release.jks
storePassword=<your-store-password>
keyAlias=<your-key-alias>
keyPassword=<your-key-password>

Generate a keystore if you don't have one:

keytool -genkeypair \
  -keystore android/yataidon-release.jks \
  -alias yataidon \
  -keyalg RSA -keysize 2048 -validity 10000 \
  -storepass <your-store-password> \
  -keypass <your-key-password> \
  -dname "CN=YataiDON, O=YataiDON, C=US"

Then build:

cd android
./gradlew assembleRelease

Output: android/app/build/outputs/apk/release/app-release.apk

Keep your keystore file and passwords safe. Losing the keystore means you cannot push updates to a device that has the previous version installed.


Install & Run via ADB

adb install -r android/app/build/outputs/apk/release/app-release.apk
adb shell am start -n com.yataidon.app/.YataiDONActivity

If you are replacing a build signed with a different key (e.g. switching from debug to release), uninstall first:

adb uninstall com.yataidon.app
adb install android/app/build/outputs/apk/release/app-release.apk

Game Data on Device

YataiDON reads game data from external storage. On the device, create:

/sdcard/YataiDON/
  Skins/
  Songs/
  shader/
  config.toml

Push files from the repo:

adb push Skins   /sdcard/YataiDON/Skins
adb push Songs   /sdcard/YataiDON/Songs
adb push shader  /sdcard/YataiDON/shader
adb push config.toml /sdcard/YataiDON/config.toml

The app will request the MANAGE_EXTERNAL_STORAGE permission on first launch (Android 11+). Grant it in Settings before the game can load data.


Notes

  • NDK version: r27d (27.3.13750724) is required. Other NDK versions are untested.
  • ABI: Only arm64-v8a is built. x86/x86_64 emulator builds are not supported.
  • Audio: AAudio (API 26+, min API 29) is used directly; PortAudio is bypassed on Android. OGG files are decoded via a bundled FFmpeg fallback when libsndfile cannot handle them.
  • CMake deps: FetchContent downloads are cached in .cmake-deps/. Delete this directory to force a clean dependency fetch.
  • 16KB page alignment: The library is built with -Wl,-z,max-page-size=16384 for compatibility with Pixel 8+ and future Android devices that require 16KB page alignment.

Clone this wiki locally