[FREE] Pedometer Sensor (not accelerometer)

First excuse me, my English is not my native language, I use the google translator.

This is my first extension, it is a pedometer that uses the device's step sensor (not the accelerometer) Sensor.TYPE_STEP_COUNTER

Not all devices have it, so there is a Boolean block that will tell us if the sensor exists in the device.


The sensor counts all the steps since the device is turned on and we start the sensor, if we restart the device the sensor will start with a value of 0

What the Start and Stop blocks do is start or stop the Listener to listen to the sensor and obtain the steps.



If the Listener is on, an event will occur that will return the steps performed so far (WalkStep)


In order not to lose data from the steps performed when the device is restarted in the .aia file, there is a procedure that solves this problem.

The pedometer works very well and the battery consumption is low, if you do not kill the application through the block closeapp or with the device's task cleaner, the pedometer continues counting steps even if it is asleep.

If you use the stop block it will also stop counting steps


SensorPedometer.aia (99.9 KB)

com.mariosoft.SensorPedometer.aix (8.4 KB)


Very well presented intro to your Extension Mario. English is fine. I'm sure a number of people will have a use for this Extension.

1 Like

What improvements does this extension bring to the built-in component of appinventor?

1 Like

The Pedometer component of AppInventor, uses the accelerometer to count steps (through software programming), this extension does not use the accelerometer but the hardware sensor that many Sensor.TYPE_STEP_COUNTER devices carry, with less battery use and better reliability


Now everything is clear :). Good job.

1 Like

why is there a yellow warning triangle in all your screenshots?


He must have clicked on "Show Warnings".


Cool extension @Mario1. And your English is fine. Coming from a native English speaker who failed grammar class twice (but I passed all my other languages with A's :laughing: ), it is fine.

1 Like

I have activated "Show warnings" and the blocks are outside their container to be able to capture the block individually


pedometer reset button missing

1 Like

please add the reset block

1 Like

May someone explain me the difference between SingleStep and WalkStep please?

Thanks in advance

I just searched about the difference, but didn't find a clear answer. But since you haven't received a better reply yet, here's my guess:
It seems to me that "SingleStep" counts all the steps you do, while "WalkSteps" only counts them when the app assumes you are actually walking, for instance, doesn't count isolated steps. I tried moving casually around a fixed spot without going nowhere, and noticed that the "walk steps" didn't count all my steps.