T Tim Chapman Active Member Licensed User Longtime User Dec 29, 2025 #1 I need to list files on a microsd card and compare the list to a previous list of files on the same SD card to see if any files have changed. I don't want to have to pause the code while this happens. The code sends a request to OpenAI and waits for a response. I don't know that there would be time enough while waiting to do the file checking. After the AI responds, the user will press a button to read the response using TTS. Is there a way to make the file checking occur while the TTS is reading? There should be plenty of time then while the TTS reads. How to make Android do two things at once. I tried threading, but got the error: b4a Exception : Wrong number of arguments; expected 4, got 0 This error seems to be common and I have not found an answer for it. I understand that there may be simpler ways to do this without threading, but I don't know what they would be.
I need to list files on a microsd card and compare the list to a previous list of files on the same SD card to see if any files have changed. I don't want to have to pause the code while this happens. The code sends a request to OpenAI and waits for a response. I don't know that there would be time enough while waiting to do the file checking. After the AI responds, the user will press a button to read the response using TTS. Is there a way to make the file checking occur while the TTS is reading? There should be plenty of time then while the TTS reads. How to make Android do two things at once. I tried threading, but got the error: b4a Exception : Wrong number of arguments; expected 4, got 0 This error seems to be common and I have not found an answer for it. I understand that there may be simpler ways to do this without threading, but I don't know what they would be.
Solution Erel Dec 30, 2025 Before you choose the design, you need to make some measurements and find the steps that are actually slow. Note that TTS and HttpJob are asynchronous.
Before you choose the design, you need to make some measurements and find the steps that are actually slow. Note that TTS and HttpJob are asynchronous.
Erel B4X founder Staff member Licensed User Longtime User Dec 30, 2025 #2 Before you choose the design, you need to make some measurements and find the steps that are actually slow. Note that TTS and HttpJob are asynchronous. Upvote 0 Solution
Before you choose the design, you need to make some measurements and find the steps that are actually slow. Note that TTS and HttpJob are asynchronous.
T Tim Chapman Active Member Licensed User Longtime User Dec 30, 2025 #3 So much simpler than using threads!! Upvote 0