Universal Apps have the ability to unify code between platforms, but what
about using sensors between platforms? I wrote a simple Universal App to see how
much sensor code could be shared. In the past, Windows Store and Windows Phone
had similar code to access and handle sensors, but sharing code meant lots of
conditional compilation symbols to handle the differences.
For example, here are the differences between the setup of the Compass sensor
between Windows Store and Windows Phone:
_compass.CurrentValueChanged += _compass_CurrentValueChanged;
_compass = Compass.GetDefault();
_compass.ReadingChanged += ...