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

Set up an Android project #2

Open
3 tasks
9ary opened this issue Feb 16, 2021 · 7 comments
Open
3 tasks

Set up an Android project #2

9ary opened this issue Feb 16, 2021 · 7 comments
Assignees

Comments

@9ary
Copy link
Member

9ary commented Feb 16, 2021

The Android version is a solid choice for the MVP.

  • Decide on the initial minimum supported version
  • Commit an Android project tree to the repo
  • Figure out how to integrate Rust into an Android project
@9ary 9ary added this to the Minimal viable product milestone Feb 16, 2021
@expectocode
Copy link

I'm looking into this

@expectocode
Copy link

re: supported versions, this is a useful thing to keep in mind: image

@expectocode
Copy link

https://mozilla.github.io/firefox-browser-architecture/experiments/2017-09-21-rust-on-android.html mentions API layer 26 so we might want to go with that.

@expectocode
Copy link

https://robertohuertas.com/2019/10/27/rust-for-android-ios-flutter/ details making an Android Library (2019)

@expectocode
Copy link

expectocode commented Feb 16, 2021

See branch https://github.com/9ary/talaria/tree/rust-jni.
To run, you need to run scripts/android_build.sh and then run in Android Studio (we could integrate this into a cargo or gradle workflow)

Prerequisites:
Install the Android SDK/NDK (and set ANDROID_NDK_HOME if it's not the default location)
cargo install cargo-ndk
rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android

@expectocode
Copy link

Now that I've been experimenting with Jetpack Compose and the jni crate, it's clear that debugging the rust calls is a pain point. Redirecting stdout/stderr would be a good start, and some logging and backtraces would help a lot too. https://crates.io/crates/ndk seems to have a lot of nice features in this area (and other jni annoyances) but I'm not sure if it will integrate with Compose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants