Sign in to follow this  
electrolysing

Create Public File

Recommended Posts

Hi,

 

I want my android game to be moddable which means that some files need to be accessable by the user to change. I can't expect them to root their device.

 

When I create a file with the attribute [url=http://developer.android.com/reference/android/content/Context.html#MODE_PRIVATE]Context.MODE_PRIVATE[/url] the file is created in the root directory.

 

The attribute [url=http://developer.android.com/reference/android/content/Context.html#MODE_WORLD_WRITEABLE]Context.MODE_WORLD_WRITEABLE[/url] is deprecated. So what is the alternative?

They say they made it deprecated because of security reasons (I personally can't think of any possibilities when this would be a security hole) but they haven't thought of the situation when I want to make files public for the user to access and not by other programs, as all the alternatives they list are for communication with other programs.

What is the alternative to provide public files to the user to modify?

 

Thank you very much

~AUN

Share this post


Link to post
Share on other sites
Place the data files in a user-selectable folder in "external storage" rather than your private, potentially restricted applications directory. Then the user can put it wherever they want, including the phone's storage or an SD card.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this