I am wondering how compass calibration works / why e.g. drawing an 8 or rotating the phone to all 3 axis works (or at least shall work) - I mean I would understand the calibration process, if an application would say me: Point to north, then press that button down there, but you can start at basically zero knowledge for the app, just by rotating your phone! How is that done? Also, do I need to enter a special calibration mode or can I draw these figures (like the 8) directly in Google Maps? How does Google Maps know that I am not just really moving the phone but want to calibrate the compass? Thanks for any hint!
Compass calibration works by detecting the magnetic field intensity of earth. But sometimes due to strong interference from other electronic devices like transformers compass sensor may get wrong idea about the magnetic poles of earth and can point in wrong direction. So to ensure that it asks users to recalibrate compass by rotating in figure 8 direction so that it can judge the magnetic intensity in all directions and then from that data it deduces the actual poles of earth.