views:

139

answers:

2

can it be determined that where a person is i.e is he walking ? is he in elevator ? or is he climbing up the stairs ?

using android's accelerometer or is there any other way to calculate such in android ?

+2  A: 

You can use a combination of the accelerometer and the digital compass, in phones that have them, to determine a speed and direction as mentioned in this post.

If all you need to do is determine if the person is walking, all you need is the accelerometer. Just process its output for foot steps.

There are plenty of tutorials on the web for detecting foot steps with an accelerometer.

There an app note here: http://www.analog.com/library/analogDialogue/archives/41-03/pedometer.html that gives a decent mathematical background and an example algorithm. Its of course up to you to extract the math and rewrite it for Android (the example code is written in C). I don't currently know of an open source android library with a footstep detection algorithm.

If you implement something, I would like to get the code, don't forget to post back the results.

Pentium10
A: 

thanks for the answer , but can we calculate the height etc.. i.e if a user is in elevator or taking stairs ?

Zeeshan
I doubt you can do this accurately. You'd have to take into account a lot of variables, and the inaccuracies will start to stack up. You'd have to determine that the device moved at X acceleration for Y time, yet take into account all the little jiggles of the device.
Cylindric