Android——蓝牙连接
今天要做一个蓝牙4.0的通信,先做个小test,之后再看看具体的api: @Override public void onClick(View v) { switch (v.getId()) { case R.id.scan: // bluetoothService.startBluetooth(); //1,初始化蓝牙适配器 final BluetoothManager bluetoothManager=(BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE); BluetoothAdapter bluetoothAdapter= BluetoothAdapter.getDefaultAdapter(); //2,开启蓝牙 if(bluetoothAdapter==null || !bluetoothAdapter.isEnabled()){ Intent enableBtIntent=new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE); startActivityF...























