I am trying to receive data from the finger oximeter over bluetooth. Connection works and i receive data in byte[] format, then i convert byte array to string format using UTF-8 encoding and result im getting is in this format:
Ba�JBa�OBa�TBa�W Ba�Z Ba�\ Ba�] Ba�]Ba�]Ba�] Ba�\ Ba�[ Ba�Z Ba�X Ba�W Ba�VBa�UBa�TBa�SBa�RBa�QBa�QBa�PBa�PBa�PBa�OBa�OBa�O@a�O@a�O@a�O@a�N@a�N@a�N@a�M@aa�B
And here is my code:
if(b == delimiter)
{
byte[] encodedBytes = new byte[readBufferPosition];
System.arraycopy(readBuffer, 0, encodedBytes, 0, encodedBytes.length);
final String data = new String(encodedBytes, "UTF-8");
readBufferPosition = 0;
handler.post(new Runnable()
{
public void run()
{
Log.v("Test",data);
}
});
}
What should i do to receive a readable data for displaying?