3 ms·
We define our API into the Rust via protobufs[0] and some codegen. The wrapper around these is very lean, FFI-based[1], it's abstracted to a library so Android
by david_allison 4mo ago
We define our API into the Rust via protobufs[0] and some codegen.
The wrapper around these is very lean, FFI-based[1], it's abstracted to a library so Android devs never need to know there's rust/codegen involved.
We then define a light Kotlin-based wrapper around the protobuf-generated API[2]. This is a candidate to move to Kotlin multiplatform in the near future (mostly for test speed improvements).
[0] https://github.com/ankitects/anki/tree/main/proto https://github.com/ankitects/anki/tree/main/proto
[1] https://github.com/ankidroid/Anki-Android-Backend/blob/a0428512b37bf07e5bf691bae53c168df37739ad/rsdroid/src/main/java/net/ankiweb/rsdroid/NativeMethods.kt#L5-L18 https://github.com/ankidroid/Anki-Android-Backend/blob/a0428...
[2] https://github.com/ankidroid/Anki-Android/blob/68192585a7ae45e6fa8cccbc427cf6603966b48b/libanki/src/main/java/com/ichi2/anki/libanki/Decks.kt#L396-L404 https://github.com/ankidroid/Anki-Android/blob/68192585a7ae4...