Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to hide photos from gallery and store it in my app

I am developing an android application where it will select some photos from the gallery and hide them,

i am able to select particular picture from gallery and store it in my app and delete it from gallery,but a person can see those pictures if he opens my app folder in sdcard ,so how do i store them such that even if a person checks my sdcard then he should not be able to detect those pictures ?

like image 881
Mahantesh M Ambi Avatar asked Nov 07 '12 12:11

Mahantesh M Ambi


People also ask

How do I store private photos?

If your phone or device doesn't already have a feature to hide photos, you can still keep them stored safely on your own. A password-protected folder on your device or even external storage like an SD card or USB drive can be a safe place to store photos once you're done editing and sharing them.

How do you hide and save photos?

Go to the Photos app and open the image to be hidden, or select multiple images to be hidden. In the bottom-left corner, tap the "Share" icon, which looks like a box with an arrow sticking up out of it. On the bottom taskbar, scroll down and select the "Hide" option, beside an icon of a crossed-out eye.

How do I hide photos in the apps library?

So, you can simply hide them. Go to photos, and click on the video or the photo that you want to hide. Tap the share button with the upward arrow, and then tap Hide.


2 Answers

If you want to prevent Gallery from showing images from your app's folder, you can put a file named .nomedia in that folder.

Source: https://stackoverflow.com/a/6713863/450534

If you want to hide the folder from apperaring in say, a File Manager, then ensure your folder starts with a period (.). For example, if the folder is called myfolder, it should be created as .myfolder

Source: https://stackoverflow.com/a/5878270/450534

Please note, that a user can change the settings of the File Manager to show hidden files and folder. For that, there is no solution.

like image 138
Siddharth Lele Avatar answered Nov 04 '22 12:11

Siddharth Lele


The only secure way to do this is to encrypt the image data yourself and remove the original files, leaving only your application able to decrypt the files.

Take a look at How to encrypt file from SD card using AES in Android? to see how this can be done.

As an additional step, you can also use any number of the other answers to hide the encrypted files

like image 29
Guykun Avatar answered Nov 04 '22 11:11

Guykun