I want to simulate the action of going throgh Settings->Wireless->Bluetooth and connect a paired bluetooth headset programmatically. I've done some search in Stackoverflow and Google, both indicating that there is no solution available before API level 11. However, I'm interested in working it out by peeking in the source code of bluetooth implementation of Android. The problem is that I'm not aware of which specific source code I should review. Any suggestions? Many thanks.
Android connect to a paired bluetooth headset
androidbluetoothheadset
Related Topic
- Android – How to stop EditText from gaining focus at Activity startup in Android
- Android – “Debug certificate expired” error in Eclipse Android plugins
- Android – unique Android device ID
- Android – ‘Context’ on Android
- Android – Programmatically connect to paired Bluetooth device
- Java – Proper use cases for Android UserManager.isUserAGoat()
- Android – Connect to paired bluetooth device from Xamarin on Android
Best Answer
After days of struggling, I've now managed to do it, cheers :)
Add this private method in your code:
Test it with this:
}
I'm not able to provide references of these code since I've spent lots of time googling, checking out stackoverflow, and reviewing Android source code, but failed to keep track of sources. Many thanks to you guys in Stackoverflow :)