G01B3/16

Electronic device having an electronic compass adapted to detect when the device is in a holster

According to one aspect, a portable electronic device sized and shaped to be received within a holster having a magnetic element. The portable electronic device includes an electronic compass adapted to measure a magnetic field of the magnetic element in at least two axes. When the measured pattern corresponds to a first pattern, the portable electronic device is adapted to determine that the portable electronic device is in the holster.