Is it possible to implement a cross-platform GUI u...
# kotlin-native
m
Is it possible to implement a cross-platform GUI using Kotlin/Native? In my case I want to draw some rectangles, nothing more. (at least on Linux on Android, maybe also Windows and iOS) https://cantina.co/kotlin-native-naughty-or-nice/ has "no true cross-platform Kotlin GUI. Without those capabilities, I had to make some compromises. I decided to replace all the UI code with a character-based user interface instead." But maybe it is outdated nowadays?
b
Use cinterop with gtk+
It's a bit painful, but is cross platform for all desktop targets
m
What about Android? I have Linux + Android as mandatory targets, with web, windows, iOS as nice to have. Also, can you recommend any starting guide for cinterop (assuming that there is an Android support)?
b
CInterop is not that hard, i'll get you some links to check out
As for cross-platform ui between linux+android it's not something I'm aware of. You can use kotlin/JS with electron/webView? Or just use MVP or MVVM architecture and implement view layer on native platform libraries
m
I am starting project so I am able to jump around and select technology that I like. I like idea of Kotlin Native, but there is also libgdx that apparently can be also done using Kotlin offering Linux + Android.
And there is Haxe that is multiplatform covering iOS, Android, Linux and more. Though my initial attempt there was failure, I was trying Kha framework. I failed to find an useful documentation for people starting with it, even samples were not running properly.
k
Gtk3 is made for all desktops. But Gtk3 performance on macOS is still not good as linux. I don't know about gtk performance on windows.