I develop an application for Android.
I store files in internal storage with method :
getDir("myfolder", Context.MODE_WORLD_READABLE)
Then, I create a file :
File myFile = new File("myFile");
myFile.createNewFile();
But when I explorer my internal storage (with “File Explorer” or “ADB”) I see that “myFile” is created but it doesn’t 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 File API, I see “setReadable” method which can set readable right to me and world, but this methos is only for API level 9, and I am developing for API level 7 and more.
Here it’s a problem because i don’t have permission to read the file “myFile” thanks to ADB or File Explorer. I get error “Permission denied” and I don’t want to “root” my device because of risks.
Any help ?
I think you can do the same on the file:
http://developer.android.com/reference/android/content/Context.html#openFileOutput%28java.lang.String,%20int%29 (available since API level 1)
HTH