I am developing android application which having some external files. I want to hide these files. Can we access hidden file in my app. Example I have many of images which will be use in my app. I want to hide these file but access only using my app.
Hit the three vertical lines at the top left. Tap “Settings.” Enable (to show) or disable (to hide) the “Show hidden files” option. That's it.
Launch File Explorer and navigate to the location of the targeted file or folder. Click on the file/folder and choose Properties from the context menu. In the Properties dialog, head over to the General tab and checkmark the box associated with Hidden under the Attributes section. Click Apply > OK.
Just put a .
in front of your folder name than it becomes a hidden folder
Android is multi user linux system, so if you create folder starting with dot
, it'll be hidden.
So store folder starting with dot
for example
File folder = new File(Environment.getExternalStorageDirectory(), ".hiddenFolder");
folder.mkdir();
and store all images in this folder and access images in your app from same folder.
Create a folder with a . (dot) before its name, and add an empty .nomedia file inside it. (.(dot)nomedia - exactly as I typed it) and add your files ands images there.
Now other Apps like Gallery will ignore these images. That's the only way that I think this can be done.
E.g.: folder name: .images
which includes an empty file .nomedia
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With