安卓的传感器非常适合在设备感应运动? [英] Android : Which sensor is perfect for sensing motion in a device?

查看:116
本文介绍了安卓的传感器非常适合在设备感应运动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,其检测设备的运动,如果设备被移动提高报警。目前我使用加速度计。但我不能微调它。即使是很小的运动导致报警提高。

I have an App which senses motion of a Device and raise alarm if device is moved. Currently i'm using Accelerometer. But i couldn't fine tune it. Even a small movement causes the alarm to raise.

所以我的问题是传感器将适合大多数的任务是什么?什么其他的变通有哪些?

So my question is which Sensor will suit most for the task ? And what other work arounds are available ?

请帮家伙..

对不起,跛脚的问题,我想我能得到别人的发展经验一些答案在这个同样的问题,

Sorry for the lame question, I thought i could get some answers about development experiences of others in this same issue,

总之,这里就是我所做的,

Anyway, here's what i did,

我用这个回答这个code

想这个问题是与传感器数据的筛选,我的方法很简单就是彩车转换为整数,这样小数部分将被截断..但它没有工作..
但在链接code以上一些细微的变化更好地工作。

Guess the problem was with the filtering of the sensor data, my method was simply to convert the floats to ints so that decimal part would be truncated.. but it didn't work.. but the code in the link above worked better with some minor changes..

感谢您的建议。

推荐答案

只需使用陀螺仪。
如果有人移动设备,他们一定会略微倾斜。

Just use the gyroscope. If anyone moves the device they will be sure to tilt it slightly.

检查陀螺任何戏剧性的变化。

Check the gyro for any dramatic changes.

http://developer.android.com/guide/topics/sensors/sensors_motion.html#sensors-motion-gyro

这篇关于安卓的传感器非常适合在设备感应运动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆