2017년 4월 19일 수요일

Does the Pedometer component require the device to have an accelerometer?


I am planning on making an app which incorporates the "Pedometer" component. After reading through some docs, I found out that the pedometer component is based on the accelerometer component. For the accelerometer component, there is a block to detect whether the sensor is available on the device, but this block isn't present on the pedometer.

My question is whether the pedometer requires the device to have an accelerometer for it to work?

--
Yes, the device must have an accelerometer to use  with the Pedometer component.

The Pedometer documentation (  http://ai2.appinventor.mit.edu/reference/components/sensors.html#Pedometer  )   indicates A Component that acts like a Pedometer. It senses motion via the Accerleromter and attempts to determine if a step has been taken. Using a configurable stride length, it can estimate the distance traveled as well. 

-- 
Thanks! So I should use the 'Accelerometer.Available' block to check whether the user can use the pedometer in my app then.

I'm assuming that you don't actually have to drag the accelerometer into the app for the pedometer to actually work though?

--
Totally correct.  Just place the accellerator component on your designer screen and use its block to determine if the hardware is present.   You should 
not need the accelerometer on the screen... there is nothing to display with the accelerometer component..it is not like a button or a Canvas.Using the Pedometer should be sufficient other than 
needing an accelerometer block to check to see if the Accelerometer is present on the device.

Good luck.  Let us know how your project works.

-- 
I will definitely let you know how my app works out. It'll probably be a few more months though, I'm still planning and designing at the moment.

--
refer to: search for pedometer and accelerometer

댓글 없음:

댓글 쓰기