1/30/2015

Android and Webview + Html5

Since I got my new android phone (a oneplus one) late last year I wanted to look into making an android game and I finally made good progress.

Since I am into javascript/typescript html5 games at the moment, I have looked into building an android app that basically consists of nothing but a fullscreen browser.

With Android Studio 1.0 (the new intellij based google android developement studio) this was (with some googlefu) pretty easy - but then came the harsh awakening - while webview is based on chrome, it is:
a) an older version
b) not webgl enabled
c) running under more restricted power conditions then the normal chrome

This makes it nearly unusable. The absolute same webpage displayed within a webview barely manages 20fps while the chrome version has steady 60fps.

The app only has one activity which consists of one component, a webview (from android 4.4 on the webview is using the chrome rendering engine). Stackoverflow helped me get the webview to fullscreen and then it's just a matter of one line to enabling javascript and another to line to load the index.html for the game.

The issue reports about the performance problems are from 2013, when 4.4. first came out. (The previous webview had slightly better(!) performance).

Android 5 is supposed to have a better webview - and since it is due within the next few month, I'll hold off on developing the android game and re focus myself on webgl and threejs for now.

No comments:

Post a Comment