Roberto P. Well-Known Member Licensed User Longtime User Apr 23, 2016 #1 as explained in the tutorial https://www.b4x.com/android/forum/threads/downloading-files-using-service-module.7572 I need to download many files from servers. If you launch the list (with for) the file to be downloaded, the server requests are made immediately and overlap the server response You know how to give advice on how to start the download request only after the previous file has been downloaded? In practice, the durations for loop, for each request, the cycle should stop and wait for the terms of the file download. I hope it is clear. Thanks in advance Roberto
as explained in the tutorial https://www.b4x.com/android/forum/threads/downloading-files-using-service-module.7572 I need to download many files from servers. If you launch the list (with for) the file to be downloaded, the server requests are made immediately and overlap the server response You know how to give advice on how to start the download request only after the previous file has been downloaded? In practice, the durations for loop, for each request, the cycle should stop and wait for the terms of the file download. I hope it is clear. Thanks in advance Roberto
somed3v3loper Well-Known Member Licensed User Longtime User Apr 23, 2016 #2 I did not use that DownloadService but I think it is better not to use for loop but declare a global index as int and start only yoururlslist.Get(index) and then at the FinishDownload you increase index value index=index+1 and process the next url yoururlslist.Get(index) Upvote 0
I did not use that DownloadService but I think it is better not to use for loop but declare a global index as int and start only yoururlslist.Get(index) and then at the FinishDownload you increase index value index=index+1 and process the next url yoururlslist.Get(index)
somed3v3loper Well-Known Member Licensed User Longtime User Apr 23, 2016 #3 Also check that index is not larger than yoururlslist.Size-1 before increasing its value and processing next url Upvote 0
Also check that index is not larger than yoururlslist.Size-1 before increasing its value and processing next url
Roberto P. Well-Known Member Licensed User Longtime User Apr 26, 2016 #4 Hi thanks for your support Upvote 0