1,用系统API来获取传感服务。
SensorManager = getSystemService(SENSOR_SERVICE);
2,调用getSensorList方法来获取全部的传感器类型
List sensors = SensorManager.getSensorList(Sensor.TYPE_ALL);
1,用系统API来获取传感服务。
SensorManager = getSystemService(SENSOR_SERVICE);
2,调用getSensorList方法来获取全部的传感器类型
List sensors = SensorManager.getSensorList(Sensor.TYPE_ALL);