Get SensorManager:
mSensorManager = (SensorManager)getSystemService(SENSOR_SERVICE);
Get Sensor list:
List< sensor> sensorList = mSensorManager.getSensorList(Sensor.TYPE_ALL);
Print sensor list:
for( Sensor s : sensorList) { Log.d("sensor", "Name=" + s.getName()); Log.d("sensor", "Vendor=" + s.getVendor()); Log.d("sensor", "Version=" + s.getVersion()); Log.d("sensor", "MaximumRange=" + s.getMaximumRange()); Log.d("sensor", "MinDelay=" + s.getMinDelay()); Log.d("sensor", "Power=" + s.getPower()); Log.d("sensor", "Type=" + s.getType()); }the Nexus One result:
Name=BMA150 3-axis Accelerometer Vendor=Bosh Version=1 MaximumRange=39.24 MinDelay=0 Power=0.2 Type=1 Name=AK8973 3-axis Magnetic field sensor Vendor=Asahi Kasei Version=1 MaximumRange=2000.0 MinDelay=0 Power=6.8 Type=2 Name=AK8973 Orientation sensor Vendor=Asahi Kasei Version=1 MaximumRange=360.0 MinDelay=0 Power=7.0 Type=3 Name=CM3602 Proximity sensor Vendor=Capella Microsystems Version=1 MaximumRange=9.0 MinDelay=0 Power=0.5 Type=8 Name=CM3602 Light sensor Vendor=Capella Microsystems Version=1 MaximumRange=10240.0 MinDelay=0 Power=0.5 Type=5 Name=Gravity Sensor Vendor=Google Inc. Version=1 MaximumRange=39.24 MinDelay=0 Power=0.2 Type=9 Name=Linear Acceleration Sensor Vendor=Google Inc. Version=1 MaximumRange=39.24 MinDelay=0 Power=0.2 Type=10 Name=Rotation Vector Sensor Vendor=Google Inc. Version=1 MaximumRange=1.0 MinDelay=0 Power=7.0 Type=11Source Code here
0 件のコメント:
コメントを投稿