Cannot use public APIs. There are several reasons why this is a bad idea: 1. Pairing by entering a PIN code is performed with old bluetooth settings (one or both devices with Bluetooth version 2.0 or less) 2. Bluetooth 2.1 and later will use a different mechanism for pairing and may not require from the user entering a PIN code, instead he can show the user a number / message and ask for user confirmation.
So, if your application should work in all conditions, it is better to use the mechanism provided by the system. (What prompts the user with PIN / confirmation, etc.)
Dennis mathews
source share