wails
wails copied to clipboard
Support Android
We'd like to support Android as a build target
Awesome!
(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:
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!
Holy moley! This is amazing! Thanks so much - we will build on this post v2 release 🙏
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.
https://github.com/wailsapp/wails/issues/1482
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
in that case, flutter could be the way to do? for android and ios that is
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.
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.
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
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.
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.
FYI looks like tauri is heavily working on android support
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.
Regarding demand, I think the reactions speak for themselves. Having said that, desktop will always be the primary focus
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.
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
Another way for build apk use
https://github.com/xlab/android-go
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.
find a gradle lib
https://github.com/bitrise-io/go-android/tree/master/gradle
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?
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.
Thanks for the kind words. We'd love to support mobile.
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.
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...
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.
For mobile support, I wonder if capacitor is an option? Use ionic framework ui components?
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