If you look at the sample code in the Google documents you'll see that
motion events have history.  You'll need to use it to get a smooth
trace
-Blake
Programming Android, FTW

On Sep 18, 5:20 am, "[email protected]" <[email protected]> wrote:
> I want to let a user smoothly draw elements with his finger and avoid
> any lags as follows:
>
> public boolean onTouchEvent(MotionEvent event) {
>                         float x = event.getX();
>                         float y = event.getY();
>
>                         switch (event.getAction()) {
>                         case MotionEvent.ACTION_DOWN:
>                                 mCanvas.drawBitmap(primitive, x, y, mPaint);
>
>                                 invalidate();
>                                 break;
>                         case MotionEvent.ACTION_MOVE:
>                                 mCanvas.drawBitmap(primitive, x, y, mPaint);
>
>                                 invalidate();
>                                 break;
>                         case MotionEvent.ACTION_UP:
>                                 mCanvas.drawBitmap(primitive, x, y, mPaint);
>
>                                 invalidate();
>                                 break;
>                         }
>                         return true;
>                 }
>         }
>
> Using android SDK I find onTouchEvent is not called for every motion
> event. This results in drawing of a bitmap only at the points when the
> motion event is detected.
>
> I can do this very easily using iPhone SDK . Can anyone confirm if
> this is a limitation in Android or if there is a way we can increase
> the rate of motion events?

-- 
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

Reply via email to