Search code examples
androidmemory-managementlazylist

External vs Internal memory storage . What shall i use?


I'm using a LazyList version in order to load images . It uses external storage , what is not bad . But in order to not show that files to everyone with a filebrowser in hand , i have thought to use internal memory instead , the max amount of memory for that is (5mB).

What should i do? Are there any other possibilities?‎


Solution

  • AFAIK there are no limits on internal memory per application. But, it's true, that this memory usually runs low if users have lots of apps on device so you should not use it for big (or lots of) files.

    I'd go with external memory (sd-card) and IF raw access to images is a problem, then I'd:

    1. Encrypt the file. That's heavy and it'll slow things down.
    2. Scramble the file. This involves shifting around the bytes, e.g. moving first 1000 bytes to the end of the file, etc.. You can create your own version of InputStream that does byte-shuffling, and pass it to BitmapFactory.decodeStream(..).