- Home /
Get device moving direction like Left to Right and Top to Bottom.
Hello All,
I want to get Android device movement like whether my device move from left to right or it's moves top to bottom. For example my android device is on the table and if i moved my device from left to right or top to bottom then i want that direction.
I have checked the accelerometer and Gyroscope but it's not working in my case.
So can anybody provide me hint so some reference to solve my problem ?
Thanks
Yashesh
Well, the accelerometer and gyroscope are used for exactly that. If they're not working in your case, it's either because your phone doesn't have those features, or you're using them incorrectly. Without knowing the phone or code you're using, it's impossible to say which.
@tansihimi Thanks for your reply.
I have created one demo to retrieve Accelerometer and Gyroscope. I have display it's value on UI so that i can see that.
All the values are updating perfectly so there is no change that my device is not support Accelerometer and Gyroscope.
Now, I have continuously see the update value from the gyro and accelerometer but non of the value is updating as per the my requirements.
$$anonymous$$ay be there will be some calculation from Gyro and Accelerometer to get desire output but unfortunately I am not aware of it. So if possible for you to give me some more info on this then it will be good.
Waiting for you positive reply.
If you're just not understanding what the values mean, I suggest you read: http://developer.android.com/guide/topics/sensors/sensors_motion.html
Your answer
Follow this Question
Related Questions
2D Vector Movement,Vectorel Movement with Buttons 2 Answers
Character Movement Problem 0 Answers
htc hero and unity3D android 3 Answers