I would like to know whether it is possible to write code that would let you know whether the user is walking or not (with their iphone tucked in their pocket) and towards which direction they are walking.
More specifically :
- I'm not interested in calculating distance travelled
- I'm not interested in counting steps, etc.
What I'm interested in is detecting movement and immobility, distinguishing between the two, and also distinguishing between forward and backward movement.
I know that with the use of the compass in iPhone 4S one can detect orientation, but what about backward movement?
Let's say I start walking, then I stop and then I start walking backwards ( without taking a 360 degree turn..)
Do you think it's possible to manipulate data coming from accelerometer/gyroscope/compass in such a way as to be able to trigger events in my code accordingly?
To give you a more concrete example :
Imagine I want my iPhone(in my pocket) to start playing music as soon as (how fast could the response be really?) I start walking and then stop as soon as I stop walking. And then play a video as soon as I start walking backwards (without turning 360).