Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have written this code to count the number of steps implementing the SensorListener class. But the problem is that onSensorChanged method is called after certain number of steps. It seems that it has to verify that these calls are as a result of walking and not phone shake. But I need to skip this delay and start counting steps as soon as the user starts walking. How can I achieve this? Any help would be much appreciated.

What I have tried:

I tried adjusting the delay parameter of SensorManager's registerListener method but that doesn't work. It makes sense as that is for the frequency of sensor readings while my problem is the initial delay.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900