Android中的手势识别

我是Android新手,我正在Gestures 。 我有一个关于如何识别文本的问题。 当用户画一个必须被识别的字母或数字,并且必须被打印在屏幕的顶部时。 我知道这可以通过GestureOverlayView完成,但不知道如何实现它。

任何人都可以请帮我一些示例代码。

Solutions Collecting From Web of "Android中的手势识别"

你可以这两个链接,这将是有益的

GestureOverlay

GestureOverlayView

用这个

 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// }