Walking: counting steps when walking back and forth in a circle I am aware of the fact that Android devices can count the number of steps taken by a person as they walk. However, I am uncertain as to how they do this. Do they rely solely on GPS? If so, if someone keeps on walking in a circle so that their position does not change much and stays within a few meters, then is the device successful at reporting number of steps walked?
If not, what other data do they use and how do they carry out the computation at the device level and how does the computation work?
The step counter is usually not GPS based. Instead the accelerometer sensor of your phone is used. 

When walking for every step your body moves up and down a bit which can be easily measured by this sensor. Using the accelerometer instead of GPS has multiple advantages:


The accelerometer requires only very little battery
The accuracy is better - no need to define your step length
It works at location without GPS signal (indoor, staircase)