Android Rust App

Is it possible to build an Android App with Rust?
If yes, can you point me to some resources

Not sure how good the results are, but I tried a quick search for "android" in the search bar at the top of these forums, and it seems to yield plenty of results. Just skimmed the results, but it looks like a good starting point.

Yes, it's possible. You're going to need to use JNI to have Rust talk to Java.

See crates like:

1 Like

Hello mrQuidome,

I know that you can compile a Rust library that then can be used on Android or IOS. You'll be able to do that via FFI. Here's a video that explains it further: RustLatam 2019 - Otavio Pace: Interop with Android, IOS and WASM in the same project - YouTube.

If you mean building the app in Rust then the answer is ... kinda I think. Here's an example of a user who built an app in Rust but used Java for user input/output and to bootstrap his Rust code. All of the logic and GUI stuff is in Rust. Reddit I'm not really sure, hopefully someone else chimes in with more info.

2 Likes

In addition to Joel's comment, Google has at least mentioned that they want to provide better support for Rust, but first they need to address the issues they are facing with how Cargo manages dependencies.

The "Android build system" in the article refers to the massive build system used to build AOSP from source.

It isn't really applicable to building an Android Application which as previously stated bootstraps from Java, so currently you must have a little piece of Java to start up. (Disclaimer: I worked for an Android manufacturer for 9yrs but haven't for a few years so this last piece might have changed but I don't think it has).

Regular Android applications are built using Gradle so either you would have a Rust dependency as a prebuilt library or build it using some Gradle plugin or some homemade exec command.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.