如何在 Android 应用程序中嵌入支持 SVG 的 webkit webview?
有没有办法在应用程序中嵌入自定义的 webkit 引擎以添加支持 SVG 的 WebView ?
Is there a way to embed a customized webkit engine in an app to add a WebView with SVG support ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
相应的 Bug Entry 提到了一些 Android 核心依赖项似乎不太容易替换,不确定所有这些是否可以包含在构建中,以便为您的应用程序提供准确的 webkit webview。
但是,通常可以使用另一个库项目来引用并包含在编译中。然后有一种方法来包含其他 JAR 文件< /a>,一种将现有项目转换为库的方法,甚至一个方式砍掉一个 .apk 并获取代码(您可以再次将其变成一个库)。
从来没有这样做过,但理论上,获取您想要捆绑的浏览器的库、.jar 或 .apk(正如开头提到的似乎不是最佳候选),查看原始代码,实例化浏览器视图做了什么一项活动 - 然后就可以开始了。
我很想听听您或其他人何时完成了这样的事情,
我迫不及待地想看看我们是否可以将其与多点触控功能捆绑在一起(2.x 中的另一个大缺点)以实现多点触控在 2.x 设备上的 android stock 浏览器上,我出于绝望启动了一个 polyfill 项目 (哪个效果出奇的好,但也比模拟完整的 SVG 解释器简单得多),因此对于 SVG 和为工作提供最佳的浏览器运行时来说,这会很棒。PS 根据您想要使用 SVG 执行的操作,有一种完全不同的解决方法。如果只是有时在屏幕上填充一些小东西,您可能会在谷歌上搜索“svg polyfill”,这会带来无数的解决方案 - 我不能立即推荐一个,因为这些实现是如此不同,您应该使用以下方法来评估它们你的实际应用程序。
The according Bug Entry mentions some android core dependencies which seem not-so-easy to replace, not sure if all of that could be included in a built to provide exactly a webkit webview with your app.
However, in general one can use another library project to be referenced and included on compilation. And then there is a way to include other JAR files, a way to convert an existing project into a library as well as even a way to butcher an .apk and get the code out (which again you can turn into a libary).
Never done it, but in theory, get a library, .jar or .apk of the browser you want to bundle (as mentioned the beginning seems not the best candidate), look into the original code what is done to instantiate that browsers view in an activity - and off you go.
Would love to hear when you or anybody else has accomplished to do such a thing,
i couldn't wait to see if we could bundle it with multitouch enabled (another big drawback in 2.x)for multitouch on the android stock browser on 2.x devices i started a polyfill project out of desparation (which works surprisingly well, but is also way simpler than emulating a complete SVG interpreter), so for matter of SVG and providing the best browser runtime for the job, this would be great.P.S. There is one completely different workaround depending on what you want to do with SVG. If it's just some small stuff to fill on the screen at times you might check google for "svg polyfill" which leads to a myriad of solutions - i couldn't recommend one straightaway, as those implementations are so different that you should evaluate them with your actual app.