4

When using the WebView in an Android application - Android will utilize different browsers under the hood in order to render the web page. For example - pre Android 4.4 on Samsung devices will use the WebKit based browser that comes on Samsung stock phone (even if Chrome is installed and is the default web browser). Google Nexus/HTC phones come with Chrome pre-installed and they will use it to render web content.

We have rendering problems with the WebKit browser on Samsung/LG devices with sites like Google Drive. When opened on the same device in Chrome - they render perfectly but when rendered in our application (which uses the builtin browser) - they fail to render the content.

I'm looking for a way to make the WebView use Chrome (if installed) instead of the builtin browser on the devices giving me problems.

Can anyone help?

FunkSoulBrother
  • 2,057
  • 18
  • 27
  • You can use crosswalk, cordova etc. to achieve this. If your device runs on android 5+ default webview uses chromium and it is also upgradable just like an ordinary application. – halil Aug 26 '15 at 13:16
  • Halil, Thanks for your comment. My intention was to be able to make the WebView use a rendering engine already installed on the device (Chrome for example) without having to add it to my app. I know it's a long shot. – FunkSoulBrother Aug 27 '15 at 07:38
  • I managed to make a webgl application work on android 4.2 device which is also on gpu blacklist, using crosswalk(Which I thought was impossible after several hours of searching). Because crosswalk webview packages chromium within application and I could use ignore_gpu_blacklist etc chrome features while making apk file. But for using an already installed Chrome instead of packaging it, I have no idea. – halil Aug 27 '15 at 08:55

1 Answers1

3

When using the WebView in an Android application - Android will utilize different browsers under the hood in order to render the web page.

No, WebView uses different Web rendering engines, not different browsers.

For example - pre Android 4.4 on Samsung devices will use the WebKit based browser that comes on Samsung stock phone (even if Chrome is installed and is the default web browser).

No, WebView will use WebKit on all pre-4.4 devices, not "the WebKit based browser".

Google Nexus/HTC phones come with Chrome pre-installed and they will use it to render web content.

No, WebView will use WebKit on all pre-4.4 devices, not Chrome, regardless of make or model, barring some massive manufacturer-specific modifications. I can positively state that no such modifications existed on Nexus-series devices of pre-4.4 vintage.

I'm looking for a way to make the WebView use Chrome (if installed) instead of the builtin browser on the devices giving me problems.

That is not possible. You are welcome to investigate using some other Web rendering engine (e.g., see how Mozilla's GeckoView is coming along, see if there is a Chromium port to Android that you can bake into your app), but prior to Android 4.4, there is no notion of WebView itself using some other engine. You would need to use some other API for displaying Web content, tied to the other rendering engine. Also note that using another Web rendering library will significantly increase your app size.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Thanks for the clarifications. After researching for several hours on the net it looks like there is no way to use a different rendering engine in pre 4.4 Android version. – FunkSoulBrother Aug 27 '15 at 08:06