implement accelerometer using phonegap