Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embedded Chromium or Webkit in Android app

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.

Background

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.

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.

Our Idea

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.

So far

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)

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)

  • Webkit component for Android
  • Embed basic WebKit + V8 in my app
  • Embedding a newer version of WebKit with Android app

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?

Update

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

like image 531
Christian Klauser Avatar asked May 17 '13 07:05

Christian Klauser


People also ask

Does Android use Webkit?

The web browser available in Android is based on the open-source Blink (previously WebKit) layout engine, coupled with Chromium's V8 JavaScript engine.

What is Webkit in Android?

The androidx. webkit library is a static library you can add to your Android application in order to use android. webkit APIs that are not available for older platform versions. Requirements. The minimum sdk version to use this library is 14.

Is Android WebView based on Chromium?

Since Android 4.4 (KitKat), the WebView component is based on the Chromium open source project.


1 Answers

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

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

like image 83
Satoshi Deguchi Avatar answered Oct 19 '22 19:10

Satoshi Deguchi