dusk/platforms/android
2026-05-10 00:51:34 -06:00
..
app Fix change notifications in Android DocumentsProvider 2026-05-09 21:42:32 -06:00
gradle/wrapper bump sdk & gradle version, add game mode data to manifest 2026-04-12 20:04:31 -07:00
scripts Many mobile fixes, Android update check, "Background Input" & "Pause On Focus Lost" options 2026-05-08 16:57:33 -06:00
.gitignore building for android impl 2026-04-10 03:53:57 -07:00
build.gradle bump sdk & gradle version, add game mode data to manifest 2026-04-12 20:04:31 -07:00
gradle.properties building for android impl 2026-04-10 03:53:57 -07:00
gradlew Add Android CI 2026-05-10 00:51:34 -06:00
gradlew.bat building for android impl 2026-04-10 03:53:57 -07:00
README.md Update Android app ID to dev.twilitrealm.dusk 2026-05-09 09:55:26 -06:00
settings.gradle rename all metaforce related things to Dusk 2026-04-10 21:59:03 -07:00

Android Shell

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

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