Skip to content

Instantly share code, notes, and snippets.

@ishitcno1
Last active December 26, 2015 00:29
Show Gist options
  • Save ishitcno1/7064044 to your computer and use it in GitHub Desktop.
Save ishitcno1/7064044 to your computer and use it in GitHub Desktop.
Get vendors and names of all sensors of an android device.
private String getSensorInfo(SensorManager sensorManager) {
Iterator iterator = sensorManager.getSensorList(Sensor.TYPE_ALL).iterator();
Sensor sensor;
String s = "";
while (iterator.hasNext()) {
sensor = (Sensor)iterator.next();
s = s + sensor.getName() + " MADE BY " + sensor.getVendor() + "\n";
}
return s;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment