mmInputStream.read(packetBytes);
// vs
int nbrRead = mmInputStream.read(packetBytes);
The code doesn't capture and print out the value returned by the read() method.
Does the read() read any...
Type: Posts; User: Norm
mmInputStream.read(packetBytes);
// vs
int nbrRead = mmInputStream.read(packetBytes);
The code doesn't capture and print out the value returned by the read() method.
Does the read() read any...
Another help for debugging would be to save and print the value returned by the read() method.
The debug output you posted shows that a byte with value 0 was in the buffer after the read. I don't...
Please post the code and what is printed by the println() in and around the loop.
Be sure to use the Arrays class's toString() method, not just the array name like here:
03-13 13:22:15.522:...
readBuffer = new byte[0];
Is an empty array which would print as []
That String is the value returned from the default toString() method of a byte array. To format the contents of an array for printing use the Arrays class's toString() method:...
The code is using an index of 1 with an array of length 1 at line 177. Max index for an array of length 1 is 0
The debug output printed by your println()s should show the length of the array and...
The code needs some println() statements to print out the values of the variables it is working with so you can see what the computer sees when the code executes.
The code at line 174 used an index with a value of 1 with an array with only 1 element (max index would be 0)
There is a button with the Logcat that saves its contents to where it can be copied.
Please copy the contents of the logcat and paste it here showing the exception.