You can these two links which will be helpful
GestureOverlay
GestureOverlayView
Use this
public class YourClass extends Activity implements OnGesturePerformedListener {
private GestureLibrary mLibrary;
mLibrary = GestureLibraries.fromRawResource(this, R.raw.gestures);
if (!mLibrary.load()) {
finish();
}
GestureOverlayView gestures = (GestureOverlayView)findViewById(R.id.gestures);
gestures.addOnGesturePerformedListener(this);
public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture) {
ArrayList<Prediction> predictions = mLibrary.recognize(gesture);
Log.v("performed","performed");
// We want at least one prediction
if (predictions.size() > 0) {
Prediction prediction = predictions.get(0);
// We want at least some confidence in the result
if (prediction.score > 1.0) {
if(prediction.name.equalsIgnorecase("right")){
//do you thing here//
}