we are using now modern samsung Android13 devices, where i am not able to access these private folders of apps anymore.
So i decided to read/write my stuff into the shared "Documents" Folder.
But i have some problems with it.
I have 2 apps:
I am going to ask for Permission on Screen initialization (Write_external_Storage), i have also enabled the Legacy Support for Screen1.
On app1
i am going to create a folder called "Fahrerhandbuch" (the creation seems working for now), in this folder there are some .pdf files (manually uploaded to the phone) and subfolders with .pdf files
But in the android settings, i only get the permission for Audio/Video Files, not for PDF Files or documents.
with the activity starter + adobe reader, i am not able to open those .pdf files, i think this is because of the missing filetypes permission?
On app2
i am going to read informations from a nfc tag and write it into a .xml file.
Here is the confusing part:
i have configured the permission thing exact same like in app1, but app2 creates the folders in the "private"-App folder, not in the shared Documents Folder.
My App 1 is Just using Buttons to Open specific PDF Files.
For now i have synchronized the PDFs with foldersync from a nextcloud to the local storage.
So i think i need a possibility to Download the files by the App itself, right?
How could i solve this?
My App 2 is creating the XML and foldersync was uploading the File, so the Same behaviour Just for an upload.
(Because App2 is Not creating the File in shared folder, but canvas is creating the folder on Screen 1)
i already tried the full path, but same result.
datatype and action already set via viewer
fyi, the app worked till android 12, so i think this is only the permission problem.
--- edit ---
i have seen now this part:
Note : Drag a file component into the working area (without necessarily using it) to get the READ permission into the manifest and additionally ask for READ permission before trying to use the activity starter solution.
Will this fix my problem?
Just use a file component?
--- edit2 ---
or do i have to put the pdfs on an external sd-card? - if yes, i think i could do it with a sd-card.
You only need that permission for older devices to create the directory, however as you are using it, it will not work... you can't ask for permission and at the same time without having received the permission create the folder... btw. I'm not sure if you can create a folder like this...
My example already is a few years old... so I think, this trick will not help for newer devices...
Do you get an error message? What happens? Do you get a blank page?
I think, you can avoid the challenges with the file system if you download the files from for example your Google Drive into shared storage (i.e. your app created the files in this case)
See again the links provided by Anke
You only need that permission for older devices to create the directory, however as you are using it, it will not work... you can't ask for permission and at the same time without having received the permission create the folder... btw. I'm not sure if you can create a folder like this...
It works for app1, but not for app2 =D
and at least just after asking for permission + legacy-mode i was able in app1 to create the folder with canvas.
Do you get an error message? What happens? Do you get a blank page?
i am using adobe reader as pdf viewer, unfortunately i see not the whole error message, because it is to long.
But in older version i had the same error if i made a mistake by typing the wrong path into it.
I think, you can avoid the challenges with the file system if you download the files from for example your Google Drive into shared storage (i.e. your app created the files in this case)
See again the links provided by Anke
i have read the saf articles, i think this should work for my case? - will it also work for all of my subfolders or do i have to set this for each file seperately?
i am not really uploading the files manually, i am downloading them with foldersync from my nextcloud, i do not really want to change all of it to gdrive.
Could you please provide a screenshot of that?
do not have a screenshot yet, but i asked google and edited the image as it is on my phones. (mighty mspaint skills :D)
--- edit ---
i changed a little bit in my screen1 on app1, maybe this is a bit better?
(i set the tinydb path, because i want to use it on my other screens as well) just fyi.