Gesture recognition based on Android Development

Due to accuracy and other reasons, gesture recognition is not used much in Android, but it doesn't prevent us from playing this magical thing.

To use gestures in Android, you must first establish a gesture library. It is very simple to establish a gesture library. Create an Android sample project, build an Android sample project, and then select the created Android version. After that, you will see this interface:

Select gesturebuilder and install it on the real machine after it is created successfully. Then you can add gestures and name them.

After creating gesture, view the system file in the file explorer window of eclipse. One more gesture file will appear in the sdcard folder. Export this file to the desktop first. Then create a new project called gesture, create a new raw folder under the res folder, and then copy the gesture file just now, so that we have a gesture library for this project. Let's see how to use this gesture library.

First look at the layout file:

There is a control about gestureoverlayview in the layout file. The Android: gesturestroketype property has two values, one is multiple and the other is single. Multiple means that multiple strokes are supported and single means that single strokes are supported.

Java code:

Key code has been commented. It's so simple. Due to the problem of recognition rate, gesture recognition is not used much at present.

Original link: http://blog.csdn.net/u012702547/article/details/45727729

Source code download: gesture recognition developed by Android

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>