Using android mobile to control arduino

kerimil:
What's more, it's seems there is no serial timout implemented yet and the app freezes if it doesn't receive anything. To solve that I set up the app to first send a 1 byte number to the arduino, when arduino receives that it sends its data.

I wonder if you have to test for bytes available? In the Arduino it would be a test like if(Serial.available()){ Serial.read } .

In the code blocks you have a something that says BluetoothClient1BytesAvailableToReceive.............I think it should be combined with a if > 0 { read the byte }....or something like that.

P.S. I am tring to adapt your code to my purpose and I am learning while making the attempt. :slight_smile: