Built-in Chromium or Webkit in an Android App

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

Background

Significant parts of our application consist of fragments of a web page embedded in the presentation (served by the application itself). We try to do this as transparent as possible (in terms of visual / user experience). So far, we have used WebView for this, and this works for the most part. Except when this does not happen.

Some phone manufacturers, unfortunately, decided to set up a standard Android browser here and there. In some cases, this violates our application or makes the fact that we embed a web page more visible.

Our idea

We would like to have a component similar to WebView , but where do we control which version of Webkit / Chromium (or some other rendering engine). This does not have to be the latest and greatest version. More importantly, we can make our application run sequentially on any Android device.

Until

Our research has not yet yielded anything useful. We found three dead attempts to port Webkit to the NDK (functions that are not available in the NDK, and therefore application developers, are used for the open Webkit port for Android):

Looking at StackOverflow, we also found a number of similar issues, most of which are resolved by pointing to WebView (we already do this, and this is not good enough)

  • Webkit component for Android
  • Embed basic WebKit + V8 in my application
  • Introducing a new version of WebKit with an Android application

We are currently studying whether Chromium for Android (or parts of it) can turn into a library that our application can use. Has anyone else done this?

Update

After watching the chromeview project on GitHub (accepted answer), we decided that we had better wait until Google released a Chrome-based web browser on future Android devices. The Chromium rendering engine is quite large (~ 40 MB), which does not leave much space for a real application: (

+47
android android-ndk webkit chromium
May 17 '13 at 7:55
source share
6 answers

pwnall / chromeviewGitHub https://github.com/pwnall/chromeview

ChormeView works like Android WebView, but is supported by the latest Chromium code.

+12
Jun 05 '13 at 1:27
source share

You should check out the Crosswalk project. Sponsored by Intel and is actively developing. They pull out Chromium sources and promise to make all the new Chromium features available on Crosswalk within 6 weeks.

Crosswalk is a web-based runtime for ambitious HTML5 applications. It provides all the features of a modern browser, combined with a deep integration of devices and APIs to add custom extensions. It is especially suitable for mobile devices.

Crosswalk supports Android 4.0 and later on ARM and Intel architectures.

Within an hour after I found this project, I had the Cordova / Phonegap application on an Android phone with Crosswalk. I am glad that I do not need to configure Javascript code to comply with the deficiencies (pre-4.4) of android.webkit.WebView.

https://crosswalk-project.org

+10
Aug 13 '14 at 18:39
source share

Without WebKit, there is a GeckoView . Of course, he adds over 20 million libraries to the project.

+3
Dec 06 '13 at 16:01
source share

I tried using the latest version of Chromium code to create a custom WebView and succeeded.

I will give my approach now, but not the source code.

Ultimately, the size of the WebView user library is about 30 MB, which is quite large for a small application. But this is great, because it supports Android 4.0 perfectly.

Below is my method:

  • extract the chrome source code and build web_view_apk (test shell AndroidWebView) follow this instruction https://www.chromium.org/developers/how-tos/android-build-instructions

  • use apktool to decompile the Aw Shell apk file above. https://ibotpeaches.imtqy.com/Apktool/

  • create a project with res, lib folder just like a decompiled project.

  • The manifest file is located in / src / android _webview / test / src / org / chromium / shell

  • src folder: you will find classes in the chromium project source code that correspond to files in the smali folder of the decompiled project.

I will update my code later, but you can try my guide if you do not want to wait.

+2
Oct 17 '15 at 15:29
source share
0
Sep 28 '15 at 8:36
source share

Googles Trusted Web Activity is what you are looking for

https://developers.google.com/web/updates/2017/10/using-twa

0
Jan 27 '19 at 20:47
source share



All Articles