Search code examples
androidwebviewwebkit

Do all apps on an Android device which are using WebViews load the same version of Webkit at runtime?


I have a situation where I'm testing 3D CSS transforms inside multiple 3rd party apps with embedded WebViews on the same Android device, but in some of those apps they render flat, just as if they would be running inside an older version of Webkit which did not yet support 3d transforms.

Can anyone tell me whether apps which were compiled using older SDKs actually load older versions of Webkit, even though they are running on a device with a recent version of Android? And if so, is it possible to determine the version by examining the apk file?


Solution

  • As far as I know the WebView widget should be the same system-wide. I can think of three possible reasons for the observed differences:

    1. Some apps may bundle a non-standard WebView (obviously Chrome, Firefox, &c do this). There are also some open-source libraries based on Chromium available, such as ChromeView or ChromiumWebView. Any app using one of these could probably have a different behavior.

    2. Even if using the standard WebView, it can be configured in different ways via the WebSettings class (such as toggling JavaScript, geolocation, plugins, database storage, &c). Behavior of displayed web pages may be affected by these flags.

    3. Lastly, running an application targeting an older version of Android does add some "compatibility shims" in parts of the framework.

    As Android evolves with each new version, some behaviors and even appearances might change. However, if the API level of the platform is higher than the version declared by your app's targetSdkVersion, the system may enable compatibility behaviors to ensure that your app continues to work the way you expect.

    Some of these compatibility changes (of which some target WebView) are listed in the documentation of Build.VERSION_CODES.