Compass is a web app written in plain HTML/CSS/JS. It uses [DeviceOrientationEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceOrientationEvent) and [geolocation](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation) to show a smartphone's GPS coordinates and polar orientation.
No, not really. Results may vary. As of this writing, Firefox and Chrome browsers handle the DeviceOrientation spec differently. It's only been tested on Chrome for Android.