Is it "reflection" when I use getClass.getMethod(...)?
<p>I've written a few bluetooth apps now, but I had never seen <a href="http://stackoverflow.com/questions/3072776/android-bluetooth-cant-connect-out">this particular approach</a> until recently. In the example they use <code>device.getClass().getMethod("createRfcommSocket", new Class[] { int.class });</code> which seems to me a long way of just saying <code>BluetoothSocket bs = createRfcommSocket(...</code>. </p>

<p>What is the difference between their approach</p>

<pre><code>Method m = device.getClass().getMethod("createRfcommSocket", new Class[] { int.class });
sock = (BluetoothSocket) m.invoke(device, Integer.valueOf(1));
</code></pre>

<p>and mine</p>

<pre><code>sock = createRfcommSocket(.....
</code></pre>

<p>Is there a reason to use one or the other? </p>

<p>Thank you</p>
