======================[ Readings ]====================== https://developer.android.com/guide/topics/sensors/sensors_overview.html In-class examples: examples/Proximity/ examples/Compass/ Proximity and orientation sensors are explained in: https://developer.android.com/guide/topics/sensors/sensors_position.html Android engineer blog explaining the new orientation API: https://android-developers.googleblog.com/2010/09/one-screen-turn-deserves-another.html New Android API based on fusing the accelerometer and Earth's magnetic field (a.k.a. magnetometer) sensors: https://developer.android.com/reference/android/hardware/SensorManager.html#getOrientation(float%5B%5D,%20float%5B%5D) https://developer.android.com/reference/android/hardware/SensorManager.html#getRotationMatrix(float%5B%5D,%20float%5B%5D,%20float%5B%5D,%20float%5B%5D) ===============[ Using raw accelerometer readings for a game ]=============== See https://github.com/masayukig/tiltmazes, GameEngine.java, https://github.com/masayukig/tiltmazes/blob/master/src/com/lecz/android/tiltmazes/GameEngine.java for the use of the raw accelerometer data. Lines 79--98 grab the accelerometer measurement to determine the direction of rolling the ball. The sensor object is acquired at lines 118--121. The ACCEL_THRESHOLD parameter (line 51 of GameEngine.java) is the key to the user experience. In the original game it's set to 2 to detect the natural tilting motion most users will use to tilt the screen to get the ball rolling. At 10, the ball gets really sticky; you'll need to forcefully tap the phone to get it rolling. At 20, you'd need to forcefully jerk the phone in the desired direction; smooth tilting will not do the trick. Try these settings to see what's comfortable for you. ===============[ Side notes ]=============== Fork bomb: https://askubuntu.com/questions/159491/why-did-the-command-make-my-system-lag-so-badly-i-had-to-reboot