title: Connecting to Embedded Bluetooth Device From Android Device
body: <p>i just started working on Connecting to Embedded BT Device through My Android Phone.It is connecting fine but i am facing problem when i am not disconnecting it properly. I mean first close socket and then any i/o steams opened.  </p>
  
  <p>But when i turn off my Bluetooth suddenly in device how will i know the bluetooth is get disconnecting. is there is any way to receive  Bluetooth disconnecting listener all the time in the APP. </p>
  
  <p>Any Ideas ....?
  Thanks</p>
  
  <pre><code>mmSocket= device.createRfcommSocketToServiceRecord(uuidToTry);
  try
  {
      mmSocket.connect();
  }
  catch (IOException e)
  {
      mmSocket.close();
  }
  </code></pre>