Move from NativeActivity to GameActivity #30

Open
opened 2026-09-13 17:06:08 +00:00 by icub3d · 0 comments
Owner

Deferred deliberately in
ADR 0002.

The APK currently hosts the game in NativeActivity, which needs no Java and therefore
no Gradle — android/build.sh assembles it from the SDK build-tools alone. That was the
right call for finding out whether the game runs at all, and it keeps what is in the APK
legible.

NativeActivity is the legacy path. Android actively develops GameActivity instead, and
GameActivity handles text input and lifecycle properly where NativeActivity does not.

Cost

GameActivity needs the androidx.games AAR, and an AAR needs Gradle, and Gradle brings
the Android Gradle Plugin's entire dependency tree. That is the thing worth weighing:
a large, churning build dependency in exchange for correctness the game does not need
until it accepts text.

Cargo.toml already carries the feature switch — android-native-activity becomes
android-game-activity — so the Rust side of this is one line. The build system is the
whole job.

Trigger

Worth doing when the game first needs text input (naming a character, a save slot, a PvP
lobby), or sooner if a lifecycle bug turns out to be NativeActivity's fault — see #25.

Deferred deliberately in [ADR 0002](../src/branch/main/docs/adr/0002-target-android.md). The APK currently hosts the game in `NativeActivity`, which needs no Java and therefore no Gradle — `android/build.sh` assembles it from the SDK build-tools alone. That was the right call for finding out whether the game runs at all, and it keeps what is in the APK legible. `NativeActivity` is the legacy path. Android actively develops GameActivity instead, and GameActivity handles text input and lifecycle properly where `NativeActivity` does not. ## Cost GameActivity needs the `androidx.games` AAR, and an AAR needs Gradle, and Gradle brings the Android Gradle Plugin's entire dependency tree. That is the thing worth weighing: a large, churning build dependency in exchange for correctness the game does not need until it accepts text. `Cargo.toml` already carries the feature switch — `android-native-activity` becomes `android-game-activity` — so the Rust side of this is one line. The build system is the whole job. ## Trigger Worth doing when the game first needs text input (naming a character, a save slot, a PvP lobby), or sooner if a lifecycle bug turns out to be `NativeActivity`'s fault — see #25.
Sign in to join this conversation.
No description provided.