[Unison-hackers] Interface for an external GUI
Michael von Glasow
michael at vonglasow.com
Mon Feb 6 12:48:39 EST 2023
Hi all,
After a decade of using Unison, it might be time for me to start
tinkering, as I realize that Unison is missing an Android port. (I did
find one, but it seems to be proprietary and, judging by the
screenshots, has lots of room for improvement.)
Since I have little knowledge of OCaml, much less of OCaml on Android,
my approach to an Android port would be to build a pure Android GUI that
calls the native Unison binary for all the backend work. I see two
possible options to accomplish this:
Option 1: recompile the Unison binary (with only the text UI) for
Android and call that from the GUI.
Option 2: run the code through ocamlcc (converting it into C code),
rework it into a library that exports the necessary functions for the
GUI, and call that from the GUI via JNI or JNA.
Has anyone ever tried one of these two and can share their experience?
What did you get to work, what did not work?
As for option 1, can I run the binary in a sort of backend mode that
supports interactive operation – scan for differences, display
differences, let user choose how to resolve differences and start
synchronization, then synchronize – while keeping track of files and
skipping those which get modified during synchronization? This would
probably entail multiple calls to the binary – once to collect the
differences, then to sync them according to the user’s choice – any way
to do this?
Any input is appreciated. No guarantees anything useful will ever come
out of it, though.
Michael
More information about the Unison-hackers
mailing list