PDF download from One drive to ASD can not be viewed

Goal: View pdf from OneDrive with Samsung notes (copy to asd). Android 11..

First APK test by copy file (TestviaAssset) from asset to asd, file opens via Samsung notes.
Second APK (see blocks, disabled copy from asset) by download file to asd from OneDrive gives error when Samsung notes viewer opens. Error (translation) “file cannot be opened. Possibly not supported or damaged”.
Generated URL from OneDrive via “copy link” and copied in url block “DownloadToASD1”.DownloadFileToASD”.
Listing the asd shows the file “Testvia1D”.
I tested the OneDrive URL link outside APK….document opens.
Remark: file via asset and OneDrive have same origin file.
Question 1: Can OneDrive pdf file be downloaded with extension “DownloadToASD1” with URL by “copy link” methodology ?
Question 2: Any other possible cause for error ?
Thanks already.

Usually another app (here the pdf reader) is not able to access the ASD of another app (in this case your app), so I'm wondering that this worked for you...

EDIT: probably the Samsung notes reader on Samsung devices does have more permissions?

Viewing the pdf file from shared storage should work

Taifun

Hi Taifun, thanks for quick response. I added a block “When DownloadToASD1.DownloadCompleted”. I checked in Documents..file is there, but same error. The original pdf size was 700k, in documents however 49k ? Does “DownlloadToASD” cause this ?

I'm not familiar with that extension... the author might know more...
Probably it is a general problem to download something from One Drive?

Taifun

I've never used OneDrive so I'm not familiar with it. You probably have to use a direct link.

Thank you for your advise, this works :+1:. I can now find the way ( OneDrive folder link+filename) to copy 30 pdf’s with the great DownloadToAsd extension.
I see in upwards response the advise to copy the pdf files from asd to shared folder and start then the startactivity with Samsung notes. Is this more/better future proof ?

From the screen shot of your code in first post, i did not see the download to asd. Download complete event. Are you sure the download is finished?

And you are using different file names. Testvia, TestVia.

You are correct. I only used this code to check if download url from OneDrive worked (It worked). The other blocks are out of function. Sorry if I caused any misunderstanding. So all solved for me. Thanks.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.