wailsapp / wails

Create beautiful applications using Go
https://wails.io
MIT License
25.35k stars 1.22k forks source link

Support Android and IOS #199

Closed ewhal closed 5 years ago

ewhal commented 5 years ago

It would be beyond amazing if this was a write once run anywhere type deal. Supporting mobile devices would really make this happen. You can run golang on both android and ios. Unsure about how complicated this would be though.

https://github.com/golang/go/wiki/Mobile https://godoc.org/golang.org/x/mobile https://github.com/microo8/gowebview

leaanthony commented 5 years ago

Hi! Thanks for opening this request. It has certainly been talked about and we are open to it. This would be something we do post V1 so let's keep this in the backlog.

bh90210 commented 5 years ago

hi @ewhal take my opinion with a grain of salt, as I am far from being an expert on mobile dev (or dev in general lmao).

From my research on the subject I came to the realisation that going with Go for mobile dev is not going to work I'm afraid. Here is a proof-of-concept app I made using gomobile bind. This I made using Java + Go. (heck, I even tried writing a library!) What ur looking is actually the third iteration, initially I tried it using Go Qt bindings and after failure I gave a try with React Native, which again failed me (but if you go the React way it is worth looking at ghostbridge if u haven't already found it). one last thing that seemed fun is reverse bindings second last thing android's webview even in an abuse case scenario can not be used for many things.

The last repository you linked hasn't been update for 2 years. And I take a que from that, gomobile hasn't been updating either. Everything around gomobile is sparse and oldish.

Some reasons I concluded it will never work in production are a. app size. on mobile small size is important having a 30mb minimum size application is subpar in any scenario. (edit: ironically, one of wails selling points is that u avoid the whole browser baggage :smile:) b. if you are writing a library you won't be able to distribute it via maven etc which is problematic for adoption. (this is a general point, unrelated to wails) ~c. the complexity and time added in re-compiling the go binding it simply doesn't worth the final result. You probably could have done the same thing a bit clearer, easier and faster going native.~ (edit: actually I remove this bit cause again it is only relevant when writing essentially libraries using bind. having said that except a few proof of concept -really basic functionality- app examples that come with gomobile I haven't seen any real world implementation of gomobile build. If anyone has links please share)

bottom line, from my little experience if I was to re-write my app I would avoid React Native/Qt/Gomobile like catch-all solutions and straight go to kotlin (or swift respectively) or at least pure Java (or C#). Writing mobile apps is tricky and I see no viable way to avoid using native tools if you want user experience that competes with the rest of the apps out there.

leaanthony commented 5 years ago

Closing for now and listing on the https://github.com/wailsapp/wails/wiki/Post-V1-Enhancements page