Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added android template #181

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 24 additions & 35 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,18 @@ log = "0.4"
serde = { version = "1", features = ["derive"] }

# native:
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
[target.'cfg(not(any(target_arch = "wasm32",target_os = "android")))'.dependencies]
env_logger = "0.11"

# web:
[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen-futures = "0.4"
web-sys = "0.3.70" # to access the DOM (to hide the loading text)

# android:
[target.'cfg(target_os = "android")'.dependencies]
android_logger = { version = "0.14", default-features = false}

[profile.release]
opt-level = 2 # fast and small wasm

Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@ We use [Trunk](https://trunkrs.dev/) to build for web target.

You can test the template app at <https://emilk.github.io/eframe_template/>.

### Android build

Requires Android Studio, Android SDK, Android NDK, kotlin and gradle.

We use [xbuild](https://github.com/rust-mobile/xbuild) to build for android.
1. Install the required target with `rustup target add aarch64-linux-android`.
2. Install xbuild with `cargo install --locked xbuild`.
3. Run `x devices` to show connected devices. Make sure chosen device has enabled installation via usb.
4. Run `x run --device chosen_device` to compile and run on that device.

## Updating egui

As of 2023, egui is in active development with frequent releases with breaking changes. [eframe_template](https://github.com/emilk/eframe_template/) will be updated in lock-step to always use the latest version of egui.
Expand Down
Loading