@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String result = "";
SensorManager sensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
List<Sensor> list = sensorManager.getSensorList(Sensor.TYPE_ALL);
result = "디바이스에 존재하는 센서 총 개수 =" + list.size() + '\n';
for(Sensor s : list){
result = result + "vender = " + s.getVendor() + '\n'
+ "type = " + s.getType() + '\n'
+ "name = " + s.getName() + '\n'
+ "version = " + s.getVersion() + '\n'
+ "power = " + s.getPower() + '\n'
+ "res = " + s.getResolution() + '\n'
+ "range = " + s.getMaximumRange() + '\n';
result += '\n';
}
EditText editText = new EditText(this);
editText.setText(result);
setContentView(editText);
}
댓글