wails icon indicating copy to clipboard operation
wails copied to clipboard

Support Android

Open leaanthony opened this issue 2 years ago • 35 comments

We'd like to support Android as a build target

leaanthony avatar Jun 22 '22 10:06 leaanthony

Awesome!

baxiry avatar Jun 24 '22 06:06 baxiry

(I'm just a random dude / not associated with the Wails project)

We're hacking on a new project using Wails. Depending on success, we're aiming for an eventual Android release.

To know that it's feasible, I've hacked together enough code so the default Wails template can run on Android. I haven't integrated it into wails build, so it requires a manual build process: https://github.com/AlbinoDrought/wails-android-test (changes licensed CC-0, go wild)

Here's a screenshot: image

Here's some Logcat logs:

2022-09-10 20:26:08.595 24016-24107/? I/Wailsdroid: Request: GET wails://wails/
2022-09-10 20:26:08.606 24016-24107/? I/Wailsdroid: Response: HTTP 200 OK, text/html utf-8
2022-09-10 20:26:08.752 24016-24107/? I/Wailsdroid: Request: GET wails://wails/wails/ipc.js
2022-09-10 20:26:08.753 24016-24107/? I/Wailsdroid: Response: HTTP 200 OK, application/javascript 
2022-09-10 20:26:08.758 24016-24107/? I/Wailsdroid: Request: GET wails://wails/wails/runtime.js
2022-09-10 20:26:08.758 24016-24106/? I/Wailsdroid: Request: GET wails://wails/assets/index.ad5867ac.js
2022-09-10 20:26:08.759 24016-24102/? I/Wailsdroid: Request: GET wails://wails/assets/index.dbe33b87.css
2022-09-10 20:26:08.759 24016-24106/? I/Wailsdroid: Response: HTTP 200 OK, application/javascript 
2022-09-10 20:26:08.759 24016-24102/? I/Wailsdroid: Response: HTTP 200 OK, text/css utf-8
2022-09-10 20:26:08.764 24016-24107/? I/Wailsdroid: Response: HTTP 200 OK, application/javascript 
2022-09-10 20:26:08.872 24016-24180/? I/Wailsdroid: Received message: runtime:ready
2022-09-10 20:26:08.886 24016-24107/? I/Wailsdroid: Request: GET wails://wails/assets/nunito-v16-latin-regular.06f3af3f.woff2
2022-09-10 20:26:08.887 24016-24107/? I/Wailsdroid: Response: HTTP 200 OK, font/woff2 
2022-09-10 20:26:08.894 24016-24106/? I/Wailsdroid: Request: GET wails://wails/assets/logo-universal.cb3119ea.png
2022-09-10 20:26:08.895 24016-24106/? I/Wailsdroid: Response: HTTP 200 OK, image/png 
2022-09-10 20:26:23.221 24016-24180/? I/Wailsdroid: Received message: C{"name":"main.App.Greet","args":["AlbinoDrought"],"callbackID":"main.App.Greet-977632637"}

Cheers!

AlbinoDrought avatar Sep 11 '22 04:09 AlbinoDrought

Holy moley! This is amazing! Thanks so much - we will build on this post v2 release 🙏

leaanthony avatar Sep 11 '22 10:09 leaanthony

what about ios target? fyne.io can do them all, let's have the main platforms(windows,linux,macos, android,ios) all with wails if feasible.

laoshaw avatar Oct 11 '22 02:10 laoshaw

https://github.com/wailsapp/wails/issues/1482

leaanthony avatar Oct 11 '22 08:10 leaanthony

There is no need to support Android and iOS at all. There are uni app, flutter, and react-native. Uniapp is similar to webview。It's better to focus on desktop programs

bymomo avatar Oct 21 '22 02:10 bymomo

in that case, flutter could be the way to do? for android and ios that is

laoshaw avatar Oct 23 '22 23:10 laoshaw

Unfourtunately, in my experience, Dart gets complicated, and NativeScript has issues. For simplicity, there is nothing like the combination of a frontend web framework for UI, and Go for all backend work. This is why Wails is a really good winning combination. Dart is good, but it can get very complicated when trying to write stateful UIs. Bundling all this together in an APK for Android would be great.

ibonny avatar Oct 24 '22 15:10 ibonny

I like wails and will wait for its android and ios support. in the meantime it seems flutter is the one most promising that covers the smartphone apps space. looked into fyne before but I think wails desktop solution is better.

laoshaw avatar Oct 24 '22 16:10 laoshaw

This would be absolutely amazing to have and would make wails my one-stop-shop for application development. Trying to use Flutter right now for android and boy howdy is it annoying.

Hoping this makes the cut for wails v2 at some point

waffle-lord avatar Nov 16 '22 15:11 waffle-lord

wading into ios|android will be a very different and challenging task, you will have to call java-api or swift-api in the end to get all the juicy stuff from their ecosystems, golang will have to provide some bindings there, don't know how feasible this path will be.

laoshaw avatar Nov 16 '22 15:11 laoshaw

https://github.com/socketsupply/socket uses some clever way(json marshalling) to work with android and ios webviews, maybe Wails can borrow some ideas there to get mobile supported. yes it will lack some native api features, but it might be good enough for 90% user cases.

laoshaw avatar Dec 11 '22 03:12 laoshaw

FYI looks like tauri is heavily working on android support

fairking avatar Feb 02 '23 16:02 fairking

It would be better for Wails to focus on desktop development, right? It seems that there’s not much necessity to support mobile development. After all, traditional hybrid solutions for mobile are already mature, and they don’t interfere with the combined use of Go. Therefore, instead of diverting energy to venture into mobile development, it would be more beneficial to concentrate on doing a good and thorough job with desktop development.

srackhall avatar Sep 21 '23 10:09 srackhall

Regarding demand, I think the reactions speak for themselves. Having said that, desktop will always be the primary focus

leaanthony avatar Sep 21 '23 13:09 leaanthony

If someone is interested there is an example of Linux Mobile (not Android): https://gitlab.com/dedSyn4ps3/wails-pinephone Supported OS: Phosh, Plasma Mobile, Ubuntu Touch.

fairking avatar Sep 21 '23 15:09 fairking

Supporting mobile will add momentum to this project. It will be beneficial, even if indirectly. The Wells project is beginning to approach stability, It will become possible to support new platforms

baxiry avatar Sep 21 '23 20:09 baxiry

Another way for build apk use

https://github.com/xlab/android-go

ddkwork avatar Oct 19 '23 03:10 ddkwork

Another way for build apk use

https://github.com/xlab/android-go

Given the lack of commit history on this one, I don't think it's a super viable option officially long term.

PylotLight avatar Oct 19 '23 06:10 PylotLight

find a gradle lib

https://github.com/bitrise-io/go-android/tree/master/gradle

ddkwork avatar Nov 01 '23 12:11 ddkwork

find a gradle lib https://github.com/bitrise-io/go-android/tree/master/gradle

Looks updated but with 0 documentation, do you know how to use/implement it?

PylotLight avatar Nov 01 '23 12:11 PylotLight

I'm currently evaluating Wails. First thank you to those developing / supporting Wails. It is really amazing what you have accomplished thus far. Support for IOS and Android mobile apps would be fantastic. As someone else mentioned in another comment, Wails would become my "one-stop shop" for GUI app development.

neoramos avatar Dec 08 '23 17:12 neoramos

Thanks for the kind words. We'd love to support mobile.

leaanthony avatar Dec 08 '23 20:12 leaanthony

I just wanted to add.

It also would be nice to be able to write plugins that interact with the android system in a nice convenient way. Maybe with kollin and maybe golang communicates with kollin plugin.

I have no idea how that would work but it's a nice feature to have.

ultimateshadsform avatar Jan 20 '24 04:01 ultimateshadsform

hey @leaanthony

there is a golang web view for iOS and android here. I used it ages ago and it worked ok.

https://github.com/gioui-plugins/gio-plugins/tree/add-signin/webviewer

I wish wails had mobile web views...

gedw99 avatar Mar 14 '24 19:03 gedw99

Thanks! Why not join us on discord and we can talk about what's needed for doing it? All we need is someone to drive it.

leaanthony avatar Mar 14 '24 19:03 leaanthony

For mobile support, I wonder if capacitor is an option? Use ionic framework ui components?

camstuart avatar Apr 23 '24 11:04 camstuart

The Tauri mobile integration doesn't look super complicated, something we can work with there in terms of "borrowing"? https://github.com/tauri-apps/tauri/blob/dev/core/tauri/mobile/android/build.gradle.kts

PylotLight avatar Apr 23 '24 12:04 PylotLight