On Feb 13, 8:21 am, Stoyan Damov <stoyan.da...@gmail.com> wrote: > Jon, search my posts (I have a few on this list) for "touch screen" - > Dianne explained pretty well why touch slows the game, and a > workaround for that. In short, you need to put your main thread to > sleep after you handle a touch event, otherwise Android will keep > pushing touch events to it and the thread simply steals CPU from your > game thread. In my game I sleep the main thread 100ms after a touch is > handled, taking as much as 10 touch events/sec (which is quite > enough). This has completely wiped out the touch handling in > traceview's profiling output. I also override dispatchTouchEvent, > which short-circuits a bit more Android code.
Thanks so much for the hint Stoyan! 10 events/sec wasn't appropriate for my game so I used a slightly different technique, but it's made a significant difference! I'll post in your thread about what I did so that the relevant info is in the same place. -- Jon --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---