Home > Devices > Fire Phone

Understanding the MotionGesture API

Motion Gestures

Fire phone recognizes three types of gestures, peek, continuous peek, and tilt. Peek is a state in which the user’s head is out of the center range relative to the phone screen. This can be the result of a movement of the user’s head or a result of turning the device to one side. Continuous peek represents the user's head in any state from fully centered to full peek position and gives percentage information for positions in between. Tilt is always a movement of the device itself, and it is a movement of one edge of the device away from the user and back again. This gesture must have both parts, the movement away and the movement back. The device also recognizes the direction of these gestures and their rotation (or angle) relative to the device.

The MotionGesture API makes this data available to games and other apps, as a gesture event (a GestureEvent object). To receive these events, your app must register as a listener through a GestureManager object. Your app can register for all gesture events, for just one type of gesture, or for gestures in particular directions.

When an app receives a gesture event, it can extract the event data from the fields of the GestureEvent object and respond accordingly.