Documente Academic
Documente Profesional
Documente Cultură
java
this class has following threads:
1. Accept
2. Connecting
3. Connected
Now when you call start function of the BluetoothChatService like:
mChatService.start();
It starts accept thread which means it will start looking for connection.
mChatService.connect(<deviceObject>,false/true);
Here first argument is device object that you can get from paired devices list or when
you scan for devices you will get all the devices in range you can pass that object to this
function and 2nd argument is a boolean to make secure or insecure connection.
connect function will start connecting thread which will look for any device which is
running accept thread.
When such a device is found both accept thread and connecting thread will call
connected function in BluetoothChatService: