First we need to clarify why the files should be downloaded again. Does something change in these files? If not, it is sufficient to query whether the file(s) have already been downloaded and, only if this has not yet happened, to download them.
It is an export / import data feature in the app. The idea is to allow the user to export data to another phone for example. So yes, if he decides to do so, he will replace the data existing in the receiving phone with the data coming from the sending phones.
Due to storage restriction with android11 I understand the only way to do this is to download directly the data from the internet to the ASD with the app, the user can't pick a downloaded file in the download directory (which is VERY unfortunate in fact, because to guide the user to his file's exact url is tricky). But I don't know how to do it otherwise.
You can copy / move the downloaded files (from the ASD) to the
But I want to do the opposite ? Copy / move downloaded files from the /download folder to the ASD ?
Describe exactly what steps are to be taken.
- Do this -> event
- Do that -> event
The files are light .csv ones. The simplest way to do so would be for the sending user to send the files by mail (that I'm able to simply do so with a share bloc), and for the receiving user to click on the attached file in his mailbox, which will put the files in the download folder. And then, in the app, to select the files in the download folder and import them. But I understand that the download folder isn't accessible by the app for .csv files ?
I do not understand. Why don't you follow my suggestion to explain it step by step: 1. then 2. etc.
I don't understand that either. What is that supposed to mean?
Here is a way to download multiple files to the ASD and replace the files that have already been download before:
Here you can find a test app (aia):
your understanding is incorrect...
as you can see from the overview
the question is, are the files in the
/Download folder you like to access have been stored by your own app or not? For 1) use the file component, for 2) use the SAF extension
Thanks for you help, I'm grateful.
I checked your test app and it's working but I struggle with one thing, which is to find the exact URL of the file I need to import.
In fact, my user can, with just a click, "share" a file or all the files in a zip file with any share solution installed on his phone. This works great.
But the reverse is much more complicated.
Is there a possibility for the user to receive a file as an attached file to a mail, and to put this file in the ASD through the app ? If not, how can I put the file on the internet with a direct URL that downloadtoASD will be able to cope with ? most cloud services give links to webpage with buttons to click to download the file :-/
What does that mean? Where does the URL(s) come from, who knows about it?
(Questions upon questions )
Hence my suggestion again:
to read an email there is the IMAP extension available
however it looks like extracting an attachment is not available there?
Trying to be as precise as possible: I want the user to be able to import a file, either from the /download folder, or directly from internet, into the ASD so that the app uses those files on the next initializing.
- my first idea would be a file picker, with access to the /download folder. Unfortunately, this seems not possible anymore from Android 11. I tried with no success.
- so the second idea is direct download from the internet into the ASD, using DownloadtoASD extension. But I struggle with the correct URL to feed into the textbox before clicking the "import" button.
For example, if I put the file on my google drive, with a link open to all users, like this one:
ListeJuments (1).csv - Google Drive
The URL isn't correct I have to edit the URL for the download to work. I made it work with Google Drive Direct Link Generator to get a direct link but it's frankly unusable for a normal user :-/
Is there nothing simpler ?
So if all the URLs are from you, what's the problem? And where do the files in the /Download folder come from that cannot be accessed on Android 11+?
In other words, it's still not clear to me what exactly is supposed to happen and how.
The problem is, my app is used by several hundreds of users. The how-to manual to import data cannot be :
First put it on your drive
Then share it to anybody
Then convert the URL using some online generator
Then send the link to your phone
Then paste the link in the text box
That's not practical at all ?!
About the download option, the file would come as an attached file to a received email. When I click on it in my email app on the phone it will go in the download folder. Is there any possibility for my app to copy it to the ASD for import ?
You appear to be making life unnecessarily difficult for yourself and your users...
If it were me, I would not be bothering with files, I would be downloading data to the app, storing it in local storage (tinydb) and then providing it for users, updating the data in tinydb as required.
But the data has to be resistant to a phone change or crash. It's data my user usually keep on precious written form, for years.
If they are to put it in an app, for a better usage of this data, this can't be a case where they risk to lose the data if they lose the phone.
And the data is the user's data ! Not mine !