ジェスチャーの例をインポートして自分のアプリを作成しました。レイアウトにはボタンとジェスチャーオーバーレイビューがあります。ボタンはGestureBuilderActivity.classを開始し、ジェスチャを追加または削除できます(これは例です)。ボタンの下にあるGestureOverlayViewでは、ジェスチャーを描画できます。レイアウト:ジェスチャーはを/ mnt /に保存されていること(例ではまだ)Android認識ジェスチャー
final String path = new File(Environment.getExternalStorageDirectory(),
"gestures").getAbsolutePath();
とトーストMSGショー:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Click to see gestures"
android:id="@+id/Button01"
/>
<android.gesture.GestureOverlayView
android:id="@+id/gestures"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1.0" />
</LinearLayout>
例から、私はジェスチャーを見つけるところ、これがあることを知っていますSDカード/ジェスチャー:
Toast.makeText(this, getString(R.string.save_success, path), Toast.LENGTH_LONG).show();
にはどうすればアプリはトーストMSGに私が描くジェスチャーを認識し、私にその名を表示することができますか?
あなたは、単一のストロークジェスチャ認識のための作業コードを持っているhttp://stackoverflow.com/questions/18165847/android-multi-stroke-gesture-not-working。あなたがしなければならないことはすべてあります。複数のストロークシンボルの場合と同じです。それは自分自身で苦労しています。 – LoveMeow