captainTsubasa
Lurker
Hi,
I'm new here and i have a little question about an app that i am developing.
I'm new at mobile development and i have concerns like eficiency, that are very important.
I have an application that receives data in binary form through bluetooth. I read the data using bluetoothsocket to an byte[]. But i must parse all messages, because they must have an given format and they are in binary.
My solution was to convert byte[] to a string and then split the string and parse all received messages.
I don't know if this is the best way to do it and therefore i am asking to help me in this issue.
An example of the data to parse:
0000000010000001
i should know that the first 8 zeros are the header and 10000001 the real data.
My idea was to create a string that represents -> 0000000010000001
and then split the whole string in one byte and check the value, like:
string1 had 00000000
string2 had 10000001
i know that 8 zeros are the header, therefore string2 has the representation of the data.
regards.
I'm new here and i have a little question about an app that i am developing.
I'm new at mobile development and i have concerns like eficiency, that are very important.
I have an application that receives data in binary form through bluetooth. I read the data using bluetoothsocket to an byte[]. But i must parse all messages, because they must have an given format and they are in binary.
My solution was to convert byte[] to a string and then split the string and parse all received messages.
I don't know if this is the best way to do it and therefore i am asking to help me in this issue.
An example of the data to parse:
0000000010000001
i should know that the first 8 zeros are the header and 10000001 the real data.
My idea was to create a string that represents -> 0000000010000001
and then split the whole string in one byte and check the value, like:
string1 had 00000000
string2 had 10000001
i know that 8 zeros are the header, therefore string2 has the representation of the data.
regards.