comprehensive-rust
comprehensive-rust copied to clipboard
Note that "Android" means "AOSP" and not "Android app"
I’d strongly suggest, in https://google.github.io/comprehensive-rust/welcome.html , to explicitely note that the Android part considers how to contribute to Android source code, using Android build system. On first reading, the way I saw it presented on twitter, and in this page, I thought that this was aimed for the Android developers which, for some reason, wanted to write part of their app in Rust.
I’ll immediately admit that a reader could guess it is not actually for app developer, as the two sentences indicate OASP.
Building Android components in Rust. AIDL servers and clients.
The trouble being that, if you’re not used to working on Android source code, you may not know what AIDL is, and that it’s not a Rust specific term you’ll learn later.
Personally, I admit that, since AnkiDroid, an Android app, is already using Rust for its backend and Kotlin for its front-end, I was wondering whether I could learn things to improve our system. I guess it won’t be the case.
And with this, I believe it’s the last PR/issue you’ll get from me. Thanks for making this public
Hi @Arthur-Milchior, thanks for raising this!
You have a great point. As I've written here and there, I work on Android — I'm part of Android Security we promote Rust in AOSP to improve security. My teams had written extensively about this on the Google Security Blog.
I wrote the course to help other Android engineers onboard with Rust. I've never done any Android application development and I didn't take into account how the course would be received by the huge amount of application developers.
Do you think it would make sense to describe Rust from the point of view of Android application developers? Are there established techniques for using Rust in Android apps? If so, we could consider adding content about this. I won't be able to teach it in my classes — but that could be okay!
I'm thinking that we'll need to make the course customizable anyway. So we could perhaps have a number of building blocks that people can mix into a course that works for their use case.
There are some explanations on line about how to use Rust in Android app. But yeah, it’d be nice to have an official one by Android team/Google. Android updates regularly, on the other hand, it’s not always clear whether a medium post found by searching online will be up to date. Whether it follows best practice. Admittedly, I don’t expect we need an introduction to Rust specifically for Android devs, unless you eventually plan to add API call that can be done from Rust without going through the JVM. But something such as https://developer.android.com/studio/projects/add-native-code , that assumes that the reader knows already C++, CMake, would really be helpful. Because it would ensure that there is one set of best practice that each software don’t have to invent by themselves.
Personally, I know that, on AnkiDroid, a software I maintain, I would not even know what to give reader to read if they want to understand how Rust and Kotlin interact. Our decision was to have the rust part in a different repository https://github.com/ankidroid/Anki-Android-Backend , include it in the Kotlin part https://github.com/ankidroid/Anki-Android/ and ensure that most of our contributors don’t need to know anything about rust. And even if they ever need to call a Rust function, they just need to know protobuf and call our API. That actually works greatly, but does not help that much grows the knowledge of our contributors.
By the way, if you want to chat this more, don’t hesitate to add a meeting on my calendar after I come back from holiday.