My open source library with limited sensor features is here: https://github.com/JacobSheehy/AllClearSensorLibrary for Android 'background' access to sensors (using foreground library). I don't think that I've got magnetic data there yet but it's mostly a matter of adding another field.
I've got this running live in an Android app if you want to check it out: https://play.google.com/store/apps/details?id=com.allclearwe... (US-only for now, sorry about that, international weather data is pricey)
I typically track hurricanes with obvious low-pressure curves but there's a lot more that can be done.
Crowdsourcing sensor data from phones:
Accelerometers can detect earthquakes, Microphones can detect noise pollution, Magnetometers can detect solar activity, Barometers can detect weather changes
Most phones have those sensors now, and I'm looking out for UV sensors, air quality sensors, and more. The applications of crowdsourcing sensor data are immense and constantly improving as new sensors get added.
--
The main issues honestly are privacy and noise filtering. Ensemble kalman filters running on device can reduce noise dramatically, and you can use anonymizing features like geographic bounding boxes (where sensors can go in and out and only their bounding box is used as location data)