how to calculate distance while walking in android? -


i developing demo app, in there 2 buttons named "start" , "stop". when user taps on "start" start walking. want make when users tap "stop" demo calculate distance between "start" , "stop". if user pressed "start" , pressed "stop" without taking single step, must show 0km or 0m. don't have idea how should start this; please make suggestion.

one way go using accelerometer data. app should continuously record accelerometer data after user presses start button. observe peak in data whenever user takes step. apply filter on data, , shall able detect number of steps taken reasonable accuracy. multiply step length , should approximation of distance travelled. take height of user input argument. step length around 0.45*height of person. since approach independent of gps, work indoors. edit: you'll need use accelerometer values 3 axes make independent of device orientation.you can go x^2 + y^2 + z^2


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -