How to make an accurate compass on android
问题 my android application shows the direction of a particular place in the world and therefore in needs to get the compass degree. This is the code I've been using to calculate the degrees: public void getDirection() { mySensorManager = (SensorManager)getSystemService(Context.SENSOR_SERVICE); List<Sensor> mySensors = mySensorManager.getSensorList(Sensor.TYPE_ORIENTATION); if(mySensors.size() > 0){ mySensorManager.registerListener(mySensorEventListener, mySensors.get(0), SensorManager.SENSOR