简体   繁体   English

用于检测设备移动的传感器

[英]Sensor for detect moving with device

Hi I make app in which I use camera and I need to detect in which side is phone moving (left,rigth,up or down) all sensor I have tried just return moving around axis. 嗨,我制作了一个使用相机的应用程序,我需要检测手机在哪一侧移动(向左,向右,向上或向下),我尝试过的所有传感器只是绕轴移动。

So If I have camera and I will move phone to right/left/up/down how to detect it? 因此,如果我有摄像头,并且将手机向右/向左/向上/向下移动,如何检测到它?

You can you the linear accelerometer to detect which direction the user is moving. 您可以使用线性加速度计来检测用户向哪个方向移动。 This page has all the details you will need. 此页面包含您需要的所有详细信息。 There a few sample projects you can have a look at as well. 您还可以查看一些示例项目。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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