Android 应用程序中的嵌入式 Chromium 或 Webkit [英] Embedded Chromium or Webkit in Android app

查看:20
本文介绍了Android 应用程序中的嵌入式 Chromium 或 Webkit的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我们的 Android 应用,我们希望嵌入我们自己的浏览器/渲染引擎.最有可能的候选者是 Webkit/.本质上,我们正在寻找类似于 WebView 的东西,但是由我们控制的浏览器(版本)提供支持.

For our Android app, we would like to embed our own browser/rendering engine. The most likely candidate for this, is Webkit/Chromium. We are looking for something similar to WebView, essentially, but backed by a browser (version) that we control.

我们应用程序的重要部分由嵌入在视图中的网页片段组成(由应用程序本身提供).我们尝试尽可能透明地做到这一点(从视觉/用户体验的角度来看).到目前为止,我们一直在为此使用 WebView大部分.除非它没有.

Significant parts of our app consist of web page fragments embedded in the view (served by the app itself). We try to do this as transparently as possible (from a visual/user experience standpoint). So far, we have been using WebView for this and that works for the most part. Except when it doesn't.

不幸的是,一些手机供应商决定在这里和那里调整标准的 Android 浏览器.在某些情况下,这会破坏我们的应用程序或使我们嵌入网页的事实更加引人注目.

Some phone vendors have unfortunately decided to tweak the standard Android browser here and there. In some cases, this breaks our app or makes the fact the we embed a web page more noticeable.

我们希望有一个类似于 WebView 的组件,但是我们控制正在使用哪个版本的 Webkit/Chromium(或其他渲染引擎).它不一定是最新最好的版本.更重要的是,我们可以让我们的应用在尽可能多的 Android 设备上一致运行.

We'd like to have a component similar to WebView but where we control what version of Webkit/Chromium (or some other rendering engine) is being used. It wouldn't necessarily have to be the latest and greatest version. It is more important that we can get our app to work consistently across as many Android devices as possible.

到目前为止,我们的研究还没有发现任何有用的东西.我们发现了三个将 Webkit 移植到 NDK(裸 Webkit对于 Android 端口使用 NDK 中不可用的功能,因此不适用于应用程序开发人员):

Our research so far has not turned up anything useful. We have found three dead attempts to port Webkit to NDK (the bare Webkit for Android port uses functionality not available in the NDK and thus not to app developers):

  • Webkit Android port by Company 100 (no updates for over two years)
  • mogo-browser (their last revision was to delete all source code)
  • NDK Webkit (officially abandoned by its author)

查看StackOverflow,我们也发现了很多类似的问题,大部分都是通过指向WebView来解决的(我们已经这样做了,还不够好)

Looking on StackOverflow, we have also found a number of similar questions, most of which being solved by pointing to WebView (we already do that, and it's not good enough)

我们目前正在调查是否 Chromium for Android(或其中的一部分)可以变成我们的应用程序可以使用的库.有其他人这样做过吗?

We are currently investigating whether Chromium for Android (or parts of it) can be turned into a library that our app could use. Has anyone else done this?

在查看了 GitHub 上的 chromeview 项目(已接受答案)之后,我们决定我们宁愿等待 Google 在未来的 Android 设备上发布基于 Chrome 的 WebView.Chromium 渲染引擎相当大(~40MB),并没有为实际应用留下太多空间:(

After having a look at the chromeview project on GitHub (accepted answer), we decided that we'd rather wait for Google to release a Chrome-based WebView on future Android devices. The Chromium rendering engine turns out to be fairly large (~40MB), which doesn't leave much space for the actual app :(

推荐答案

pwnall/chromeview · GitHubhttps://github.com/pwnall/chromeview

pwnall/chromeview · GitHub https://github.com/pwnall/chromeview

ChromeView 的工作方式类似于 Android 的 WebView,但由最新的 Chromium 代码支持.

ChromeView works like Android's WebView, but is backed by the latest Chromium code.

这篇关于Android 应用程序中的嵌入式 Chromium 或 Webkit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆