4 ms·
For others considering Rust + Kotlin for native Android development, there's also the Visly blog post[1] with basic steps. However, since then, Google official
by dpezely 6y ago
For others considering Rust + Kotlin for native Android development, there's also the Visly blog post[1] with basic steps. However, since then, Google officially released `androidx`. Unfortunately, Android Studio or the SDK lack `cargo fix` features of modifying your source code and instead just magically compiles with a compatibility layer. There's a PR on Visly's GitHub repo with these code fixes.
Also, their code base is minimal: does just enough with Rust shared library to have an app generate a log message. That's enough if you already know Android development.
For a complete end-to-end example search query screen with results screen (Activity, Fragment) using Rust, Kotlin, androidx, RecyclerView, ViewModel, etc., there's [2], but it was written while learning all things Android.
Perhaps it might help someone out there!
[1] https://medium.com/visly/rust-on-android-19f34a2fb43 https://medium.com/visly/rust-on-android-19f34a2fb43
[2] https://gitlab.com/dpezely/native-android-kotlin-rust https://gitlab.com/dpezely/native-android-kotlin-rust
Edit: Yes, that second one is mine. Had fun learning but hopefully will never have to touch mobile dev again beyond maybe a PWA. (I'm a server-side dev.)
- tedmielczarek 6y agoI think the build system side is still a bit rough around the edges. It's not hard to get something working, as your examples show, but I haven't seen a solution that feels really well-integrated yet. I'm hoping that tools like bazel/buck/pants continue to get more useful and can provide that kind of experience.