Stevenisvader Posted May 10, 2013 Share Posted May 10, 2013 Hey all,I just started to use Phaser for html5 development, and everything works great so far I'm just having some troubles getting it to work on my Android phone.I have a Samsung Galaxy S2 I'm using to test. I started on 2.3.3 and I found that Phaser wouldn't load using the stock browser, and on any other browser the performance wasn't playable. So I upgraded my phone to the latest version I could, 4.1.2, and now Phaser works great with the stock browser, but whenever I try to slide my finger, the app freezes up and doesn't start again until I let go. Performance on other browsers is still unplayable. I overrode the OnMouseUp and OnMouseDown functions and added e.preventDefault(); but the same issue is still occuring. Is there anything I can do to fix this problem? Link to comment Share on other sites More sharing options...
rich Posted May 10, 2013 Share Posted May 10, 2013 Is there a link to your game anywhere? I need to do a mobile pass to fix some iPad 1 issues, but there's nothing in the framework that should stop Android 2.x from working so I'd be curious to see what was doing it. I suspect something relating to Web Audio. Link to comment Share on other sites More sharing options...
Stevenisvader Posted May 10, 2013 Author Share Posted May 10, 2013 It might have been a weird setting in my phone, maybe I even turned java script off, but with the stock browser I couldn't even get the test suite to work.Link is here:https://googledrive.com/host/0B8MfCYb9Jw9fRFl4VnJsMm4wYTg/default.htm The freeze occurs on the test suite too with 4.1.2 using the stock browser Link to comment Share on other sites More sharing options...
rich Posted May 12, 2013 Share Posted May 12, 2013 I've been doing a lot of mobile testing and optimising tonight. I tested on a Nexus One running Android 2.3.6 stock browser and performance was pretty bad as I'd expect. I created a mobile specific test running at 320x480 with stage.clear = false, no rotation and various other little tweaks and managed to get it going ok, but still nothing to write home about. On my Samsung S3 (Android 4.1.2 stock browser) it absolutely sped along and coped with most things I threw at it. Your demo is using a boat load of GeomSprites - these are really slow on droids because they use canvas primitives (quite a lot of them!). Try swapping for simple PNGs and you should see quite a difference. Also if you've got a large background image set stage.clear to false. Link to comment Share on other sites More sharing options...
Stevenisvader Posted May 15, 2013 Author Share Posted May 15, 2013 Like you said, once I removed the geom sprites the performance got a huge increase. I ended up fixing the freezing on touch issue by including some boiler plate code found on http://www.html5boilerplate.com/ Everything seems to run great now, at least on my 4.1.2 phone. Thanks for all the help. Link to comment Share on other sites More sharing options...
rich Posted May 15, 2013 Share Posted May 15, 2013 I have been doing a massive amount of optimisations across mobile the past 2 days. Performance is now pretty smooth on Android 2.x and iPad1 level hardware and I'm really happy with how it's running! Also fixed-up all the issues re: screen scaling, URL bar hiding, etc. It's all in the 096 branch on github but I'll be pushing it live probably end of this week. Have totally overhauled the Input manager as well - very very happy with it now Link to comment Share on other sites More sharing options...
inductible Posted November 14, 2013 Share Posted November 14, 2013 I have the same redraw issue on Galaxy S2 - touchmove seems to suspend repainting. I am preventingDefault on relevant events, etc, but no dice. There's a related listing here: http://stackoverflow.com/questions/7628828/javascript-page-repaint-halted-during-touchmove-event, but I don't think there's a satisfactory solution on the interweb yet. What boilerplate code worked for you Stevenisvader - do you know what fixed it specifically? Link to comment Share on other sites More sharing options...
Recommended Posts