Example code for accelerometer on Android devices