mmSocket = device.createRfcommSocketToServiceRecord(MY_UUID); mmSocket.connect();
The following code is suggested.
private static String address = "00:19:7F:1F:20:DF";
private BluetoothSocket btSocket = null;
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address);
Method m = null;
m = device.getClass().getMethod("createRfcommSocket", new Class[]{int.class});
btSocket = (BluetoothSocket)m.invoke(device, Integer.valueOf(1));
btSocket.connect();
No comments:
Post a Comment