Closed arihant-001 closed 6 years ago
where are the downloaded files placed?
just wondering, .. e.g. if the user were to want to access it, say an mp3 file with vlc, or a pdf in some pdf-reader?
We can save downloaded files in external storage in Public files so even after uninstalling the app, they will be there to be used by other apps.
Well, we can. I was asking more along the lines of "what is typically done in Android for something like this? .. is there a file system view to the user?"
In this case, are users aware of a "public" area commonly in Android?
In most Android apps, like in Google drive and one Drive, the downloaded file gets saved in the Download folder. In some apps, the file gets saved in a folder according to its type: music file in the music folder, picture in the pictures folder. I was thinking of saving the file in the download folder.
How about we get going on the feature, assuming the destination is the download folder, and later change the location according of the advice from @octacode, @megabitdragon and any others that are regular users?
I think we may later change the destination to 'Amahi' folder, with separate folders for separate file types (images , videos, documents, etc).
'Whatsapp' store all our downloaded media in its own folder name.
I just had this idea: what if the folders in the file system where these files are stored (even if we did not download anything) were to be browsable as a share?
So, basically we could play the files again with the app itself! Or share them, etc.
We could make up a "virtual share" called Android Phone Storage
or something like that, and we'd see it all the time after the first time a file has been downloaded? (or even before, we always present that virtual share, if it's simpler)
We can do something where we have a download option for audio/video files and have a "share" like @cpg suggested. On top of that we can make something more transparent to the user. For example we could only show files that have been downloaded in their original share. A real life example will be: I need to get on plane and I download some songs for the takeoff. Once I switch to airplane mode, the app should work the same way but only files that are on device should be available. The difference is that they will not be in a special share but in the original share.
@megabitdragon idea looks good.
With the idea of @cpg of making a toggle instead of a button for download makes it more precise.
So there will be a separate share as @cpg suggested say Offline Data
, and on opening the app when the internet connection isn't available, the user will only see the Offline Data
share containing original share with downloaded files.
Ok, thinking about this a little more, there are two distinct things, though the second one could affect how the state of the first one is implemnting:
1) There is state and queueing. To the user, there is a "download" button (it could be an icon like 🔽, for example). A) Once tapped, the icon switches to some "downloading" icon (like 🔃 for example) reflecting the state change. B) If tapped while downloading, the option is given to cancel the download via some alert. If cancelled, the button goes to the initial state C) After a while, the icon goes to "the file is downloaded" state, like a checkmark (for example ✅) D) If the file is touched when downloaded, the file is played. There should be a way to delete the file
There are a billion corner cases here, so this is not such a small feature. It could also perhaps leverage the use of a database to maintain the state. This needs to be done with care and testing has to be detailed, given all the possible corner cases.
2) Separately, when the user is offline in an airplane or something, they may not be able to browse shares in the original location (so, what @megabitdragon mentioned above of browsing "like normal" makes things hard in general, because right now the back-end server has to be online to be able to browse).
In this case we could have a "virtual share", called for example Android Phone Storage
or whatever (or thinking about it, maybe My Downloads
is better). One way to handle the browsing is to make this share a "linear" list of files -- each showing the state (downloading 🔃 or downloaded ✅). We could also have the functionality to play/delete the file here.
There will be a more option
for each item in the list as shown
On Clicking , it will display the list of options that can be applied to the file, like delete, download
, share.
Download will start on clicking download. A snackbar or a dialog will appear after the completion of download process indicating successful download.
If the file is already downloaded and is clicked, then it will show the Delete from downloads
option instead of Download
option.
As @cpg suggested, there will a separate My Downloads
share showing all the downloaded/downloading files with their current state. Each file will have the option to play, delete,share.
Got it. Thanks for expanding the details. So let's split this into several (maybe two, maybe three?) steps and focus one at a time.
This can be broken down into these steps:
My Downloads
share. This will display list of all downloaded files with options to play, share and delete from local storage.Just a addition, in case if a downloaded file is manually deleted by a user using some other file browser app, then we must also remove the entry from our database for that file and change the download symbol for that file accordingly.
That's a good point @csoni111. I wonder if there is any way to prevent that. Also, what if someone removes the file from the HDA, what are we going to do? Delete the file from local storage? Restore it? Ask?
For this what Google drive does is that it keeps the downloaded file in the local storage even if the file is deleted from the cloud storage.
Good points. Lots of cases. In my view, we have to define:
This is akin to a cache coherency protocol - defining how things can diverge and how to manage the evolution of those states.
Valid states can be:
My Downloads
share only)There are two ways proposed for the issue.
I think, its necessary to decide one among the two ways before discussing any further.
I think your suggestion, option 2, is a good idea and more extensible.
As for the states, would you consider trying to formally draw a state machine with valid transitions within states? It may be a little bit of work up front, but I think it will help in the long term.
Would be great if we can make it editable to we evolve, for example using dot. Below is a start to that (assuming a file called download-states.dot
). Get a PNG file with dot -o downloaded.png -Tpng download-states.dot
digraph download_states {
rankdir=LR;
size="8,5"
node [shape = doublecircle]; online;
node [shape = circle];
online -> downloading [ label = "get it" ];
downloading -> online [ label = "dl failed" ];
downloading -> downloaded [ label = "dl completed" ];
downloaded -> remote_updated [ label = "hda updated" ];
downloaded -> local_vanished [ label = "local removed" ];
downloaded -> remote_deleted [ label = "remote removed" ];
}
Latest state diagram for discussion
Description
For videos, audios, and images there is no direct option for downloading. If a user wants to download a file then only way around is to click on share option.
Solution
Download option can be added to the action bar along with other options.