I have to do some stuff. I'm downloading images using web-service, after successful download of each image, I'm using "AES" encryption algorithm to encrypt that images. I'have done encryption successfully. But whenever I'm going to open Gallery of device, I am able to seen that downloaded images encrypted by me. I don't want that. I wanna secure that images that can prevent access from Gallery.
I understood the whole process here.When I am storing each image after download Gallery capture that image and store into its cache so before my encryption process may be Gallery populate that images.
-> My Encryption process : Download Image - > Store into SDCARD - > Encrypting Image - > Delete the real Image
But this is not deleting from Gallery also.
So in short I wanna secure that images that can prevent access from Gallery. Let me know your best suggestion about my process is right or wrong? May I have to do a few changes on it? or have you nice idea instead of my process ?
Thanks for your best suggestions.
You must add an empty file to your images folder called .nomedia
. This will prevent the MediaScanner from indexes images in that folder.
However, there is a bug on ICS that makes this slightly harder. On ICS, your folder must have the .nomedia
present before you add images to it, or else the images will be indexed.
Another, slightly less compliant option is to begin your folder name with a dot (something like .foldername
). As Android is UNIX based, this will make it a hidden folder, and hence not have the MediaScanner scan it.