简体   繁体   中英

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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