wailsapp / wails

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

Support Android #1481

Open leaanthony opened 2 years ago

leaanthony commented 2 years ago

We'd like to support Android as a build target

baxiry commented 2 years ago

Awesome!

AlbinoDrought commented 2 years ago

(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!

leaanthony commented 2 years ago

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

laoshaw commented 1 year ago

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.

leaanthony commented 1 year ago

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

bymomo commented 1 year ago

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

laoshaw commented 1 year ago

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

ibonny commented 1 year ago

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.

laoshaw commented 1 year ago

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.

waffle-lord commented 1 year ago

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

laoshaw commented 1 year ago

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 commented 1 year ago

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.

fairking commented 1 year ago

FYI looks like tauri is heavily working on android support

srackhall commented 12 months ago

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.

leaanthony commented 12 months ago

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

fairking commented 12 months ago

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.

baxiry commented 12 months ago

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

ddkwork commented 11 months ago

Another way for build apk use

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

PylotLight commented 11 months ago

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.

ddkwork commented 10 months ago

find a gradle lib

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

PylotLight commented 10 months ago

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?

neoramos commented 9 months ago

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.

leaanthony commented 9 months ago

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

ultimateshadsform commented 8 months ago

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.

gedw99 commented 6 months ago

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...

leaanthony commented 6 months ago

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.

camstuart commented 4 months ago

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

PylotLight commented 4 months ago

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

MikeyA-yo commented 2 weeks ago

Hey friendly reminder, i'd be glad if it supports android

PylotLight commented 2 weeks ago

Hey friendly reminder, i'd be glad if it supports android

Anyone with the skills or experience is welcome to contribute, the current limited time of maintainers is currently focused on other areas like getting v3 out the door.