Okay so I'm not the most athletic person in the world, but one thing that does get me out of the house is tracking how far I've been running. Watching the km's tick over!
But I'm sick of iTunes and having to log into nike online all the time. So I got bored this weekend and the result is the start of a new little as3 interface using the content from my Nike+ device. Initially this library just processes files that nike+ stores on the device, but would eventually like it to access the online service as well.
NikePlus class represents the base of the Nike+ interface. With this interface you can load a series of workouts from their xml files and use the data stored therein for other applications.
The workouts are stored as xml files on the devices at a location similar to the below, (you may have to enable filesystem access in itunes to be able to see this):
Underneath this directory the data is setup as follows:
- latest/*.xml - A series of xml workout files that haven't been synced
- synched/*.xml - A series of xml workout files that have been synced
- lastWorkout.xml - The last xml workout file
- preferences.xml - Nike+ preferences xml file
You can get the library here:
svn co http://svn.labs.distriqt.com/public/trunk/nikeplus/trunk
Usage of the library is relatively simple at this stage:
- var _nikeplus:NikePlus = new NikePlus();
- _nikeplus.addEventListener( NikePlus.LOADED, nikeplus_loadedHandler );
- _nikeplus.loadWorkout( _workout_xml_location );
Then once loaded:
- function nikeplus_loadedHandler( _event:Event ):void
- for each (var _workout:NikeWorkout in _nikeplus.workouts)
- trace( _workout.summary.calories );
- trace( "Data Interval: "+_workout.intervalValue );
- for (var i:int = 0; i < _workout.data.length; i++)
- trace( "Data Point["+i+"] "+_workout.data[i] );
Started building a simple little AIR application to eventually replace iTunes and Nike online. I'll post more when I have a working version.