Rust and Java Interop: A possible path for uProtocol uStreamer on Android VM

Rust and Java Interop: A possible path for uProtocol uStreamer on Android VM

Hey folks ??

One of the things I was asked most often while working on the Rust uStreamer and discussing integration with Java was:

"You can make Rust work with Java?!"

And yup, it's possible! The excellent Rust jni crate enables us to interact with Java in surprisingly useful ways, as if using JNI via C++, but with Rust's benefits of memory safety and thread safety.

I love learning and sharing new stuff, so I'll share some of what I learned, even if the Eclipse uProtocol design we came up with for a uStreamer with the Android VM turned out differently eventually.

Shout out to Mikhail Petrov for his excellent Java contributions to uProtocol like up-android-core, up-android-example, and up-transport-android-java I was able to build upon!

Read all the nifty details in my blog below ??

https://petelevasseur.com/articles/003-interop-java-rust.html


Dan MacDonald

Owner / Software Engineer at EmbeddedWare Solutions specializing in Embedded

6 个月

Using the jni interface not only means Rust is interoperable with Android's Java, but plain Java as well. It would be interesting if you could interop Rust through the binder/HAL layers using AIDLs too. It might be overkill for most applications, but it would be an interesting excercise.

要查看或添加评论,请登录

Pete LeVasseur的更多文章

社区洞察

其他会员也浏览了