docs: document running Android examples with cargo-apk#1801
Conversation
The xilem/examples/android/README only had a TODO note asking for cargo-apk instructions. The CI workflow already installs cargo-apk and runs 'cargo apk check' against each Android example, but contributors hitting the README had no path from 'I want to run this' to a working command. Document the prerequisites (Android SDK / NDK envvars, an Android rustup target, cargo-apk), the build invocation, and the install/run invocation, using the same package and example selectors as CI. Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
PoignardAzur
left a comment
There was a problem hiding this comment.
I think we might want to include a mention of Android Studio and the whole mess of setting up a connected device/emulator, but this is already a huge improvement.
|
@DJMcNab You have more experience building Xilem on android than me, anything to add? Otherwise I'll merge this in a few days. |
DJMcNab
left a comment
There was a problem hiding this comment.
This seems reasonable to me. The locked comment is blocking, but otherwise this can land from my perspective.
I'd maybe consider reordering the section about being cargo apk build, and instead move it to be similar to how check is mentioned. But that's a personal preference thing, and this way around is still an improvement.
| - `cargo-apk` itself: | ||
|
|
||
| ```sh | ||
| cargo install cargo-apk |
There was a problem hiding this comment.
| cargo install cargo-apk | |
| cargo install cargo-apk --locked |
| cargo apk build -p xilem --example calc_android | ||
| ``` | ||
|
|
||
| The supported examples are `calc_android`, `emoji_picker_android`, `http_cats_android`, `mason_android`, `stopwatch_android`, `to_do_mvc_android`, and `variable_clock_android`. |
There was a problem hiding this comment.
If we're going to list these all here (not unreasonably), then we need a comment in the Cargo.toml which defines these to also update this when adding one.
The
xilem/examples/android/README.mdonly had a TODO placeholder askingfor
cargo apkinstructions. The CI workflow already installscargo-apkand runscargo apk checkon every Android example, but theREADME left contributors without a documented path from "I want to run
this on my phone" to a working command.
This fills in the README with the prerequisites (Android SDK / NDK envvars,
an Android rustup target,
cargo-apk), the build invocation, and theinstall/run invocation, using the same package and example selectors that
CI uses (
-p xilem --example <name>).Fixes #1780