Hi,

I am using Bluetooth APIs to establish the connection. I using the
Bluetooth chat application as a reference to communicate with the
Bluetooth headset.

When I try to connect with Bluetooth headset I am getting IOException
with the reason Connection refused.

Can any one tell me the reason for this exception if possible give me
the solution if you already resolved the same.

Here is the code which i am using to establish the communication with
the Bluetooth. And i also added the Bluetooth and Blutooth_Admin
permissions to my manifest file.

BluetoothSocket sock =
remoteDevice.createRfcommSocketToServiceRecord(UUID.fromString("00001108-0000-1000-8000-00805F9B34FB"));

mBtAdapter.cancelDiscovery();

try {
           sock.connect();
     } catch (IOException e) {
           sock.close();
    }


Regards
Anzi.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to