B Basic4AndroidRocks New Member Sep 18, 2011 #1 I am trying to figure out the best coding method to Listen and Transmit data continuously. I read in here that looping is bad practice and use timer instead. Anyone has a source code example to give me an idea how to Listen/Transmit Data? VB6 Mscomm has an event that triggers anytime an incoming data is available. Does Serial component in B4A have anything like Mscomm? I want to do something like this Start: Request Data from Extenal Device Listen and Wait for Carriage Return Parse Data Display Data on the Form (Activity) Goto Start and Perform another request Thanks and I am looking forward to purchase this software to try out the Serial.
I am trying to figure out the best coding method to Listen and Transmit data continuously. I read in here that looping is bad practice and use timer instead. Anyone has a source code example to give me an idea how to Listen/Transmit Data? VB6 Mscomm has an event that triggers anytime an incoming data is available. Does Serial component in B4A have anything like Mscomm? I want to do something like this Start: Request Data from Extenal Device Listen and Wait for Carriage Return Parse Data Display Data on the Form (Activity) Goto Start and Perform another request Thanks and I am looking forward to purchase this software to try out the Serial.
Erel B4X founder Staff member Licensed User Longtime User Sep 19, 2011 #2 There are two options. You can use a Timer to check when data is available, or the better option is to use AsyncStreams. In the later case an event will be raised when new data is available. Android Serial tutorial AsyncStreams Tutorial Upvote 0
There are two options. You can use a Timer to check when data is available, or the better option is to use AsyncStreams. In the later case an event will be raised when new data is available. Android Serial tutorial AsyncStreams Tutorial
rbsoft Active Member Licensed User Longtime User Sep 19, 2011 #3 Have you read this thread? http://www.b4x.com/forum/basic4andr...s/6908-android-serial-tutorial.html#post39900 That should answer most of your questions. Rolf PS: Sorry, noticed that it was just answered by Erel, it is the same link to the Serial Tutorial. Last edited: Sep 19, 2011 Upvote 0
Have you read this thread? http://www.b4x.com/forum/basic4andr...s/6908-android-serial-tutorial.html#post39900 That should answer most of your questions. Rolf PS: Sorry, noticed that it was just answered by Erel, it is the same link to the Serial Tutorial.