Download folder path android11

How to save a PDF file from Google Drive to the Download folder؟

Android 11+

Do you want your app to

  1. download this file from google drive,
    or do you want to
  2. 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...)

r in Android 8.



Where is the files folder ? Android Folder is not accessible on Android 11+

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.

1 Like

internal storage>android>data>appinventor.ai_mbp1343.exp_2>files>

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. :tulip:

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 icon24 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...

Screenshot_20250604_175927_DuckDuckGo

Taifun

hi thanks.This label is for testing to see the address of the copied file. :tulip:

Yes I know
It would be interested to let us know, which value gets displayed

Taifun

Hi.

So it looks like the file got downloaded successfully

Now check the default file scope and the return value of the Copy method

Taifun






apps and asset is similar.i used companion and my phone have android 8

file dont copied in android 14 but copied in android 8 and 11.

Try this one: exp_2a.aia (647.5 KB)

It should work on all Android versions with Companion & APK.
If you first test with Companion, remove arabic.pdf from /Download/ beforer testing with the APK and vice versa.

1 Like

Hi, I haven't had access to a phone with Android 14 yet to check this code, but it seems that the code has nothing new, just a clock has been added that checks whether the file is in the download folder. Am I understanding correctly? Please help. Thanks.

I tested it on Android 11-15 and it works fine (Companion & APK). On Android < 11 you must request and grant WRITE permission testing with the APK.

1 Like