Sending number as byte through serial I'm trying to send data from an Arduino to an Android device.

I saw an online guide for that which provided this code:

void setup() 
{ 
  Serial.begin(115200);
} 

void loop() 
{ 
  byte msg[64]; 
  int len = Serial.available();
  if (len &gt; 0)
  {
    len = Serial.readBytes((char*)msg, sizeof(msg)); // readBytes seems to need a char* not a byte*
    Serial.write(msg, len);
  }
}  


I tried that example and it is working perfectly!

But when I put Serial.write("3");
in the setup loop after Serial.begin(115200);
it appears as question mark on my Android device,
I guess that I'm not sending it as a byte,
I searched online but without any luck.
Start by changing it to Serial.write("3", 1);

Does that help, you're missing the second parameter to the Serial.write call, which is the number of characters (bytes) to write.