Can't understand Android sample in documentation
<p>I'm trying to understand the documentation from Android for Sensor.TYPE_ACCELEROMETER:
It gives this example:</p>

<p>It should be apparent that in order to measure the real acceleration of the device, the contribution of the force of gravity must be eliminated. This can be achieved by applying a high-pass filter. Conversely, a low-pass filter can be used to isolate the force of gravity.</p>

<pre><code>public void onSensorChanged(SensorEvent event)
{
      // alpha is calculated as t / (t + dT)
      // with t, the low-pass filter's time-constant
      // and dT, the event delivery rate

      final float alpha = 0.8;

      gravity[0] = alpha * gravity[0] + (1 - alpha) * event.values[0];
      gravity[1] = alpha * gravity[1] + (1 - alpha) * event.values[1];
      gravity[2] = alpha * gravity[2] + (1 - alpha) * event.values[2];

      linear_acceleration[0] = event.values[0] - gravity[0];
      linear_acceleration[1] = event.values[1] - gravity[1];
      linear_acceleration[2] = event.values[2] - gravity[2];
 }

But it says:
    All values are in SI units (m/s^2)
    values[0]: Acceleration **minus Gx** on the x-axis
    values[1]: Acceleration **minus Gy** on the y-axis
    values[2]: Acceleration **minus Gz** on the z-axis
</code></pre>

<p>So, should I remove the gravity from the values retrieved from accelerometer sensor or the gravity is already removed.</p>

<p>I mean, the example uses something called gravity[2] and uses the accelerometer, but then when I read the documentation it says that the values returned by the accelerometer already have the gravity substructed. That is what I don't understand.</p>

<p>And I assume gravity[] are the values from the gravity sensor, right?
BTW, Any place where I can get detailed of how the two new sensors work? TYPE_LINEARACCELERATION and TYPE_ROTATIONVECTOR</p>

<p>Thanks in advance. Guillermo.</p>
