检测安卓手机自带传感器详细信息
代码说明:
public class MainActivity extends Activity { private TextView text; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); text = (TextView)findViewById(R.id.text); SensorManager sm = (SensorManager)getSystemService(Context.SENSOR_SERVICE); List allsensors = sm.getSensorList(Sensor.TYPE_ALL); text.setText("该手机有"+allsensors.size()+"个传感器,他们分别是: "); for(Sensor s:allsensors){ String tempString = " " + " 设备名称:" + s.getName() + " " +
下载说明:请别用迅雷下载,失败请重下,重下不扣分!