Bluetooth socket
<p>I am building tic tac to for two players and need a Bluetooth connection to exchange some data, I can enable Bluetooth, enable discover-ability but my problem in "BluetoothServerSocket" and the client "BluetoothSocket", I don't know how to manipulate this part,
this is the code:</p>

<pre><code>ArrayList&lt;String&gt;al=new ArrayList&lt;String&gt;();
        BluetoothAdapter ba = BluetoothAdapter.getDefaultAdapter();
        Set&lt;BluetoothDevice&gt; pairedDevices = ba.getBondedDevices();


        if(pairedDevices.size()&gt;0)  
            for(BluetoothDevice d: pairedDevices)
                al.add(d.getName()+" , "+d.getAddress());

                    if (!ba.isEnabled()) 
                       ba.enable();

                    BluetoothDevice device;
                    Intent dis=new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
                    dis.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION,300);
                    startActivity(dis);

                    BluetoothSocket socket = device.createRfcommSocketToServiceRecord(UUID);
                    socket.connect();

                    InputStream is=socket.getInputStream();
                    OutputStream os=socket.getOutputStream();
</code></pre>
