How to create a simple pedometer-like app ?

I actually wonder if it’s possible (and probably easier) to count steps if a person is walking in place.