I am developing an android application, It create some folders at starting of the application, which have images, video files and subfolder, i want to hide these folders and files at creation time. these folder should not be seen, when we access sdcard manually in device.
3 Answers
If you want to hide folder in Android or any Linux based system just add .
as prefix to folder or file name.
However if you mount your SD card on Windows machine then these folders will be visible, with the .
in front of the folder name, as a normal folder.

- 42,982
- 15
- 99
- 131

- 15,249
- 7
- 52
- 81
-
Thank for your response, it is working fine in linux system. but all folders with prefix . are showing in android device. Can we set permission for these folder so it can not be deleted by anyone, except root user??? – Himanshu Nov 15 '11 at 12:28
-
That entirely depends upon the file browser you are using and of course you can set permission to all folders that you had created but and advanced user will still be able to delete them and its not prexfix its suffix – ingsaurabh Nov 15 '11 at 12:31
So, as ingsaurabh
said correctly, a "."
is all you need. If a file name starts with it, most file browsers will not display the file. But it is not directly invisible (e.g. the Samsung stock file manager has an option to display such files and folders). So you cannot ever be sure that the user will not see the files, especially if the user uses different apps to access files on sdcard.
The only way to hide your files is the internal storage
since these files are private to your application. However it's not a good idea to store large amount of data in internal storage (it will give your app bad rating, that's for sure).
It's a good thing to stick to the guideline in the Data Storage Dev Guide, thus saving your data to the folder /Android/data/<package_name>/files/
.

- 10,215
- 4
- 49
- 90
This "." dot method doesn't have any security. Because you cann't use any password to unlock it. Any user can show hidden files and unlock it by removing "." symbol. For this reason you may use free file hide apps to protect you privacy.

- 1