M MohMor Member Feb 7, 2021 #1 Hello In c# we print. Number like the following: Console.write($"{a}") Where -a- us a number . How can I do that in B4A? For example I want to send a lot of number using textwriter to a Bluetooth module. Thanks a lot
Hello In c# we print. Number like the following: Console.write($"{a}") Where -a- us a number . How can I do that in B4A? For example I want to send a lot of number using textwriter to a Bluetooth module. Thanks a lot
Erel B4X founder Staff member Licensed User Longtime User Feb 7, 2021 #2 Never use TextWriter. You should send the data with AsyncStreams. If you want to send an integer as string: Code: Copy Dim s As String = YourIntVariable astream.WriteBytes(s.GetBytes("UTF8")) Upvote 0
Never use TextWriter. You should send the data with AsyncStreams. If you want to send an integer as string: Code: Copy Dim s As String = YourIntVariable astream.WriteBytes(s.GetBytes("UTF8"))
M MohMor Member Feb 7, 2021 #3 i dont know why you said i should not use TextWriter. i think i should clarify my question.for example i want to contorl the color of a RGB common cathode led. but in the following image, the code for button red works but the code for seekbar does not work. we send data to module by the TextWriter. i dont understand your code: Dim s As String = YourIntVariable astream.WriteBytes(s.GetBytes("UTF8")) what should i do then? Attachments Untitled-1.jpg 190.2 KB · Views: 497 Upvote 0
i dont know why you said i should not use TextWriter. i think i should clarify my question.for example i want to contorl the color of a RGB common cathode led. but in the following image, the code for button red works but the code for seekbar does not work. we send data to module by the TextWriter. i dont understand your code: Dim s As String = YourIntVariable astream.WriteBytes(s.GetBytes("UTF8")) what should i do then?
Erel B4X founder Staff member Licensed User Longtime User Feb 7, 2021 #4 Which version of B4A are you using? Sending or receiving network data on the main thread is a bad idea and will likely cause your app to crash or freeze. Worth watching the video tutorial and example: https://www.b4x.com/android/forum/threads/b4x-network-asyncstreams-b4xserializator.72149/#content Upvote 0
Which version of B4A are you using? Sending or receiving network data on the main thread is a bad idea and will likely cause your app to crash or freeze. Worth watching the video tutorial and example: https://www.b4x.com/android/forum/threads/b4x-network-asyncstreams-b4xserializator.72149/#content