Hello community, I have created a download button and pdf viewer, I want the following function:
When the button is clicked, I want to check in the mobile directory if the file “namefile.pdf” is stored in it; If it is stored there will be the file, otherwise, download the file and then display it.
create a procedure for checking file and downloading if it does not exists
run procedure on screen initialization
if download failed run procedure again
…this will create a loop until file gets downloaded.
Or…
Use network component and if network disconnected then pause download.
As I know there is an event block named ’ download error’ (I am very good in forgetting names ) that will be triggered if download failes or comes an error
That was the simplest way to explain. Surely, he can leave out the check file block, and also add notifier, such as “Open PDF now? Yes No”, “Download Complete”, and so on
Thank you very much for your contributions to all, sincerely I had not contemplated if a cell phone had no internet connection. The suggestions will be put into practice.
One last question, by default, is the Custom_Download component where you save the downloaded files?
In my case, it does it in the mobile memory, because I don’t have an SD card, and in the case that an expandable SD memory?
In my case I use the Application Specific Directory in the internal storage, but it can be also used in the external storage. In both cases, it’s not necessary to ask for permission.