Let me give an example of a different kind of app.. I have already read the main thread where this touchscreen consuming CPU issue is discussed... Now I have a game which is completely single threaded.. for rendering I use a timer and use handler.post and call invalidate/ postInvalidate of a View with a resolution of 30 fps.
Now using my touch screen events, I implement a kind of pick, drag and drop of my game elements. In the touch event handler I just change the x,y positions of the elements. I feel as the touch happens too many times when I click and drag, It is reducing the time given to the drawing.. As someone said, the system processes events as soon as it receives it.. So when too many touch events are received, the time is consumed mostly by that.. I have to avoid only some intermediate MOVE EVENTS, and how do I do that is the question. On Apr 13, 10:11 pm, Dianne Hackborn <[email protected]> wrote: > In general, you shouldn't be starting an activity at all passed on > movements. Probably not on downs either. Only on ups. And at that point, > if you want to abort the operation based on movement, just look at how far > the up event x and y is away from the original down event. > > > > On Mon, Apr 13, 2009 at 5:04 AM, quakeboy <[email protected]> wrote: > > > can u give some sample code, technical details about that touch > > thresholding, I have been trying to implement and I am missing > > important events > > > On Apr 13, 7:07 am, Ralf <[email protected]> wrote: > > > On Sun, Apr 12, 2009 at 6:28 PM, Todd Sjolander <[email protected]> > > wrote: > > > > > Marco, your hunch was right. I was somehow creating multiple copies > > > > of Activity C. In case anyone can benefit from this, let me explain > > > > how it went wrong. > > > > > I implemented onTouch() in Activity B, which would create an Intent > > > > for Activity C, and then call startActivity(). For some reason, > > > > onTouch() would get called multiple times with each touch, launching a > > > > new Activity C each time. > > > > Ah indeed. Remember that touch on the emulator, via the mouse, is a > > > very precise operation -- you click one pixel, once. On a real device > > > your finger generates lots of input events due to the imprecision of > > > the point being touched, pressure, etc. If you real on a precise > > > touch, you might want to implement a threshold in your touch listener > > > to filter out noise. > > > > R/ > > > > > Jon, I've seen some oddities from that myself, although I can't really > > > > make sense of it. But it's helpful to keep that in mind. > > > > > Thanks! > > -- > 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] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

