Originally Posted by Minjin
... people are saying that the gyroscope is the same as an accelerator but more accurate. This is dead wrong. They measure completely different things. The accelerometer measures acceleration and because we are in a gravity field, it can determine orientation. The gryroscope measures angular acceleration and can therefore determine rotation...
Minjin is mostly correct.
Accelerometers measure acceleration in x, y, and z. Those can be accelerations because you're moving the phone around or acceleration due to gravity. The only time that the accelerometer would register (0,0,0) would be if it were in free fall. If you're holding the phone motionless, or holding it fixed in position and just rotating it, the dominant acceleration will be the one supporting the phone in opposition to gravity; an UP vector. From this you can calculate an elevation angle, but not an azimuth (angle around the up vector). Having a compass (magnetometer) could give you azimuth approximately.
The gyros used in phones are not spinning wheels, but rather microelectrical mechanical systems (MEMS) rate gyros typically of a tuning fork design. They measure angular velocity (not angular acceleration) -- how fast it is being rotated about the x, y, or z axis. It does not measure position or change in position at all. You could be moving at high speed or accelerating, but if you were holding the phone at a fixed orientation, the rate gyros would register (0,0,0).
If all you want to do is detect shaking, an accelerometer will do, but if you want coarse absolute control over pointing in 3D (which way is up? which way is north?), add a compass, and if you want fine relative control over pointing (pitch down 1 degree, yaw right 1 degree), a rate gyro helps a lot.