The shake gesture is defined by moving the device in alternating directions with rapid, jerky movements in any direction. (i.e. up and down, back and forth, or left and right).
Forward shakes are detected when the device is moved along the axis perpendicular to the screen. This is the z-axis of the accelerometer.
Side shakes are detected when the device is moved in the plane parallel with the screen. This plane is defined by the x and y axes of the accelerometer.