Create Folder that can not accessible by any other

2019-06-03 06:50发布

问题:

i want to create a one folder that can not accessible by any other application.

Is it possible to do this ? If yes then give me the solution how to achieve this functionality.

回答1:

Use internal storage like so:

String FILENAME = "hello_file";
String string = "hello world!";

FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);
fos.write(string.getBytes());
fos.close();


回答2:

Check out Using the Internal Storage to use the storage that is private to your app.



回答3:

On the SD card (without a rooted phone) you can't create a folder which is only accessible by your application.

But everything you write to your "internal storage" is only accessible by your application. see http://developer.android.com/guide/topics/data/data-storage.html#filesInternal