开发者

Android- How to determine the current speed based on acceleration changes

开发者 https://www.devze.com 2023-03-02 19:11 出处:网络
I have to 开发者_JAVA百科find current speed using Accelerometer in android. Is it possible? if yes give the examples.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消