I am developing an Android application.
I store files in internal storage using the method:
getDir("myfolder", Context.MODE_WORLD_READABLE)
Then I create a file:
File myFile = new File("myFile"); myFile.createNewFile();
But when I browse my internal storage (using "File Explorer" or "ADB"), I see that "myFile" is created, but it does not have the same rights as "myFolder":
drwxrwxr-x app_88 app_88 2011-11-10 15:39 myFolder -rw------- app_88 app_88 0 2011-11-10 15:39 myFile
In the API files, I see the setReadable method, which can be readable for me and for the whole world, but this method is used only for API level 9, and I am developing for API level 7 and more.
This is the problem here because I do not have permission to read the file "myFile" thanks to ADB or File Explorer. I get the “Permission denied” error message and I don’t want to “root” my device because of the risks.
Any help?
source share