Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The most basic form of gesture recognition is the touch event. Touch events are the lowest level of user interaction with the touchscreen. Events include putting a finger on the screen, sliding a finger along the screen, and lifting a finger off the screen. Each of these represents a discrete touch event. There are two ways you can listen for these events: by registering an OnTouchListener on a view and implementing the onTouchEvent method, or by implementing your own view and overriding its onTouchEvent method. These methods are called with a MotionEvent object containing information about the event.
Here is a simple example class that overrides View and implements the onTouchEvent method:
1. Create a class named TouchExample that extends View: