Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create hidden folders

I want to create some hidden folders like photo hide app and hide the selected image from gallery or camera to selected hidden folder.i googled a lot but i couldn't find any solution.please find me a solution.. Thanks in advance

like image 807
jay Avatar asked Dec 14 '22 23:12

jay


2 Answers

my requirement is when i add files to hidden folder those should not be shown in gallery but hidden folders and files should be shown only in my application..

  1. To create hidden folders or files follow Hamid S. instructions:

    File file = new File(Environment.getExternalStorageDirectory().getPath() + "/.Image/");
    file.mkdirs();
    
  2. To prevent the eg. gallery app from showing pictures within /.Image/, create the additional (empty) file .nomedia

This prevents media scanner from reading your media files and providing them to other apps through the MediaStore content provider. However, if your files are truly private to your app, you should save them in an app-private directory.

like image 110
Max Avatar answered Dec 31 '22 13:12

Max


To create hidden folder or file use Dot (.) that folder or file name.

Suppose, you want create a folder named Image which will be hidden then create as follows...

File file = new File(Environment.getExternalStorageDirectory().getPath() + "/.Image/");
file.mkdirs();
like image 36
Hamid Shatu Avatar answered Dec 31 '22 13:12

Hamid Shatu