I am reading data from BluetoothSocket (SPP) and I want to read it using a buffered reader.
// Written out of mind. May contain a typo. myBluetoothSocket s = ...; InputStream a = s.getInputStream(); InputStreamReader b = new InputStreamReader(a); BufferedReader c = new BufferedReader(b); Log.d("####"+c.ready());
It works on one of my phones.
On another phone, c.ready () blocks. The documentation does not mention that this function may be blocked. If I turn off the remote Bluetooth device, nothing will change - the stream will remain blocked.
source share