3

I have an application that needs to keep the bluetooth discovery process in a loop to always discover new bluetooth devices (when the BroadcastReceiver gets a BluetoothAdapter.ACTION_DISCOVERY_FINISHED, I just call the startDiscovery() again). I've recently added some socket communication to the app, that basically opens a Socket to a server, sends data and then closes the socket.

When I'm using 3G, everything works fine and a sniffer shows no TCP Retransmissions, the socket is cleanly opened and closed. Using Wifi, however, shows lots of TCP Retransmissions and sometimes even failures to connect the socket (with java.net.SocketException timeout).

I'm using a Samsung Galaxy S with Android 2.2.1. Is there something I'm overlooking?

Ricardo
  • 31
  • 2
  • Please clarify are you using Bluetooth or WiFi or 3G to communicate with that socket? – garzanti Mar 15 '11 at 04:10
  • Hi I have the same issue. I have a threads that is discoverying devices continnually and when I try to make an http POST it times out. – Enrique May 27 '11 at 20:01

1 Answers1

3

Can you try to configure and move WiFi to a different channel ? If you are using WiFi also in the 2.4 GHz band interference is expected specially during initial discovery / connection, after connection it should become better as Bluetooth should frequency hop to avoid interference (unless WiFi is clogging the complete spectrum)

Dennis Mathews
  • 6,897
  • 2
  • 26
  • 39