Android accelerometer tilt compensation and linear acceleration using Cardan angles. Based on a magnetometer and accelerometer sensor fusion.