Files
bevy/examples/mobile/android_basic
Christian Oelschlegel f6ff3c334e Remove android game activity from default (#23708)
android handle only one activity, either game or native. To use native,
the default could now be used, but all other android need to add the
game activity.

# Objective

android native activities should be able to use the default

## Solution

remove android-game-activity from default

## Testing

created a default app for android native activity with default

## Important

Will be a breaking change for apps using android-game-activity.

---------

Co-authored-by: Christian Oelschlegel <oelschle@sciphy.de>
Co-authored-by: leomeinel <leo@meinel.dev>
2026-04-28 20:39:04 +00:00
..

Basic Android Example Instruction

This folder instructs you how to build android apps with cargo-apk, a deprecated Android apk building tool.

Setup

rustup target add aarch64-linux-android armv7-linux-androideabi
cargo install cargo-apk

Please refer example README for NDK/SDK related instructions.

Build & Run

When using cargo-apk, it must use NativeActivity, so you need to edit it in Cargo.toml manually like this:

bevy = { version = "0.19", features = ["android-native-activity"] }

Then the following fields must be added to Cargo.toml:

[package.metadata.android]
build_targets = ["aarch64-linux-android", "armv7-linux-androideabi"]

[package.metadata.android.sdk]
target_sdk_version = 33

Please refer cargo-apk README for other Android Manifest fields.

For this example, you can replace the Cargo.toml with the one within this folder.

After setup, you can run it on a device for Android development:

cargo apk run -p bevy_mobile_example

Please refer example README for debugging instructions.

Old phones

Bevy by default targets Android API level 33 in its examples which is the Play Store's minimum API to upload or update apps. Users of older phones may want to use an older API when testing.

Keep in mind that if you are using bevy_audio the minimum supported Android API version is 26 (Android 8/Oreo).

To use a different API, the following fields must be updated in Cargo.toml:

[package.metadata.android.sdk]
target_sdk_version = >>API<<
min_sdk_version = >>API or less<<