1

Is there a way in Android Studio to calibrate the sensors of a mobile phone programmatically ?

So i have been building an AR Application that makes use of magnetic compass to get user orientation (getOrientation() of Android Sensor Manager). While testing it, i realized that on 80% of devices it is working GREAT but on some devices i am getting a major deflection from expected user orientation value. I have found articles about the user making a figure 8 with their device to recalibrate the compass and this works. Is there a way to reset the compass programmatically?

  • No, but see: [In Android can I programmatically detect that the compass is not yet calibrated?](https://stackoverflow.com/q/7099568/295004) to know when to inform the user of a physical recalibrate. – Morrison Chang Mar 30 '22 at 07:42

0 Answers0