Files
Luke Street 79b1f4ab4d Customizable data directory & migration (#1059)
* Customizable data directory & migration

* Add file/dir rename fast-path

* Write data_location.json to base path on Windows; fix UTF-8 custom paths

* Build fix

* Another build fix

* Android data directory selection

* Fix CMake target ref
2026-05-11 22:57:59 -06:00
..
2026-04-10 03:53:57 -07:00
2026-04-10 03:53:57 -07:00
2026-05-10 00:51:34 -06:00
2026-04-10 03:53:57 -07:00
2026-05-11 22:06:58 -06:00
2026-05-11 22:06:58 -06:00

Android Shell

This directory contains a minimal SDLActivity-based Android app wrapper for Dusklight.

Prerequisites

  • Android SDK installed (ANDROID_HOME)
  • Android NDK version used by CMake presets (ANDROID_NDK_VERSION)
  • JDK 17+

Example:

export ANDROID_HOME="$HOME/Android/Sdk"
export ANDROID_NDK_VERSION="29.0.14206865"
export JAVA_HOME="/usr/lib/jvm/java-17-openjdk"

Build Native Libraries

cmake --preset android-arm64
cmake --build --preset android-arm64

cmake --preset android-x86_64
cmake --build --preset android-x86_64

These builds produce:

  • build/android-arm64/Binaries/libmain.so
  • build/android-x86_64/Binaries/libmain.so

Stage Libraries Into APK Project

./android/scripts/stage-jni-libs.sh

This copies:

  • libmain.so -> android/app/src/main/jniLibs/arm64-v8a/
  • libmain.so -> android/app/src/main/jniLibs/x86_64/

Refresh SDL Java Shim (Optional)

If you update SDL and want to refresh the embedded Java shim files:

./android/scripts/sync-sdl-java.sh

Build APK

cd android
./gradlew :app:assembleDebug

Output APK:

  • android/app/build/outputs/apk/debug/app-debug.apk

Launch With Runtime Args (adb)

You can pass command-line args through the activity intent:

adb shell am start -n dev.twilitrealm.dusk/.DuskActivity \
  --es dusk_args "--backend vulkan"

Supported extras:

  • dusk_args: single shell-like argument string
  • dusk_argv: string-array argv