0

Samsung Galaxy S9 phone I have does not seem to have a sensor TYPE_GEOMAGNETIC_ROTATION_VECTOR.

SensorMnagaer mSensorManager = (SensorManager)mContext.getSystemService(Context.SENSOR_SERVICE);
mSensorManager.getDefaultSensor(Sensor.TYPE_GEOMAGNETIC_ROTATION_VECTOR)

The last line returns null.

mSensorManager.getSensorList(Sensor.TYPE_ALL)

returns a list of 39 sensors but does not seem to have this specific sensor.

  1. Is there a way to confirm that TYPE_GEOMAGNETIC_ROTATION_VECTOR is not present?
  2. Is there anyway to replicate the behaviour of the sensor in software?
Sach
  • 845
  • 3
  • 9
  • 22

1 Answers1

0

You can do the same using SENSOR_TYPE_ROTATION_VECTOR:

getDefaultSensor(Sensor.TYPE_ROTATION_VECTOR);

The downside of that is that has more power consumption.

Theo
  • 57,719
  • 8
  • 24
  • 41
elRama
  • 61
  • 1
  • 6