简体   繁体   中英

How to create gesture programmatically in android?

I am a beginner in android.I want to know, how to create gesture programmatically?.That means, i dont need any pre built gesture file created by "gesture builder" app.But i want to create gestures by using only codings not by "gesture builder" app.For example, i want to create an alphapet "A" only by coding.And when the user draw on the gesture overview it want to display the Result "A".Is it possible? Can anyone give any idea?

Android supports the Gesture API since version 1.6. The API can be located in the package android.gesture , and lets you store, load, draw and recognize gestures. The below tutorial will show you a proof-of-concept application how you can make use of Gesture API.

Check out the Create Gesture Programmatically in Android

I wrote a blog post about this the other week, here .

To summarize, you're going to need to look into overriding the onTouchEvent that's provided by every Activity class.

This answer here could also point you in the right direction.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM