安卓的传感器非常适合在设备感应运动?

编程入门 行业动态 更新时间:2024-10-27 10:33:28
本文介绍了安卓的传感器非常适合在设备感应运动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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.

的developer.android/guide/topics/sensors/sensors_motion.html#sensors-motion-gyro

更多推荐

安卓的传感器非常适合在设备感应运动?

本文发布于:2023-11-24 05:47:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1624150.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:传感器   感应   适合   设备

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!