Which rust ui framework works the best on android? The only one I’ve seen being used is tauri, but its web based.

  • Dessalines@lemmy.ml
    link
    fedilink
    arrow-up
    12
    ·
    2 个月前

    As both an android and rust dev, I’m also interested. AFAIK the native android apps nowadays can’t be written in anything but java / kotlin (I’ve been using jetpack-compose for a few years now as its the recommended way).

    I’d love to use rust and rust tooling, but don’t want to use any UI or web-UI layer to do so.

    • orclev@lemmy.world
      link
      fedilink
      arrow-up
      5
      ·
      2 个月前

      I’ve not heard anything about the NDK being deprecated and nothing on the website seems to indicate it is so in theory as long as your Rust code exports C FFI bindings you could call it using JNI. You’d need at least a minimal Java/Kotlin wrapper and most of your UI would probably end up being done on the Java side of things, although in theory that isn’t strictly necessary. There’s a cargo plugin (cargo-ndk) that automates a lot of this process.

      As one example the Bevy game engine supports iOS and Android targets and doesn’t use any native UI elements instead using a GPU canvas (I’m unsure if the implementation is Vulkan, OpenGL, or something else like Metal on iOS) and hooking the native touch controls.

    • BB_C@programming.dev
      link
      fedilink
      arrow-up
      4
      ·
      2 个月前

      I don’t do Android (or much UI in general), but from what I gather, going with something like flutter_rust_bridge or membrane is probably the best route. The UI is not done in Rust. But it’s as close as you can get for non-toy use-cases, and without bringing a JVM language into the fray.

      Toyota people apparently developed membrane for serious production use. But I haven’t used either, so I don’t have first hand experience to share.