Skip to content Skip to sidebar Skip to footer

Android Java.io.ioexception: Transport Endpoint Is Not Connected

I need to send a string to a bluetooth device. But while sending,I am getting an Exeption java.io.IOException: Transport endpoint is not connected on java.io.OutputStream.write(byt

Solution 1:

Edit:

You need to connect to the socket, before that you need to cancel the discovery

 btAdapter.cancelDiscovery();
 socket.connect();

UUID worked for Kiran K J is

00001105-0000-1000-8000-00805F9B34FB


You Haven't get the Bluetooth Adapter, you have just declared it.

Get the bluetooth adapter like this using static factory method

Add this in onCreate

btAdapter=BluetoothAdapter.getDefaultAdapter();

Post a Comment for "Android Java.io.ioexception: Transport Endpoint Is Not Connected"