I got it working, the problem was that I needed to pair with the
device first (for some reason it kept an incorrect PIN and wouldn't
pair).  Here is a snippet

BluetoothDevice device;
BluetoothSocket tmpsock = null;
int port = 1;
...
try
{
        Method m = device.getClass().getMethod("createRfcommSocket", new
Class[] { int.class });
        tmpsock = (BluetoothSocket)m.invoke(device, port);
        Log.d(TAG, "CONNECTING...");
        tmpsock.connect();
        ...
}
catch (Exception e)
{
        Log.e(TAG, "Failed to connect", e);
        ...
}

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to