How to implement pedometer functions in Android?

27 Views Asked by At

I need to implement pedometer-like functions in my Android app. I need step count, distance walked, and average walking speed. I could certainly compute average walking speed myself and I could live without the step count, but the distance walked is what I need the most.

I looked at SensorManager. It has the step count, but not the distance walked. I can't just use GPS for that since GPS will not give me the accuracy I need. In my app the user is walking for short bursts of a few minutes.

I looked into the Fitness API too. It appears to be able to do what I want. However, after spending several hours getting through all of its permission requirements, it simply doesn't work. I get callbacks, but they have no data points.

What's the recommended approach here?

0

There are 0 best solutions below