5

I am developing an Android app using web technologies and the CSS transitions (quite essential to the functionality of the app, since they're responsible for scrolling and swiping pages) are quite sluggish. According to information found on the internet, CSS transitions are not hardware accelerated unless transformed 3-dimensionally. I found many articles saying that I should put "-webkit-transform: translateZ(0);" to my animated elements.

However, the Webkit in older Android versions (below 3.0) doesn't support 3D transformations.

Can I embed a newer version of WebKit with my app?

Ivo
  • 1,673
  • 3
  • 19
  • 28

1 Answers1

3

Can I embed a newer version of WebKit with my app?

In theory, perhaps.

You would have to completely rewrite WebKit to use something that the NDK supports for output (e.g., OpenGL) and embed it in your app. I estimate that this will take >100 developer-months, so if you have a large team and matching budget, you are welcome to try this. By the time you complete the work, the "older Android versions" will be obsolete, and you will not need the code.

Hence, from a practical standpoint, either redesign the apps such that CSS transitions are no longer "essential to the functionality of the app", or limit your app to Android 3.0+ and wait for the Android user base to catch up.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • No, it does not require a complete re-write in Java. Seems like the guys Dolphin have shipped a newer version of WebKit with their latest version, so it seems to be possible. Also, I remember reading somewhere that Android allows to ship native binaries in apk files, but I am not sure. – Ivo Aug 26 '12 at 02:37
  • @Ivo: "No, it does not require a complete re-write in Java" -- I never said it did. "Also, I remember reading somewhere that Android allows to ship native binaries in apk files, but I am not sure" -- for a library like WebKit, that would be through the NDK, as I explained in my answer. Now, admittedly, it would appear to be not as difficult as I expected, and they may have cut some corners to achieve that, but as their work is not open source (last I checked), I have no way of confirming their specific techniques. – CommonsWare Aug 26 '12 at 10:42
  • Yes, their work is not open source, but it proves that it is possible, and according to their announcements, is not a complete rewrite, but an upgrade on WebKit. Now, I don't have an idea if they managed to ship a newer WebKit through their app or they simply build on top of the included version. It would be great if we got some inside info. – Ivo Aug 26 '12 at 12:12