Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android move to SD card behavior

I have an application that downloads most of the resources from the internet during run time. Most of those resources are images.

I don't want the user to see those images in the gallery application or in any other application. This requirement is crucial to me since:

  1. I'm tracking which resource was downloaded and which need to be download later.
  2. All those resources would be meaningless to the user and would irritate him.
  3. I don't want the user or any other application to delete those images

Note: I'm aware to the fact that rooted users can do what ever they want and I don't care that those user will mess up the app.

To fulfill those requirements I used the internal storage and it works exactly as I expected and as needed.

I do let the user to move my application to the SD card, But:

  1. what is happening to all the files that I saved in the internal storage and to the DB?
  2. Are they all moving to the SD card with the application? Do they stay in the internal storage?

I believe that they do stay in the internal storage, but I haven't found any documentation for it.

And after I'll understand the behavior it raise few other questions. The only requirement that I have is that the resources would be downloaded from the internet and that the user won't see them in any other application. I don't really care where those files are being saved, I think that if the user decides to move the application to the SD card it is since he has lack of memory in the internal storage, therefor I should transfer all my resources to the SD card.

  1. Can i save something on the SD card without those files to be public for all?
  2. What is the best way to handle this situations?
  3. What option do I have to handle this situation?
  4. Can I know if the app is installed on the SD card or on the internal storage?

I would thank you all for all your insights and recommendations.

like image 286
nheimann1 Avatar asked Oct 10 '22 10:10

nheimann1


1 Answers

Regarding the images not being visible in the Gallery App, you should put a .nomedia file into the folder that contains your images. Example: image permissions (don't want them in gallery)

Regarding the app to SD feature, I also wanted to have info on the subject, so I cannot help you :)

Useful answer: https://stackoverflow.com/a/3687467/334493

like image 190
Benoit Duffez Avatar answered Oct 13 '22 09:10

Benoit Duffez