-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/mobile/webview: is a cross iOS/android web view possible? #10247
Comments
I would suggest you to target a small subset first. The initial step should be page loading, intercepting the requests and navigation-related APIs are secondary. A web view is critical to pop-up a welcome screen with instructions, listing credits, documenting help, etc. I'd like to have the possibility to switch to a web view for text-dominated screens. Recommended APIs to begin with:
|
I'm sorry for off topic, but still.. @crawshaw, thanks for support, it's very pleased that you raised this issue! |
u r right, Embedding a web browser on Android and IOS will unified development environment ,Let the developers don't focus on os environment! Android fragmentation is very serious, coupled with highly customized , multi-version (2.4-4.2 now V5), multi-resolution ,this allowing developers a headache , if you can solve this problem , many developers will adopt this platform. eg. When we release a android app run Android 2.4 or 4.2 and above, A Company and B Company were modified on customized Android system , the situation is often occur in the A Company B model can run , but in the B Company can not run on the C model! |
+1. It's a better idea than a cross-platform UI library. |
So, it's done and will be released with Go 1.5? Go + WebView + Polymer would be a great way to make Android applications; if working also on iOS it would be even better. |
No, it is not done yet.
|
CL https://golang.org/cl/11980 mentions this issue. |
Subclassing NativeActivity makes two things possible. Firstly, we can implement an InputConnection to offer good support for IMEs, necessary for good keyboard support. Secondly, we can use it to overlay WebViews onto the NativeActivity. But to sublcass NativeActivity, we need to compile Java. To keep the toolchain go gettable, this is done with go generate. While here, check the exception after FindClass. Apparently it can throw an exception. Updates golang/go#9361. Updates golang/go#10247. Change-Id: I672545997f0c9a7580f06988a273c03404772247 Reviewed-on: https://go-review.googlesource.com/11980 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
So i saw the Code at: golang/mobile@8f20c3e Thansks @crawshaw ! So is this closed ? Does NativeActivity generate Android code thats usable for loading web views ? |
@minux @crimshaw Is this still on the table in terms of an objective ? There are some good ways to bridge is inside the webview down into the golang code I think. |
Given I have no time to work on this, I'm going to close this issue. It is still a quite reasonable project, and I believe the gobind bindings are now good enough that this could be built in an external repository by anyone who is interested. |
thanks for update, and yes there seems to be be enough to get the job done. |
Here is a tool to do an webview app on android from your golang http server (it's not much tested/stable yet) https://github.com/microo8/gowebview |
thanks @microo8 . Code looks really good tooo. Like the way you code gen the boiler plate parts. There is a really nice desktop version for webview with golang here: If your interested i would be happy to visit the idea of collaborating on this |
Thanks for the praise @joeblew99 :) but it isn't fully tested yet. And also i'm making some changes to it in short. Trying to make it as an tool, not just an project template generator. I don't know if this is the place to discuss it, but I'd like to make some commands, like IOS is not in plan, android does it for me, but wouldn't mind to pull some changes to support it as well :P When @murlokswarm will have the mobile support, I'll definitely look at it, but this "framework style" development isn't for me :) I like the minimalistic approach that you are not bound to an framework, but create your own http server as you wish and then just wrap it with some code to create the mobile webview app. |
@microo8 very true about the framework style. Can see your point - just wanted to introduce the pattern they use in case it was useful for you. Regarding IOS. I am pretty useless at xCode. Over at the murlok team though the first one built was for OSX, and so its going to be likely that they could whip up an IOS version i suspect. Regarding the design time tooling of "create, build, debug, install" thats a great idea. |
Embedding a web browser is a common strategy for apps that are not heavily focused on UI, on both Android and iOS. The web also provides a very easy way to use other UI systems in a Go application.
Is there enough commonality between the embedded web views on Android and iOS to build an API usable entirely from Go? The Android WebView has a wide interface and its not clear what subset lines up with iOS. Still, this would be very nice to have.
Assigning to myself, unless someone else really wants this.
/cc @hyangah @rakyll
The text was updated successfully, but these errors were encountered: