I m working on the application which connect with printer via bluetooth and print some text. I m able to connect with printer by bluetooth and then get the outputStream from BluetoothSocket and write some text. But it does not print anything in printer... I have checked carefully there is no exception. Please help me what i did wrong in my code ???`I have used Canon MX430 printer for testing.. here is my code
String MY_PRINTER_MAC_ADDRESS="00:12:FF:67:89";// Printer Mac Address
private UUID applicationUUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
String test="testing123234123";
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
mBluetoothDevice = mBluetoothAdapter.getRemoteDevice(mDeviceAddress);
mBluetoothSocket = mBluetoothDevice.createRfcommSocketToServiceRecord(applicationUUID);
Method m = mBluetoothDevice.getClass().getMethod("createRfcommSocket", new Class[] { int.class });
mBluetoothSocket = (BluetoothSocket) m.invoke(mBluetoothDevice, 1);
mBluetoothAdapter.cancelDiscovery();
mBluetoothSocket.connect();
OutputStream os=MainActivity.mBluetoothSocket.getOutputStream();
byte[] buffer=test.getBytes();
os.write(buffer);
os.flush();
os.close();`