BonanzaDriver
BonanzaDriver

Reputation: 6452

Android Bluetooth connection issue

I have a EVO (running Android 2.2) and a Sumsung Intercept (running 2.1). I'm trying create a simple chatting application (similar to the BluetoothChat example) but I cannot get the two handsets to connect. I am able to get them through the discovery process such that each handset is able to discover the other, but when I try to connect I always get a "Service discovery failed" error.

What makes this even more interesting is I'm never able to initiate the connection from the 2.2 -> 2.1 (EVO to the Intercept handsets). But, if the EVO attempts to connect first (which will always get the above referenced error), then I attempt to connect from the Intercept, I will at least get the PIN code / Accept Pairing dialogs on both handsets. But, if I attempt to send anything (the write() method) I will get an error stating the 2 handsets are not connected.

Any help would be greatly appreciated.

Upvotes: 1

Views: 618

Answers (1)

Brad Hein
Brad Hein

Reputation: 11057

One of the handsets has to be a listener (waiting with a bluetooth socket) and the other has to make a connection to the one with the socket.

In other words, you appear to be trying to initiate a connection from both devices while neither one is in a state where it can receive an incoming connection (which is the function of a bluetooth socket).

Upvotes: 1

Related Questions