Tried as is, or with “file:///” or with “file:///storage/emulated/0/”, but none of it worked. In the apk, I checked the permission, it was granted. Check online without much success.
To be exact, the apk created the directory correctly, but did not copy the files, while the companion, the directory was not created.
Can someone point me in the right direction. Thanks.
Thank you nikzdreamer2001. Your suggestion worked in the Companion mode, but not in the apk mode. Because the file that I need to copy over is in the “assets” of the apk. I suspect that “//filename.jpg” is the wrong format. Though that’s what TaiFun’s discussion stated so.
And in file from argument in taifunfiles use join text(2 text) in which first will be path to asset from above referenced extension and second argument will be filebane in assets.
Thank you again for your input for the second time. It was these same discussion that I’ve read before I created these blocks. The “companion” mode these blocks work. They just don’t work in the apk. The directory was not created and the file was not copied. I believe either I created Directory wrong, or the FileCopy.FromFileName is wrong.
I took Nikzdreamer2001’s advice and got rid of the AskPermission.ExternalStorage, and then put it back. With the storage permission granted, still no directory and no file copy.
I will also read the discussion suggested by vnow360.
Thank you, vknow360. After I replace CreatDirectory with FileTools. Everything worked. However, I found another problem. I found out that all files are copied only after a second boot up. Meaning, once the permission are granted, when i query whether the permission was granted, the answer is negative. Only when I close the app and boot it up again the second time, then the directory is created and the files are copied over. Below are current blocks. My question is how do I code it, so that I can avoid a second boot up? Thank you.
Haha, I was wrong, vknow360. After I replaced the original FileTool extension with the original File extension, it still worked. I now believe that the problem is caused by the storage permission query. I will read your discussion. For anyone who is interested to learn about my struggle. Below is the complete blocks for initiating copy files from assets to a mobile device upon installation.