手势
1) 定义手势
导入GestureBuilder   (android sample project)
mnt/sdcard/gestures
2) 识别手势
a) 拷贝到res\raw\  
b) layout   新增GestureOverlayView,用来做布局
c) 加载手势库
final GestureLibrary library = GestureLibraries.fromRawResource(this, R.raw.gestures);
library.load();
d) 识别手势
GestureOverlayView overlayView = (GestureOverlayView) findViewById(R.id.gestureOverlayView1);
OnGesturePerformedListen er listener = new OnGesturePerformedListen er()
{
@Override
public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture)
{
ArrayList recognizeList = library.recognize(gesture);
Prediction prediction = recognizeList.get(0);
if (prediction.score >= 5)
{
if ("exit".equals(prediction.name))
{
finish();
}
else if ("open".equals(prediction.name))
{
checkBox.setChecked(true);
}
}
}
};
overlayView.addOnGesturePerformedLis tener(listener );