title: How do I check BlueTooth connection status in Android?
body: <p>I am having trouble with checking the connection status of a <em>BlueTooth</em> socket. The following code causes a Runtime error:</p>
  
  <pre><code>public boolean Connected(){
      boolean connected = false;
      if(socket.isConnected()) {
          connected = true;
      }else{
          connected = false;
      }
  
      return connected;
  }
  </code></pre>
  
  <p>The logcat prints the following:</p>
  
  <pre><code>E/AndroidRuntime(2900): java.lang.NoSuchMethodError: android.bluetooth.BluetoothSocket.isConnected 
  </code></pre>
  
  <p>Why is this happening? Am I missing something?</p>