0
我需要一点帮助:如何检查识别的传感器? 因为做了一个项目,并且在gs2上有所有的传感器(acc,gyro等),但是在galaxy ace上只有acc,因为我知道。Android检查识别传感器
我需要一点帮助:如何检查识别的传感器? 因为做了一个项目,并且在gs2上有所有的传感器(acc,gyro等),但是在galaxy ace上只有acc,因为我知道。Android检查识别传感器
1 .:获取的SensorManager:
`mSensorManager = (SensorManager)getSystemService(SENSOR_SERVICE);`
2:获取传感器列表:
List< sensor> sensorList = mSensorManager.getSensorList(Sensor.TYPE_ALL);
3 .:打印传感器:
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());
}
这很可能是你在找什么在检查功能程式设计
PackageManager PM= this.getPackageManager();
boolean gps = PM.hasSystemFeature(PackageManager.FEATURE_LOCATION_GPS);
boolean acc = PM.hasSystemFeature(PackageManager.FEATURE_SENSOR_ACCELEROMETER);
此链接说明你可以做什么来过滤您在市场上的应用程序,在部分
特意找我想我找到它......