I wanted to build an application related to Bluetooth in Android . Is there any way by which I can set the PIN from my application in Android other than using system dialog box to enter PIN which pops out . I checked for API's given by Android for bluetooth, but I could not locate any API for setting keys for bluetooth as provided in WiFi manager e.g. wificonfig.presharedkey = xyz.
Thanks in Advance
It is not possible using the public APIs. There are few reasons why this is a bad idea , 1. Pairing by entering PIN is performed with old bluetooth deices (one or both device with Bluetooth version 2.0 or lesser) 2. Bluetooth 2.1 and onwards will use different mechanism for pairing and may not require user to enter a PIN instead it can show user a number / message and ask for user's confirmation.
So if your application has to work in all conditions it is better for it to use the system provided mechanism. (Which prompts the user for PIN / confirmation etc as applicable)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With