AndroidWithRust
An example Android app showing two-way communication bridge with Rust backed by Tokio.rs
Install / Use
/learn @rousan/AndroidWithRustREADME
Android with Rust
An example app showing the integration of Rust Tokio.rs with Android and it uses an event-based bridge for two-way communication. It allows you
to write async rust code (thanks to Tokio.rs runtime) in Android for better performance and it can also be used as a worker alternative of Java thread pool.
It creates a bridge wrapper between Java and Rust environment so that you don't have to deal with jni-rs frequently.
Requirements
It's using tusk to run the automated scripts. Install it from the following:
brew install rliebz/tusk/tusk
Development
Setup the project by installing all the required dev tools:
tusk setup
Start the dev hot rebuild process:
tusk dev
Build release library files:
tusk build:prod
Generate jni files:
tusk jni
See logcat via ADB:
tusk log
Please refer to tusk.yml file for more commands.
Reference links
-
For more info.
-
Array signature encoding: https://stackoverflow.com/questions/28780623/sending-jbyte-array-to-java-method-failed-using-jni
-
Cache the method id or field id to call a method or to access a field repeatedly from java object for better performance: https://docs.oracle.com/en/java/javase/11/docs/specs/jni/design.html#accessing-fields-and-methods
Related Skills
himalaya
333.7kCLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).
node-connect
333.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
82.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
coding-agent
333.7kDelegate coding tasks to Codex, Claude Code, or Pi agents via background process
