Open cketti opened 4 years ago
@cketti may be we able to use Picasso for loading Images to app when we want to do that. What do you think?
@GNUDimarik Picasso is a library that deals with displaying images. This issue is about downloading images and saving them to storage, not displaying them.
This requires:
Ideally there would also be a way to pause and resume or cancel an ongoing download.
@cketti Picasso has auto caching also. But I'm not sure we able to control it. But I got your point. If you don't want to use WRITE_EXTERNAL_STORAGE permission then it's possible to save it via ContentProvider in db. Not sure if that's a goot idea ... Please let me know what do you think?
To improve the current behaviour at least temporarily you could still use DownloadManager
but save to the public downloads directory using setDestinationInExternalPublicDir
. This does not allow the user to pick a location but it does not require WRITE_EXTERNAL_STORAGE
(since k-9 targets API level 29, afaict) and at least the file can be accessed by the user.
Describe the bug Long-pressing an external image in an HTML message offers "Download image" as an option. This uses
DownloadManager
to download the file. But the documentation states:That means users can't actually get to the file other than through the notification that will open the file for viewing when clicked.
Expected behavior Prompt the user for a storage location. Download and write the file to that location.
Environment:
Note: I don't want us to request the
WRITE_EXTERNAL_STORAGE
permission just to be able to useDownloadManager
. So we'll probably have to download the image ourselves. Ideally we'll use an existing library for that. Suggestions welcome.