• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Detect Movements on Android Device

user12

Lurker
Is it possible to detect whether the android device has moved in a certain direction and how much it has moved? For example, if I move my device 100 pixels to the left, a number would be displayed saying x is -100 pixels. If this is possible, which sensor would I use?
 
You could use the accelerometer i suppose as with any movement, there will be some sort of acceleration and deceleration.
 
Could you please provide an example? I don't know how to use the acceleration to determine the distance the device moved. Thanks.
 
I honestly don't have much experience with the Accelerometer APIs, so I would be learning just as you would be.
 
Back
Top Bottom