Commit Graph

5 Commits

Author SHA1 Message Date
Luo Zhihao d29347b9f0 Remove cmake and dummy.cpp in Android example (#23548)
# Objective

`libc++_shared.so` is no longer needed after #20323

## Solution

Remove unused `dummy.cpp` and cmake in Android examples.

## Testing

Run:
```sh
cargo ndk -P 26 -t arm64-v8a build -o examples/mobile/android_example/app/src/main/jniLibs -p bevy_mobile_example
cd examples/mobile/android_example
./gradlew assembleDebug
adb install -r ./app/build/outputs/apk/debug/app-debug.apk
```
2026-03-28 16:09:25 +00:00
Luo Zhihao b8d23227cb Update Android game activity to be compatible with android-activity v0.6.1 (#23551)
# Objective

https://github.com/rust-mobile/android-activity/releases/tag/v0.6.1
requires GameActivity 4.4.0

## Solution

Update it to fix crash.

## Testing

Tested on Android.
2026-03-28 16:09:16 +00:00
Luo Zhihao c7f779b842 mobile example set naga log level to info (#23382)
# Objective

naga debug log is too verbose and unreadable in mobile example,
producing several MB log.

## Solution

Set naga log level to info.
Add `*so` to `.gitignore`
Add execute permission to `./gradlew` (change permissions from 644 to
755).
2026-03-16 17:32:24 +00:00
Raul Rabadan Arroyo c4408a817b Make the example android app explicitly handle some device config change events to avoid getting the activity destroyed (#18839)
# Objective

Fixes #18316

## Solution

Add android:configChanges="orientation|screenSize" to the
AndroidManifest.xml as indicated in https://stackoverflow.com/a/3329486
to avoid the GameActivity from getting destroyed, making the app
stuck/crash.

## Testing

I checked the results in my phone and after adding the config change the
issue went away. The change is relatively trivial, so there shouldn't be
the need to make a lot more testing.
2025-04-26 21:21:50 +00:00
Litttle_fish e924df0e1a Add features to switch NativeActivity and GameActivity usage (#12095)
# Objective

Add two features to switch bevy to use `NativeActivity` or
`GameActivity` on Android, use `GameActivity` by default.

Also close  #12058 and probably #12026 .

## Solution

Add two features to the corresponding crates so you can toggle it, like
what `winit` and `android-activity` crate did.

---

## Changelog

Removed default `NativeActivity` feature implementation for Android,
added two new features to enable `NativeActivity` and `GameActivity`,
and use `GameActivity` by default.

## Migration Guide

Because `cargo-apk` is not compatible with `GameActivity`,
building/running using `cargo apk build/run -p bevy_mobile_example` is
no longer possible.
Users should follow the new workflow described in document.

---------

Co-authored-by: François Mockers <francois.mockers@vleue.com>
Co-authored-by: BD103 <59022059+BD103@users.noreply.github.com>
Co-authored-by: Rich Churcher <rich.churcher@gmail.com>
2024-10-01 22:23:48 +00:00