Nov 29, 2011 Replies: 5 This is a test program to explore running HTML5 games in a Webview - proof of concept. The html is is the Files folder, you can also run this in a desktop browser by opening index.html in Firefox or Chrome. The HTML5 code was created using Construct2 (free version). Well.. it runs complete with 2D physics engine but sooo slow. The html code does not seem to be mobile friendly with very high cpu utilisation. Project file is attached for those that want to play with this. bluejay **** UPDATED 14th March, 2013 to work with current version of WebViewExtras library (currently ver 1.35) Attachments WebViewTest1.jpg 36.8 KB · Views: 9,407 WebViewTest2.jpg 34.7 KB · Views: 1,362 WebViewTestnew.zip WebViewTestnew.zip 386.4 KB · Views: 2,368 Last edited: Mar 14, 2013 Click to expand...
This is a test program to explore running HTML5 games in a Webview - proof of concept. The html is is the Files folder, you can also run this in a desktop browser by opening index.html in Firefox or Chrome. The HTML5 code was created using Construct2 (free version). Well.. it runs complete with 2D physics engine but sooo slow. The html code does not seem to be mobile friendly with very high cpu utilisation. Project file is attached for those that want to play with this. bluejay **** UPDATED 14th March, 2013 to work with current version of WebViewExtras library (currently ver 1.35)
eps Expert Licensed User Longtime User Nov 29, 2011 #2 Very interesting! Thanks for posting this. When you say that it doesn't work well on mobiles, which phone did you try it on?
Very interesting! Thanks for posting this. When you say that it doesn't work well on mobiles, which phone did you try it on?
bluejay Active Member Licensed User Longtime User Nov 29, 2011 #3 So far tested on Samsung Galaxy S OS 2.3.3 and ASUS transformer OS 3.2. CPU utilization on Galaxy S was 78%, the java script physics engine seems to re-calculate everything even if they are not moving or changing. Attached is the javascript which has not be minified ie the readable version. The javascript also uses JQuery. Source for games was edited so it does not try download this everytime the app runs. bluejay Attachments c2runtime.zip c2runtime.zip 81.5 KB · Views: 1,045
So far tested on Samsung Galaxy S OS 2.3.3 and ASUS transformer OS 3.2. CPU utilization on Galaxy S was 78%, the java script physics engine seems to re-calculate everything even if they are not moving or changing. Attached is the javascript which has not be minified ie the readable version. The javascript also uses JQuery. Source for games was edited so it does not try download this everytime the app runs. bluejay
robife Member Licensed User Longtime User Mar 12, 2013 #4 I got this error trying compile Code: Copy Parsing code. 0.03 Compiling code. Error Error compiling program. Error description: Missing parameter. Occurred on line: 35 MyWebViewExtras.addWebChromeClient(WebView1) Word: )
I got this error trying compile Code: Copy Parsing code. 0.03 Compiling code. Error Error compiling program. Error description: Missing parameter. Occurred on line: 35 MyWebViewExtras.addWebChromeClient(WebView1) Word: )
T tecevit Member Licensed User Longtime User Mar 14, 2013 #5 robife said: I got this error trying compile Code: Copy Parsing code. 0.03 Compiling code. Error Error compiling program. Error description: Missing parameter. Occurred on line: 35 MyWebViewExtras.addWebChromeClient(WebView1) Word: ) Click to expand... Looks like MyWebViewExtras.addWebChromeClient needs another parameter : MyWebViewExtras.addWebChromeClient(WebView1,"WebView1") "somestring" works too for this case..
robife said: I got this error trying compile Code: Copy Parsing code. 0.03 Compiling code. Error Error compiling program. Error description: Missing parameter. Occurred on line: 35 MyWebViewExtras.addWebChromeClient(WebView1) Word: ) Click to expand... Looks like MyWebViewExtras.addWebChromeClient needs another parameter : MyWebViewExtras.addWebChromeClient(WebView1,"WebView1") "somestring" works too for this case..
bluejay Active Member Licensed User Longtime User Mar 14, 2013 #6 Thanks robife and tecevit for spotting this. There was a breaking change in the WebViewExtras library which now has an extra EventName parameter. I have updated the first post with a new project file to make the following change: Code: Copy MyWebViewExtras.addWebChromeClient(WebView1,"") Runs at reasonable speed on a Samsung Galaxy S3 but devices with poor Javascript implementation, such as Samsung Galaxy TAB2, still struggle. bluejay
Thanks robife and tecevit for spotting this. There was a breaking change in the WebViewExtras library which now has an extra EventName parameter. I have updated the first post with a new project file to make the following change: Code: Copy MyWebViewExtras.addWebChromeClient(WebView1,"") Runs at reasonable speed on a Samsung Galaxy S3 but devices with poor Javascript implementation, such as Samsung Galaxy TAB2, still struggle. bluejay