Question

My app uses "Orientation Sensor", as you can see here:

SensorManager sensorMgr = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
Sensor sensor = sensorMgr.getDefaultSensor(Sensor.TYPE_ORIENTATION);

I want to define < uses-feature> in my Manifest file in order to enable my app only for devices which can actually use this sensor, a.k.a. devices which have "Orientation Sensor".

The problem is that the available features does not include Orientation Sensor. The included sensors are:

  • Accelerometer
  • Barometer
  • Compass
  • Gyroscope
  • Light
  • Proximity

(As mentioned here: http://developer.android.com/guide/topics/manifest/uses-feature-element.html#hw-features)

Which sensor should I choose? Is it accelerometer, compass or gyroscope?

Was it helpful?

Solution

According to android documentation "The orientation sensor derives its data by using a device's geomagnetic field sensor in combination with a device's accelerometer." Refer to this page for more information HERE . It further says "The orientation sensor derives its data by processing the raw sensor data from the accelerometer and the geomagnetic field sensor. Because of the heavy processing that is involved, the accuracy and precision of the orientation sensor is diminished (specifically, this sensor is only reliable when the roll component is 0). As a result, the orientation sensor was deprecated in Android 2.2 (API level 8)"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top