@Override
    public void onAction(String string, boolean pressed, float tpf) {
       if (string.equalsIgnoreCase("MouseClick") && pressed) {
            // Calibrate the axis (set new zero position) if the axis
            // is a sensor joystick axis
            for (IntMap.Entry<Joystick> entry : joystickMap) {
                for (JoystickAxis axis : entry.getValue().getAxes()) {
                    if (axis instanceof SensorJoystickAxis) {
                        logger.log(Level.INFO, "Calibrating Axis: {0}", axis.toString());
                        ((SensorJoystickAxis) axis).calibrateCenter();
                    }
                }
            }

            if (enableRumble) {
                // manipulate joystick rumble
                for (IntMap.Entry<Joystick> entry : joystickMap) {
                    rumbleAmount += 0.1f;
                    if (rumbleAmount > 1f + FastMath.ZERO_TOLERANCE) {
                        rumbleAmount = 0f;
                    }
                    logger.log(Level.INFO, "rumbling with amount: {0}", rumbleAmount);
                    entry.getValue().rumble(rumbleAmount);
                }
            }
        }
    }
Example Test Case to test using Android sensors as Joystick axes.  Make sure to enable Joystick Events from
the test chooser menus.  Rotating the device will cause the block to rotate.  Tapping the screen will cause the
sensors to be calibrated (reset to zero) at the current orientation.  Continuously tapping the screen causes
the "rumble" to intensify until it reaches the maximum amount and then it shuts off.

@author iwgeric
jme3-android-examples/src/main/java/jme3test/android/TestAndroidSensors.java