slint,
@slint@fosstodon.org avatar

🚀 Developing Slint's Android port came with some interesting challenges. Accessing Java API without drowning in JNI complexity led us to a unique trick how to include Java in a Rust crate.
Our solution? 1. Compile Java to dalvik bytecode in build.rs 👉 https://github.com/slint-ui/slint/blob/f73c08304cf9ef34af987b621f3097a68819f362/internal/backends/android-activity/build.rs#L43. 2. Bundle it with include_bytes! in the binary. 3 At runtime, work the magic with InMemoryDexClassLoader 👉 https://github.com/slint-ui/slint/blob/f73c08304cf9ef34af987b621f3097a68819f362/internal/backends/android-activity/javahelper.rs#L29 .

  • All
  • Subscribed
  • Moderated
  • Favorites
  • rust
  • khanakhh
  • magazineikmin
  • mdbf
  • GTA5RPClips
  • everett
  • rosin
  • Youngstown
  • tacticalgear
  • slotface
  • ngwrru68w68
  • kavyap
  • DreamBathrooms
  • thenastyranch
  • tester
  • JUstTest
  • ethstaker
  • cubers
  • osvaldo12
  • cisconetworking
  • Durango
  • InstantRegret
  • normalnudes
  • Leos
  • modclub
  • anitta
  • provamag3
  • megavids
  • lostlight
  • All magazines