I'm working on an android application which can calculate device's movement in 6 direction. I think I can use acceleration as;
"x=a.t^2" but a is not a constant. And this is the problem. How can I calculate the total movement??
The accelerometer gives you three directions (x, y, z). They are acceleration measurements which is harder to know what the position of the device is. But, remember acceleration is related to position through integration:
a(t) = a[x]
v(t) = a[x]t + c
x(t) = a[x]t ^ 2 + ct + d
Problem is you can't know c or d because as you take the derivative the constants drop out. So there is some amount you can't get right with c and d missing. You can attempt to compensate by remembering the values you used last for those. So after grabbing 3 samples you can start to calculate position from that.
There is a significant amount of information about how to interpret the data from the sensors. Like figuring out where gravity is for orientation, and subtracting out gravity to get linear acceleration.
http://developer.android.com/reference/android/hardware/SensorEvent.html
Here is a way to come up with position using an accelerometer along with an algorithm for finding position in detail:
http://www.freescale.com/files/sensors/doc/app_note/AN3397.pdf