Android webview 的替代方案
有谁知道 Android 的 webview 组件的替代品吗?由于某些原因,它的功能对我来说是不够的:当我浏览 wml 页面(wap)时,我需要能够捕获对某个 url 的每个请求。不管怎样,我需要能够做 Android 的 webview 不适合做的事情。 我想“嘿,让我们玩一下源代码,我很确定 webviews 正在使用 apache.org 库来访问互联网”。 天哪,我错了。 Webviews 使用本机代码,这就是我陷入困境的地方。
所以我想知道是否有人知道另一种纯 java 的网络浏览器视图,它是开源的并且很好。如果速度慢也不是问题,我正在显示一些基本的 wap 页面...
提前致谢。
Does anyone knows an alternative to Android's webview component ? For some reasons, it's functionality's are insufficient for me : I need to be able to catch every single request to some url, when i'm browsing a wml page (wap). Anyway, I need to be able to do stuff that Android's webview is not made for.
I thought "hey, let's play with the source code, I'm pretty sure that webviews are using apache.org librairies to access internet".
Oh boy was I mistaken. Webviews use native code, and that's where I'm stuck.
So I was wondering if anyone knew of another web browser view, in pure java, that would be open source and nice. It's not a problem if it's slow, i'm displaying some basic wap pages...
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以使用 setWebViewClient & 来扩展 WebView 的功能。 setWebChromeClient。
您可以通过重写以下方法来处理从 WebView 发送/接收的每个请求:
You can extend WebView's functionality by using setWebViewClient & setWebChromeClient.
You can handle each and every request sent/received from the WebView by overriding the below methods:
人行横道项目:https://crosswalk-project.org/ 可能就是您所需要的。但请注意,它与 Stock webview 存在一些不同的地方。在某些方面更好,在某些方面更糟。例如,它支持WebGL(好),但目前背景不能透明(坏)。真正的好消息是,它似乎得到了非常积极的支持,运行自己的 Jira 来跟踪和修复,而且英特尔似乎也非常参与其中。
The crosswalk project: https://crosswalk-project.org/ might be what you need. But beware, there are places where it differs from the stock webview. In some ways better, in some ways worse. For example, it supports WebGL (good), but currently the background cannot be transparent (bad). The really good news, it seems to be very actively supported, running it's own Jira to track and fix and Intel seems to be very involved.
尝试看看 Opera Mini 是如何编程的。
但我认为如果你想要另一个,你必须对其进行编程。但如果它有很好的表现,我会感到惊讶。
Try to see how was Opera Mini programmed.
But I think you must program it if you want another one . But i would be surprised if it has a nice performance.