There is a magnetic field sensor inside iPads and iPhones (and I think about every other vendor's tablet computers and smart phones) that has been used by about a million different apps to point to magnetic north. Some also have the current declination values, so given the tablet's GPS location they can immediately point to true north, too. As far as I can tell with my iPad 2 and iPhone 4 compass apps, they are probably accurate within 1 degree. Or at least more accurate than you can read the compass in most airplanes.
Yeah but you know better than most that those Apps are using a combination of the mag field detector, accelerometers, and GPS combined (including Assisted GPS from the cell network on gadgets so-equipped) to give a composite direction.
AFAIK, Apple (for one) doesn't expose the raw unfiltered magnetic data to even developers, and for good reason. The devices inside the gadget are constantly "bothered" by the environment around them.
The raw unfiltered data would look like dog poo inside a typical GA cockpit full of electronics, and even outdoors would swing wildly in response to various things, just like a real mag compass.
Just hold your iPhone up near your mag compass in the airplane and watch it freak out. Same crap happens to the iPhone from other E/M sources.
Analog to digital is and always will be, hard. My thermometer in the bedroom says it's 59.4F in here. Of course the low battery light has also illuminated since last night. Voltage sensitive, much?
The composite data when walking outdoors away from other stuff, is great. But mag compasses are mag compasses (including mag field sensors) and suffer various problems (which are different for the mechanical and electronic varieties but still just as messy).