My application is used for security purpose. so, from my application user captures photos that all photos are stored in a folder that folder should not access from any other app
Try following solution:
How to store a file in Hidden mode
Although it is not exactly what you want and I doubt whether it is possible or not. The best option would be to make it hidden but that also works with constraint (works for linux and not for Windows, still other applications can access the folder)
How to hide the folder of sdcard in android
How to make a file hidden in android sd card?
Its not possible to give no access to that folder when device connected to pc.. Also its not possible on sdcard also, But you can use different format for images that can be opened only from your application, or you can encrypt images. Or if you want to hide images from showing them into gallery, you can put a blank file with name as ".nomedia" in your folder. But its not possible cause if u read docs about WRITE_EXTERNEL_STORAGE permission you will understand what I am saying. :)
According to this guide, you can save files directly on the device's internal storage. By default, files saved to the internal storage are private to your application and other applications cannot access them (nor can the user). When the user uninstalls your application, these files are removed. For example:
String FILENAME = "hello_file";
String string = "hello world!";
FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);
fos.write(string.getBytes());
fos.close();
MODE_PRIVATE will create the file (or replace a file of the same name) and make it private to your application. Other modes available are: MODE_APPEND, MODE_WORLD_READABLE, and MODE_WORLD_WRITEABLE.
The only way, AFAIK is to encrypt
the files that you store. There is no way to prevent users mount the sdcard to access every file stored in it.
according to this related question, you can only create protected files in internal storage (not on the SD)...
Create Folder that can not accessible by any other application