The $3 Gesture Recognize is a simple but robust gesture recognition system for input devices featuring 3D acceleration sensors. The algorithm is designed to be implemented quickly in prototyping environments, is intended to be device-independent and does not require any special toolkits or frameworks. It relies solely on simple trigonometric and geometric calculations.
For more information, see the paper:
http://doi.acm.org/10.1145/1719970.1720026
Or, to get a quick overview of how the algorithm works, see the poster:
http://three-dollar-gesture-recognizer.googlecode.com/files/3dollarPoster-%20googleCode.pdf
The Android and iPhone Code that was used in the research project is released for general use under the MIT license.
The code ist still experimental and can contain bugs or crash, so use it at your own risk. You are invited to contribute fixes.