I search a way to detect the movement of the phone regardless how the user holds the phone.
Some examples:
- I am interested in the vertical movement (like the user pulls the phone up) 'ignoring' if the phone lays on the table or held in the hand (maybe upside-down).
- Also interested in the horizontal movement (like the user pushes the phone away from the body) also 'ignoring' how the user helds the phone.
The background is that I want to recognize if the user pulls the phone out of the pocket (like pulls 30-40cm up and also some centimeters horizontal).
I think therefor I have to get a combination out of the userAcceleration and the attitude. But I did not find the correct maths..