This is an android app that reads from orientation sensor and rotates a compass image on the screen. It's a demo from the Learning Android book The text book is online here: http://ofps.oreilly.com/titles/9781449390501/index.html (as of 9/2011)
iliu/Android-Compass
Sample android app that reads from the orientation sensor and does something
Java