Create Folder that can not accessible by any other application

半腔热情 提交于 2020-01-14 05:25:12

问题


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



来源:https://stackoverflow.com/questions/5632769/create-folder-that-can-not-accessible-by-any-other-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!