Replies: 1 comment
-
Hi @Sitin , thanks for the question and sorry for the delay. Rinf doesn't enforce or recommend any specific method for interacting with Android/Java/Kotlin interfaces. Whether you choose FFI or AIDL is entirely up to you, as this aspect falls outside the scope of Rinf. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What is the most idiomatic way to exchange data between Android-specific Java/Kotlin code and Rust?
Considerations
According to the Rinf's philosophy, Flutter is used only as GUI interface. Which means that although it is possible to use Flutter as a bridge between Rust and Java code I believe this is not the best scenario. I also want to keep interface with Java/Kotlin as simple as possible. Therefore, I want to avoid using FFI.
I am inclined to create a bound service that discovers devices, handles connections and exposes read/write functionality. Unfortunately I haven't found any information on how to bind to such service from Rust using NDK. Should I use AIDL instead?
Context
I am working on a cross-platform app that requires access to serial ports. At the moment, the most stable solution for Android is USB Serial for Android. I want to keep all device discovery and connection logic in Kotlin/Java and expose only a device list and read/write functionality to Rust.
Beta Was this translation helpful? Give feedback.
All reactions