In android, we have Sensor.TYPE_GRAVITY, Sensor.TYPE_ACCELEROMETER, Sensor.TYPE_LINEAR_ACCELERATION.
And it is known from android developer forum that, "The output of the accelerometer, gravity and linear-acceleration sensors must obey the following relation: acceleration = gravity + linear-acceleration"
Do Sensor.TYPE_GRAVITY and Sensor.TYPE_LINEAR_ACCELERATION make use of the same sensor as Sensor.TYPE_ACCELEROMETER - i.e., the accelerometer? What is purpose of having 3 different constants if the value of one can be deduced using the other using low pass and high pass filters?
It's because TYPE_LINEAR_ACCELERATION and TYPE_GRAVITY are available since API Level 9 (Android 2.3). If you want to build an application in a lower API version, you will only have access to TYPE_ACCELEROMETER (since API Level 3). TYPE_LINEAR_ACCELERATION and TYPE_GRAVITY are really helpful and makes unnecessary to split TYPE_ACCELEROMETER. I deploy for Android 2.2 (API Level 8) and still don't know how to do it!
More info: http://developer.android.com/reference/android/hardware/Sensor.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With