3

I created an Android app sometime ago. What the app does is basically download a list of files (images and videos) and play them in a loop (like a Playlist).

These files are saved in the default Android External Storage Directory. I get it using this method:

Environment.getExternalStorageDirectory().getAbsolutePath();

Until now I never had storage problems but testing the app on an old device (which has less storage capacity) I realised that I have a problem when the files (PlayList) size is bigger than the device storage capacity.

I have thought (and research) about using an USB stick, but I don't think that would be a good solution since I cannot know 100% sure the USB path (it can be different for each device).

Any ideas about how handle this problem? Maybe another solution instead of using the USB ?

Here is what I have researched:

How to access USB Path in android?

How to find USB storage path programmatically?

android How to write files to a usb memory?

Community
  • 1
  • 1
Ale
  • 2,282
  • 5
  • 38
  • 67
  • you can use libraries like picasso to handle image download and caching which I think better solution for you – Pooya Apr 21 '16 at 12:24
  • Hey @Pooya thans for your comment. We are not talking about a OOM error, that's fine I already use Picasso for that. The problem is that the files I need to download are bigger than my device storage capacity – Ale Apr 21 '16 at 12:38

1 Answers1

0

Do you need to store the actual images and videos on the device - why not just store their location and get them dynamically. I've not used a recyclerView but I thought that it could do something like this, but could be wrong.

Richard Goodman
  • 307
  • 3
  • 7
  • I need to store the files on the device memory because the `app` should work in offline mode. So the user sync the data (download the files from a server), store the data on the device and it should work without internet connection. – Ale Apr 21 '16 at 10:17
  • Btw it doesn't have anything to do with a RecyclerView or ListView. But thanks for taking the time to read and answer, really appreciate it :) – Ale Apr 21 '16 at 10:18