title: How to know if a sensor is present on my Android device?
body: <p>i would like to know if a sensor (for exemple the accellerometer) is present on my Android device.</p>
  
  <p>I am dealing with the SensorManager class.
  Here is the code I am using:</p>
  
  <pre><code>sensorMgr = (SensorManager) getSystemService(SENSOR_SERVICE);
  sensorMgr.registerListener(this,sensorMgr.getDefaultSensor(Sensor.TYPE_ACCELEROMETER),1);
  </code></pre>
  
  <p>Thank you.</p>