How to programmatically pair a bluetooth device on Android

后端 未结 10 1945
轻奢々
轻奢々 2020-11-30 23:27

For my application I\'m trying to programmatically pair a bluetooth device. I\'m able to show the pairing dialog for the device I want to pair and I can enter a pincode. Whe

10条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-30 23:56

    Unfortunately, I think the best that you are going to get is opening up Settings/Wireless & networks/Bluetooth Settings for the user like so:

        Intent intent = new Intent(Settings.ACTION_BLUETOOTH_SETTINGS);
        startActivityForResult(intent, REQUEST_PAIR_DEVICE);
    

提交回复
热议问题