• Your Sensor Listener should implement the onSensorChanged
method, which will be performed when acceleration in any direction
is measured.
• The onSensorChanged method receives a SensorEvent that includes a
float array containing the acceleration measured along all three axes.
When a device is held in its natural orientation, the first element
represents lateral acceleration; the second element represents
longitudinal acceleration; and the final element represents vertical
acceleration, as shown in the following extension to Example 5: