私はAndroidが初めてで、に取り組んでいGestures
ます。テキストの認識方法に問題があります。ユーザーが認識して画面の上部に印刷する必要がある文字または数字を描画する場合。私はそれができることを知りましたが、それGestureOverlayView
を実装する方法がわかりません。
誰かサンプルコードを教えてください。
私はAndroidが初めてで、に取り組んでいGestures
ます。テキストの認識方法に問題があります。ユーザーが認識して画面の上部に印刷する必要がある文字または数字を描画する場合。私はそれができることを知りましたが、それGestureOverlayView
を実装する方法がわかりません。
誰かサンプルコードを教えてください。
役立つこれら2つのリンクを使用できます
これを使って
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//
}