Is WRITE permission needed to edit a file in the ASD?

I have tested personally on Android 10 and 11, physical devices.

My app use any other 2nd party pdf viewer to open files from my asd.

In companion, it doesn’t work, if files are not already available in asd

What is → my ASD? Which ASD?
I don’t get it what you are trying to explain.
Btw, how about answering my questions.

Q -1 Which android Version
Answer - I have tested this block in android 10 and 11.
With /// I get only read access but works fine in both android 10 and 11
In Android 10, I get write permission also(ability to edit pdf) if I change /// to /, but in this case, block doesn’t work for android 11.

Q-2 With which app was ASD created?
Answer - Let call my app - x, and this block is from my app -x

Q-3 with which app do you(try to) open which asd.
Answer- I try to open files from my app -x’s asd in any pdf reader ( Adobe PDF reader etc) through activity starter.

Q-4 Companion or APK?
In case of APK, answer to Q-1 is applicable.
In case of companion, this block doesn’t work properly, if I install apk, download this pdf file in asd and after this step companion can open this file.
How pdf behave after opening file in(through) companion?
Answer- Answer to Q-1 is applicable.

Show all relevant blocks.

Android.intent.action.VIEW, Application/pdf are in designing section. Using mobile so couldn’t post it.

I have no issues on Android 9 and 11 to open a PDF, read and edit it.
If I use /storage/emulated/… instead of file:///storage/emulated/…
I have less options to choose PDF-applications (that are installed on my test devices).

I didn’t ask for WRITE / READ permissions.
(Of course, the PDF apps need permissions, unless these can also write / save in the ASD.)

1 Like

Okay, I’ll try this and let you know.
Thank you for help.

1 Like

Classic… ::+1::+1:
Me too learnt from your suggestion
Thank you

1 Like

I tested /storage but in my android 11 device, it didnot work even after given full permission to PDF App.
is there alternative to fix this? Make a sub folder in download folder ? and what about permission ?
Is tough or impossible to get write permission in download folder in sdk 30?

Yes, you must use file:///storage/... on Android 11,
as you found out yourself:

But if you use file:///storage/... for Android 11 (API 30), what does not work?
As I said I, tested it on Android 11 (Pixel 2XL) and it works fine.

Which download folder? If you mean /storage/emulated/0/Download then if will no longer work when Kodular targets API 30 (Android 11, Aug 2021). But Kodular ist still targeting API 29, so it should work for now.

If you mean the download folder in the ASD then it shouldn’t be a problem at all.

I can’t edit pdf.

Which PDF app do you use?

Adobe, xodo

In Adobe you can edit but it creates a new file with numbered file name, So basically no benefit

On one of my Android 11 test devices:

Can you edit in Xodo?, in my device xodo ask to save a new copy or use as read-only

Yes, but this is the same on one of my Android 9 test devices with another PDF app. There the edited PFD is saved in a new (special) folder.

this is the problem.

Hey, did you get any solution ?