Introduction - If you have any usage issues, please Google them yourself
Android compass, use a TextView control device type display angle. In addition, an image with a compass pointing north and south. First, the sensor Manager needs the device is initialized, the application is initialized. Meanwhile, the need to register the device orientation sensor when the application is activated and canceled it when the application is halted to conserve battery.