views:

39

answers:

2

I downloaded a file with an app and stored it inside of its internal storage, but the file is set with -rw------- and I want to change those permissions so is it possible? I know that using external storage is an option but I want to know if I can do it with internal storage too. Thanks for the help.

Edit: If it turns out that I can't change the permission is there some shared region of internal storage that I could use? I would like to not force the Android device user to have an SD card.

+1  A: 

Internal storage is always private to your application.

Yann Ramin
A: 

I found out that the follow bit of code will change the permissions on the file based on what you set the second parameter to be.

FileOutputStream fileOutput = openFileOutput("myApp.apk", Context.MODE_WORLD_READABLE);

The four options for the second parameter are: MODE_PRIVATE, MODE_APPEND, MODE_WORLD_READABLE, and MODE_WORLD_WRITEABLE.

Anton