I would like to know if an Android phone actually has an Orientation Sensor.
I doubt not all android phones screen changes with change in Orientation (like phones with qwerty keypad)
I have gone through the documentation and found a boolean method ‘canDetectOrientation ()’
here
But I found nothing mentioned in the description. Can anybody tell me if this is the
method to find out if a device supports orientation changes .
Thanks in advance.
If we pass
Type.AllingetSensorListfunction then we will get list of all available sensor.Then we can traverse a list and fetch Sensor type of all sensor if we found Sensor type Orientation (integer value is 3) then we can conclude that that device has that sensor.
Below is code snippet for the same.