Android supports the Gesture API since version 1.6. The API can be located in the package android.gesture, and lets you store, load, draw and recognize gestures. The below tutorial will show you a proof-of-concept application how you can make use of Gesture API.
Here you have the source code of Gesture Builder
Gesture builder is installed in the emulator , but you can download it from here
And gesture source code examples here
Check out the Create Gesture Programmatically in Android