Is there any reason as to why when you touch the screen, a constant flood of events comes in? I mean, does each event reflect a single pixel on the screen where a touch is happening..and thus a finger that might span a circumference of say 60 pixels, causes tons of events to come in for those pixels? So far I've only used buttons and such with touch screen, so I've not had to worry about specific locations of fingers and such. I am curious how that is reported.. if I have a fat finger, do more events get generated, or is a single point narrowed in on for the touch event.. the center hopefully, and only that is reported? I can see if you wiggle your finger a little bit how it might move the center point slightly and cause more events, but I would have a touch/hold would send just the one event of where the center point is.
On Wed, Jan 27, 2010 at 5:06 PM, Mario Zechner <[email protected]>wrote: > @Ralf you can find the base activity for my tutorial code at > > http://code.google.com/p/android-gamedev/source/browse/trunk/src/com/badlogic/gamedev/tools/GameActivity.java > . > Inserting fps timing should be easy. > > @Lance that sounds like an interesting idea. However, i suspect the > flood arises at a deeper abstraction level not accesible via the java > framework. > > On Jan 28, 1:16 am, Lance Nanek <[email protected]> wrote: > > Someone in one of the past threads on this issue mentioned that > > overriding dispatchTouchEvent on Activity performs better than > > onTouchEvent on a View. It might be worth testing that if you guys are > > writing benchmarks anyway. > > > > On Jan 27, 5:56 pm, Ralf Schneider <[email protected]> wrote: > > > > > Robert, > > > > > yes, there is really nothing more! > > > > > I have already tested with a Thread.sleep(18). This does not change the > > > behaviour. > > > Actually it makes other things worse. Events don't get handled in time: > > > If you don't touch the screen for a while it's get dimmed. If I put in > the > > > Thread.sleep(...) and touch a (dimmed) screen it can take up to 3 and > more > > > seconds until it gets bright again. Without the sleep() it is reacting > > > instantly. > > > > > So I have abonomed Thread.sleep(...) and event.recycle(). I think we > have to > > > live with this behaviour. > > > > > But it would be good if another one can confirm this. Especially if it > is a > > > problem with the Nexus One or Android 2.1. > > > > > Can someone post its Java "Framerate meassurement code" and post it? > Mine is > > > in a "Game-Framework" (which I can not share) written in C++. > > > > > With this I can prepare a simple testcase. But as I told the test is > really > > > simple: Take the code from: > http://android-developers.blogspot.com/2009/04/introducing-glsurfacev... > > > add the log output of the frame rate. > > > > > Regards, > > > Ralf > > > > > 2010/1/27 Robert Green <[email protected]> > > > > > > So Ralf, > > > > > > Is that really what you have for your touch handling? Nothing - and > > > > you get that slowdown? Can you test with a Thread.sleep(16) in > there? > > > > > > On Jan 27, 3:01 pm, Mario Zechner <[email protected]> wrote: > > > > > @Ralf > > > > > > > that doesn't look suspicious at all. I guess we'll have to wait for > > > > > Robert to chim in. > > > > > > > On Jan 27, 7:45 pm, Mario Zechner <[email protected]> wrote: > > > > > > > > Nice, there goes another myth. I read about recycling the > MotionEvent > > > > > > at a couple of places on the net. Thanks for clearing that up! > > > > > > > > I wonder however why it is exposed as a public method. > Additionally, > > > > > > the semantics of onTouch allow me to return a boolean indicating > that > > > > > > i consumed the event (or not). So my reasoning was that in case i > > > > > > return true from onTouch and recycle the event, everything should > work > > > > > > out fine. Maybe add to the documentation that it should never > ever be > > > > > > called by an application? > > > > > > > > Anyways, thanks again! > > > > > > (if you have the time, seeing as you are obviously responsible > for > > > > > > this part of the framework, could you have a look at the other > > > > > > discussion on multi-touch over herehttp:// > > > > groups.google.com/group/android-developers/browse_thread/threa... > > > > > > :) > > > > > > > > On Jan 27, 7:17 pm, Dianne Hackborn <[email protected]> wrote: > > > > > > > > > On Tue, Jan 26, 2010 at 4:20 PM, Mario Zechner < > > > > [email protected]>wrote: > > > > > > > > > > That being said, there shouldn't be any problems with touch > events > > > > on > > > > > > > > devices running android >= 2.0 as they fixed the event flood > > > > problem > > > > > > > > in that version. I couldn't see any problem in my projects > that > > > > make > > > > > > > > heavy use of the touch screen on my droid. There seems to be > a > > > > small > > > > > > > > memory leak in the onTouch method if you don't call > event.recycle > > > > > > > > before exiting the onTouch method. > > > > > > > > > Oh my ghod... are you saying you are calling recycle() on the > > > > MotionEvent > > > > > > > that is -given- to you in onMotionEvent()? Please please > please do > > > > not do > > > > > > > that, you do not own the event, and you are going to cause > nasty > > > > problems if > > > > > > > you recycle it from the caller that does own it. > > > > > > > > > -- > > > > > > > Dianne Hackborn > > > > > > > Android framework engineer > > > > > > > [email protected] > > > > > > > > > Note: please don't send private questions to me, as I don't > have time > > > > to > > > > > > > provide private support, and so won't reply to such e-mails. > All > > > > such > > > > > > > questions should be posted on public forums, where I and others > can > > > > see and > > > > > > > answer them. > > > > > > -- > > > > You received this message because you are subscribed to the Google > > > > Groups "Android Developers" group. > > > > To post to this group, send email to > [email protected] > > > > To unsubscribe from this group, send email to > > > > [email protected]<android-developers%[email protected]> > <android-developers%[email protected]<android-developers%[email protected]> > > > > > > For more options, visit this group at > > > >http://groups.google.com/group/android-developers?hl=en > > > > > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected]<android-developers%[email protected]> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

