When you are using compass application on a mobile terminal (such as a smartphone), have you ever seen the message such as "Interference from a magnetic field. Re-calibrate by waving the phone in a figure 8 motion"? This message is displayed when the phone moves into a magnetic field, and the electronic compass suffers interference from the field. When this occurs, the electronic compass can't detect the azimuth direction at a high accuracy without a re-calibration.
We don't need to manually re-calibrate, because the AKM electronic compass has an auto-calibration routine by software. Specifically, you can wave your cell phone in a figure 8 motion, as shown in the animation below. Enjoy!