i am creating an augmented reality app that simply visualices a textview when the phone is facing a Point of Interest (wich gps position is stored on the phone). The textview is
I solved it with a simple trick. This will delay your results a bit but they surly avoid the inaccuracy of the compass and accelerometer.
Create a history of the last N
values (so save the value to an array, increment index, when you reach N
start with zero again). Then you simply use the arithmetic average of the stored values.