Code example for Sensor

Methods: getName, getType, getVendor

0
				long arg3) { 
			 
			sm.unregisterListener(sensorListener); 
			 
			Sensor sensor = sensorList.get(arg2); 
	        Sensor ds = sm.getDefaultSensor(sensor.getType()); 
	        sm.registerListener(sensorListener, ds, SensorManager.SENSOR_DELAY_FASTEST); 
	         
	        StringBuffer sb = new StringBuffer(); 
	        sb.append(sensor.getName()); 
	        sb.append("\n"); 
	        sb.append(sensor.getVendor()); 
	         
	        sensorInfoTextView.setText(sb); 
	         
			Toast.makeText(getApplicationContext(), ds.getName()+ " selected.", Toast.LENGTH_LONG).show(); 
		} 
	}; 
     
    private String getSensorTypeName(int sensorType) {