Android 1.6 platform introduces entirely new gestures framework that finally lets developers build gestures into their apps using the new GestureBuilder tool included in the SDK. Gestures framework provides application developers with a framework for creating, storing, loading, and recognizing gestures and associating them with specific actions.

Need of Gestures:
Touch screens are a great way to interact with applications on mobile devices. With a touch screen, users can easily tap, drag, fling, or slide to quickly perform actions in their favorite applications. But it’s not always that easy for developers. With Android, it’s easy to recognize simple actions, like a swipe, but it’s much more difficult to handle complicated gestures, which also require developers to write a lot of code. In such a situation we can use gestures.This API, located in the new package android.gesture.

We decided to try it out and see how it works. For sample we made a list and used the ‘drag to dustbin’ gesture to delete individual list items.

Step 1: Creating / defining our own gestures using GestureBuilder

GestureBuilder

Step 2: Copy the gesture file created by GestureBuilder from SD card and put it into ‘res/raw’ folder of your project.

Step 3: Write code to handle the event generated by your gesture

step1.png

step2.png