package tjuci.edu.dl;
//Download by http://www.codefans.net
import java.util.ArrayList;
import android.app.Activity;
import android.app.AlertDialog;
import android.gesture.Gesture;
import android.gesture.GestureLibraries;
import android.gesture.GestureLibrary;
import android.gesture.GestureOverlayView;
import android.gesture.GestureOverlayView.OnGesturePerformedListener;
import android.gesture.Prediction;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.Toast;
public class GestureRecogniseSampleActivity extends Activity {
GestureOverlayView gestureView;
GestureLibrary gestureLibrary;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
gestureView = new GestureOverlayView(this);
gestureLibrary = GestureLibraries.fromFile("/mnt/sdcard/mygestures");
if(gestureLibrary.load()){
Toast.makeText(GestureRecogniseSampleActivity.this, "装载成功", Toast.LENGTH_SHORT).show();
}else{
Toast.makeText(GestureRecogniseSampleActivity.this, "装载失败", Toast.LENGTH_SHORT).show();
}
gestureView.addOnGesturePerformedListener(new OnGesturePerformedListener() {
@Override
public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture) {
// TODO Auto-generated method stub
ArrayList<Prediction> prediction = gestureLibrary.recognize(gesture);
ArrayList<String> list = new ArrayList<String>();
for(Prediction p: prediction){
String showMsg = "与手势[" + p.name + "]相似度为:" + p.score;
list.add(showMsg);
}
if(list.size() > 0){
ArrayAdapter aa = new ArrayAdapter(GestureRecogniseSampleActivity.this, android.R.layout.simple_dropdown_item_1line, list.toArray());
new AlertDialog.Builder(GestureRecogniseSampleActivity.this).setAdapter(aa, null).setPositiveButton("确定", null).show();
}else{
Toast.makeText(GestureRecogniseSampleActivity.this, "没有找到匹配的手势", Toast.LENGTH_SHORT).show();
}
}
});
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
GestureRecognise.rar (27个子文件)
codefans.net
GestureRecogniseSample
.project 858B
bin
GestureRecogniseSample.apk 15KB
res
drawable-ldpi
ic_launcher.png 2KB
drawable-hdpi
ic_launcher.png 4KB
drawable-mdpi
ic_launcher.png 2KB
resources.ap_ 11KB
classes
tjuci
edu
dl
GestureRecogniseSampleActivity$1.class 3KB
R$string.class 409B
R$layout.class 404B
R$drawable.class 389B
R.class 489B
GestureRecogniseSampleActivity.class 2KB
R$attr.class 322B
R$id.class 403B
classes.dex 5KB
proguard.cfg 1KB
AndroidManifest.xml 747B
src
tjuci
edu
dl
GestureRecogniseSampleActivity.java 2KB
project.properties 361B
res
values
strings.xml 210B
layout
show.xml 434B
main.xml 616B
drawable-ldpi
ic_launcher.png 2KB
drawable-hdpi
ic_launcher.png 4KB
drawable-mdpi
ic_launcher.png 3KB
.classpath 364B
gen
tjuci
edu
dl
R.java 845B
assets
共 27 条
- 1
资源评论
- xulei1232582013-08-15很好,值得借鉴,非常感谢,内容易懂
- fr_han2013-08-23不错,下载学习一下,多谢
lxllb8
- 粉丝: 66
- 资源: 579
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 记录了贪心,动态规划等算法基本思想与设计.zip
- 基于菲阿里基本模型,以及MACD RSI BooL 等技术指标 构建一套基于贪心算法策略的智能投顾模型.zip
- oj算法代码-贪心算法.zip
- 基于yolov8行人检测源码+模型.zip
- 公开整理-地级市-绿色专利申请、授权数据集(2000-2022年).xlsx
- 基于Transformer模型的图像质量评分模型实现源码+详细说明文档.zip
- CST电磁场仿真+线性螺旋电感+建模步骤细节和RLC端口配置+CST高级建模操作
- 大数据库实验的报告材料材料(word文档良心出品).doc
- AIS2024 valid
- 最入门的爬虫代码 python.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功