Skip to content Skip to sidebar Skip to footer

How To Create A Bluetooth Server Socket In Android?

I am trying to create a server program that just starts bluetooth, creates a server socket, waits for some device to connect and accepts the connection. The onClick() method starts

Solution 1:

The problem was the AcceptThread() and run() functions were running before the adapter could be turned on. A single line before the AcceptThread() solved this.

while(mmServerSocket==null);

Also, run() has to be run in a different thread.

Post a Comment for "How To Create A Bluetooth Server Socket In Android?"