I am reading a constant stream of data coming from a device via Bluetooth. I'm wondering how I can convert this data to a string and print it out? The buffer will contain an ASCII string but when I run it it prints out integers, i would like to be able to see the string.
while (true) {
try {
//read the data from socket stream
if(mmInStream != null) {
int input = mmInStream.read(buffer);
System.out.println(input);
}
// Send the obtained bytes to the UI Activity
} catch (IOException e) {
//an exception here marks connection loss
//send message to UI Activity
break;
}
}