A Andrea Falcucci Member Licensed User Longtime User Nov 2, 2015 #1 Hi guys I know that there is no library for threading in b4i but I'd like to ask to you how I can run a background task in b4i. We are developing an application in order to interconnect to our equipment. in b4a I used the threading library with great success. The background thread was responsible of contacting the equipment storing the information in variables that the GUI reports on the screen. In b4a we also used a background service. Suggestions for b4i? Thank you
Hi guys I know that there is no library for threading in b4i but I'd like to ask to you how I can run a background task in b4i. We are developing an application in order to interconnect to our equipment. in b4a I used the threading library with great success. The background thread was responsible of contacting the equipment storing the information in variables that the GUI reports on the screen. In b4a we also used a background service. Suggestions for b4i? Thank you
schimanski Well-Known Member Licensed User Longtime User Nov 2, 2015 #2 https://www.b4x.com/android/forum/threads/background-fetch-downloads.56022/ Upvote 0
A Andrea Falcucci Member Licensed User Longtime User Nov 2, 2015 #3 Thank you but it is not my case. I need to continuously polling the equipment sending UDP messages. The receiving part is not a problem thanks to the rising event of udp packet. In b4a I create a loop inside a thread controlling the date stamp in order to be precise in sending messages. A timer is not so reliable. Upvote 0
Thank you but it is not my case. I need to continuously polling the equipment sending UDP messages. The receiving part is not a problem thanks to the rising event of udp packet. In b4a I create a loop inside a thread controlling the date stamp in order to be precise in sending messages. A timer is not so reliable.
Erel B4X founder Staff member Licensed User Longtime User Nov 3, 2015 #4 In both B4A and B4i the UDP packet is sent by a background thread. So adding another background thread will not make it significantly more accurate. Have you tried it with a timer? You can use a short timer and hold the main thread for a few milliseconds if needed. Upvote 0
In both B4A and B4i the UDP packet is sent by a background thread. So adding another background thread will not make it significantly more accurate. Have you tried it with a timer? You can use a short timer and hold the main thread for a few milliseconds if needed.
A Andrea Falcucci Member Licensed User Longtime User Nov 3, 2015 #5 Yes UDP is sent in background as the receiving part thank to the event rising. I need a sort of daemon that continuously send udp packets every 30msec. I'll try with a tight timer taking into account the time passed from last send procedure. I'll keep you posted. Anyway, the threading library is very good in b4a. It's a shame there is no alter ego in b4i. Andrea Upvote 0
Yes UDP is sent in background as the receiving part thank to the event rising. I need a sort of daemon that continuously send udp packets every 30msec. I'll try with a tight timer taking into account the time passed from last send procedure. I'll keep you posted. Anyway, the threading library is very good in b4a. It's a shame there is no alter ego in b4i. Andrea