當前位置:編程學習大全網 - 網站源碼 - Android怎麽用代碼連接藍牙手柄,鍵盤,鼠標

Android怎麽用代碼連接藍牙手柄,鍵盤,鼠標

//得到BluetoothInputDevice然後反射connect連接設備

Method method = mBluetoothProfile.getClass().getMethod("connect",

new Class[] { BluetoothDevice.class });

method.setAccessible(true);

method.invoke(mBluetoothProfile, device);

mBluetoothProfile對象是藍牙設備的代理

device是指需要連接的藍牙設備

  • 上一篇:關於口袋妖怪紅寶石386圖鑒
  • 下一篇:轉轉平臺交易提升支付寶信用分嗎?
  • copyright 2024編程學習大全網