Hmm, already done. Look at the Button2 blocks.
It should be there. Reload/refresh...
Companion or APK?
Yes, thank you . It was copied to the download folder. I was looking in the my files>downloads folder, not the my files>internal storage>download folder(excuse me). My phone is Android 8. I need to find Android 11 and above. Does it work there too?
Yes, and on Android 11+ you don't even need to request storage permissions as it is the case on Android 8 (Android < 11).
Hello again, I put the file downloaded from Google Drive with webviewer in the assets folder. But it is not copied from here to the download folder.I deleted the file from the asset folder of the uploaded files in application.Copy the file from the phone's assets folder to the phone's download folder.
The asset folder in APK is different from the assets folder in device .
You can't, because the assets are read only
Taifun
How to save a PDF file from Google Drive to the Download folder؟
Android 11+
Do you want your app to
- download this file from google drive,
or do you want to - provide this file as an asset in your app?
If 1. above, will you use
a. the web component (by providing the link)
or
b. the webviewer (by selecting the file from google drive)
to download the file?
The "assets" folder you can see with the app running in companion is NOT available to your app when it is compiled.
Hello. My PDF file is in Google Drive. I want to view it in the app online. Then I can download it if I want and see in app offline. Then I can go to the download location and view the file directly by clicking on it.for all android ver.thanks
Blocks to Download the File (adjust filename and file ID accordingly):
This is with filescope set to App in screen properties and File component.
On newer android versions, the file will be saved to your ASD.
Test with Android 8, and report back where the file is saved to. (I forget...)
Please confirm that the file was saved to your ASD also with Android 8 ?
The path you show in both images (the second one being for companion app) is to the ASD (<path>/files/
).
If this is the case, then all you then need to do is follow the guidance previously provided in this topic to copy the pdf file from your ASD to the Download directory, observing the permissions and filescope requirements.
Hello. Thanks. On Android 8 and 11 phones, it was correct that the PDF was copied to the download folder, but on Android 14, the copy does not take place.
It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.
To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.
Taifun
Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.
Yes, Google provides more security on newer devices, so you can't see the ASD anymore, but the file still should be there
What do you get displayed in Label1?
The blocks look fine, assuming you have set the default file scope in the project properties to App
As test you also can display the result of the copy process in another label...
Taifun
hi thanks.This label is for testing to see the address of the copied file.
Yes I know
It would be interested to let us know, which value gets displayed
Taifun