Search code examples
androideclipsecarriage-returnlinefeedmedical

How do you set CR terminator in android when sending data as string?


I am sending letter A (string letter = "A\n") on my android phone to a device. In matlab the code is set(s1,'Terminator', 'CR'). I would like to know how this is done from on an android phone. I want an enter after I sending letter A. Thanks for you answers in advance


Solution

  • I have found the answer. "\n" is new line feed, "\r" is carriage return. "\n" = 10 in decimal; and "\r" = 13 in decimal. so I want 13 in decimal for Carriage return, "\r" worked for me instead of "\n". (Look at the ASCII table closer :))