Android: Touch seriously slowing my application
Posted
by
Jason Rogers
on Stack Overflow
See other posts from Stack Overflow
or by Jason Rogers
Published on 2010-12-03T04:26:59Z
Indexed on
2011/01/08
4:53 UTC
Read the original article
Hit count: 194
Hi all,
I've been raking my brains on this one for a while.
when I'm running my application (opengl game) eveyrthing goes fine but when I touch the screen my application slows down quite seriously (not noticeable on powerful phones like the nexus one, but on the htc magic it gets quite annoying).
I did a trace and found out that the touch events seem to be handled in a different thread and even if it doesn't take so much processing time I think androids ability to switch between threads is not so good...
What is the best way to handle touch when speed is an issue ?
Currently I'm using : in the GLSurfaceView
@Override
public boolean onTouchEvent(MotionEvent event) {
GameHandler.onTouchEvent(event);
return true;
}
Any ideas are welcome
© Stack Overflow or respective owner