Pedometer is a native extension for iOS to fetch pedestrian-related data. The extension requires a device able to collect and provide pedestrian data, which is available in the iPhone 5s and up. Using the extension a developer can query pedometer data between a start and end-date, as well as use events to monitor any data change: a basic event is fired when pedometer data is available within the specified range. The event has the total number of steps, the total distance in meters and the number of floors ascended and descended.

It is also possible to start and stop the pedometer with live updates about the number of steps, the distance and the number of floors ascended and descended. The extension comes with an example showing all the functionalities and future updates are free of charge.

Sample

public function PedometerExample() {
	var _pd:pedometerane = new pedometerane()
	_pd.addEventListener(StatusEvent.STATUS, onStatusEvent);
	
	_pd.getdata("01/01/1900 00:00:00", dateToMMDDYYYY(new Date()));
	_pd.startpedometer();
}

private function onStatusEvent(event:StatusEvent):void {
	trace(event);
	
	if(event.level == 'pedometerstartdate') {
		trace('Pedometer start date for query: ' + event.code);
	}
	if(event.level == 'pedometerstopdate') {
		trace('Pedometer stop date for query: ' + event.code+'\n');
	}
	if(event.level == 'pedometersteps') {
		trace('Total number of steps between dates: '+event.code+'\n');
	}
	else if(event.level == 'pedometerdistance'){
		trace('Total distance between dates: '+event.code+' m'+'\n');
	}
	else if(event.level == 'pedometerstepslive'){
		_livesteps = _livesteps + int(event.code);
		trace('Livesteps: '+_livesteps);
	}
}
Air Native Extension, iOS . URL.