Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find the reason for Bluetooth pairing failure in Android?

I'm trying to pair a device using Bluetooth. Sometimes pairing is working fine. but, sometimes createBond() function returns false. How to find the reason for the failure?

if(!device.createBond()){

     // want to find the reason for the failure

}
like image 281
Sriraman Avatar asked Oct 21 '25 04:10

Sriraman


1 Answers

This negative result can be caused when calling createBond() on an already bonded device. Remember that bonded does not mean connected, bonded means paired. Check if your device bluetooth settings already has a known configuration for the device you are trying to connect to. If so, deleting the Bluetooth configuration and then doing createBond will fix the problem.

like image 123
aiden_fry Avatar answered Oct 25 '25 19:10

aiden_fry



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!