Android- How to determine the current speed based on acceleration changes
I have to 开发者_JAVA百科find current speed using Accelerometer in android. Is it possible? if yes give the examples.
thanks
It will be too inaccurate, but yeah, it is possible. By using a result of all the 3 forces of the 3 axes you can calculate the total acceleration per frame. Then by using the difference per frame you can calculate how much the user has accelerated.
Getting the result of all the 3 forces: sqrt(x*x+y*y+z*z);
You are better of using the GPS for determining speed.
精彩评论