I have Xiaomi MI smartphone and it has infrared sensor. I am interested, how can I get access to sensor’s class and which methods it’s class has. I tried to find the information on other resources, but with no results.
You have to use
. There is a method called
that you can use to check all the sensors a certain device has. For example you can do similar to the following
SensorManager mSensorManager = (SensorManager)getSystemService(SENSOR_SERVICE); Sensor mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);