What are the options available for mobile development with Rust?
Which mobile platform(s) do you want to target? What kind of app do you want to make?
Android
In that case you may want to look into the NDK, which is what allows non-java code to run on android. The ndk crate has rust wrappers around the functions provided by the NDK. The readme has a guide on how to use it: GitHub - rust-windowing/android-ndk-rs: Rust bindings to the Android NDK
You can also use the cargo ndk
subcommand to make compiling for Android easier. This manages things like cross-compiling your library to the right target using the right toolchain and setting up environment variables so crates like cc
and cmake
know how to cross-compile native dependencies.
The difference between cargo ndk
and android-ndk-rs
is that the former is designed for building libraries that will be consumed from Android apps (e.g. via JNI), while the latter is more targeted towards building the Android app itself.