External vs Internal memory storage . What shall i use?
Asked Answered
I

3

1

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?‎

Inspissate answered 11/1, 2012 at 8:1 Comment(0)
O
5

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(..).
Outcurve answered 11/1, 2012 at 8:15 Comment(3)
i don't need a very secure space , but you have light me with that internal memory is not for many/big files. +1 for complete answer.Inspissate
@Peter Knego : Can you please comment on this thread which says memory limit ranges between 16 to 48 MB per app as seen in Android code: #8816474 ; Thanks !Ancalin
@Ancalin obviously the thread you are referring to is talking about "memory", RAM while this thread talks about "storage space"(although colloquially people might refer to it as "internal/external memory"). They are not the same thing. (eg. The basic difference between harddrive space and memory).Churinga
R
2

Internal memory should be used for small things that you don't want anyone to tamper with. The external memory (usually an SD card) can be accessed by other apps and by the user. As a side note, internal memory is "expensive" and users tend to uninstall apps that take up a lot of internal memory.

With external memory, just make sure you're checking that it is in fact available. The SD card could be missing, ejected, mounted or even non-existant (not all Android devices have that).

Access speeds vary. I know for a fact that some Samsung devices have rather slow external storage while their internal storage is very fast.

An alternative option would be to load your images from the network. That would also allow you to control them should you need to change them in the future. Hosing them on Amazon S3 would cost about a few cents a month.

Robalo answered 11/1, 2012 at 8:9 Comment(2)
load images from network is what i use , but i save it in sdcard cause they are many and it's not a nice user experience to load images each time listview remember to run to that list image.Inspissate
If all you're doing is caching then I'd suggest using the external storage. Worse case, if the external storage isn't available just reload from the network.Robalo
C
1

If ou dont want everyone with a filebrowser to see your files, you can make a folder with a dot before it like this "/sdcard/.hidden" But if they toggle display hidden files and folders you less lucky.

heres a link to Android page about storing data

Hope this helps

Caterer answered 11/1, 2012 at 8:8 Comment(1)
Basic *nix file hiding is a great way to do this. It's highly recommendable, though, that people do not enable the option to see hidden folders and files for their own safety.Introspection

© 2022 - 2024 — McMap. All rights reserved.