A sample code taken from phonegap, to test the accelerometer part, working on this