Jump to content

Android Freeze on Touch Move


Stevenisvader
 Share

Recommended Posts

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

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

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

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

  • 5 months later...

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

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...