Hi everyone,
I have modified a Bluetooth solution from an android chat example, in order to create multiple Bluetooth connection (ad hoc). My code works, it listen for new connection and try to connect to other bluetooth devices (common Clien/Server solution),but I have found two different problems.
First, it takes really long time to stablish the connection. At the moment, I try to stablish new connections and then I listen for new incoming connections. These two operations are not done simultaneously, so my first question is, Can I listen for incoming connections and try to connect to other devices at the same time?
The second problem is that sometime the Bluetooth connection becomes unresponsive, so I have to switch OFF and then ON the Bluetooth in order to fix this problem. Sometimes this doesn't work, so I have to restart the device. I think that the problem is related to the fact that I am requesting to stablish a Bluetooth connection multiple times, but I am not sure about this. Maybe someone can give me a better reason to fix this problem.
I have attached my code to this email, I will appreciate any comments to improve the functionality. Thank you
I have modified a Bluetooth solution from an android chat example, in order to create multiple Bluetooth connection (ad hoc). My code works, it listen for new connection and try to connect to other bluetooth devices (common Clien/Server solution),but I have found two different problems.
First, it takes really long time to stablish the connection. At the moment, I try to stablish new connections and then I listen for new incoming connections. These two operations are not done simultaneously, so my first question is, Can I listen for incoming connections and try to connect to other devices at the same time?
The second problem is that sometime the Bluetooth connection becomes unresponsive, so I have to switch OFF and then ON the Bluetooth in order to fix this problem. Sometimes this doesn't work, so I have to restart the device. I think that the problem is related to the fact that I am requesting to stablish a Bluetooth connection multiple times, but I am not sure about this. Maybe someone can give me a better reason to fix this problem.
I have attached my code to this email, I will appreciate any comments to improve the functionality. Thank you