The only thing that this application needs to do is to record the
i)Raw Accelerometer Data
ii)Raw Gyro Data
iii)GPS Data
of the iPhone 4 to the log files so that I can later post-process them in my desktop computer.
The pseudocode of the program is attached.