performance - Calculation User speed and distance using device accelerometer android -


hi developing small android application in wanted calculate user speed , distance covered user using device accelerometer. did take samples of acceleration in time frame 1 min. accelerometer got x y , z coordinates. took x coordinate values , take average of it. , calculating speed of user.

but not giving proper value. there way this? how give me approx value? did in following way:

// sum of no samples of acceleration points  sum_acc = sum_acc+event.values[0]; // avg of acc avg_acc = sum_acc/no_of_samples; // speed of user  speed = avg_acc*time_frame; // distance distance = speed*time; 

i need better , accurate result. need help. thank you.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -