title: How to create Insecure RFCOMM Socket in Android?
body: <p>I am looking at way of connecting over rfcomm socket insecurely. I was able to find the way mentioned below </p>
  
  <pre><code>Method m = device.getClass().getMethod("createInsecureRfcommSocket", new Class[] {int.class});
  tmp = (BluetoothSocket) m.invoke(device, 1);
  </code></pre>
  
  <p>This for the time being is doing what I want. Even the documentation over <a href="http://developer.android.com/reference/android/bluetooth/BluetoothDevice.html#createRfcommSocketToServiceRecord%28java.util.UUID%29" rel="noreferrer">here</a> says that we need to use createInsecureRfcommSocketToServiceRecord for insecure connections. But there is no such method. The only way I found out was using reflection as shown above. And even in that the method that is passed in createInsecureRfcommSocket and not createInsecureRfcommSocketToServiceRecord. I just wanted to know how reliable is this way. If I mention createInsecureRfcommSocketToServiceRecord in method the connection never happens. </p>