i have a compass page in my app but as far as i know there are some devices that doesn't support compass (no built-in sensor)
what i am trying to do here is navigate the user to another page in case there is no sensor in their device as follow:
val msensorManager = getSystemService(SENSOR_SERVICE) as SensorManager
if (msensorManager.getSensorList(Sensor.TYPE_ACCELEROMETER).size > 0) {
} else {
}
but i am not sure which Sensor type is responsible for compass functionality
is the above code correct?