Can I Write To Android Sharedpreference For A Different Package?
I've written a game which I intend to upload to the marketplace as a free demo, and I intend to offer a full version for a buck. I'd like to make the download for the full version
Solution 1:
Android sharedpreferences for an application come in 4 modes.
MODE_PRIVATE is used the most and only internal to the app
MODE_WORLD_READABLE is used if you want your preferences to be read by another application
MODE_WORLD_WRITEABLE is deprecated API 17 onwards.
MODE_MULTI_PROCESS can be modified by multiple processes.
When an application wants to write preferences,it is called by
Context.getSharedPreferences (String name, int mode)
.
So it is possible to read the preferences.But to write it that particular app should be using MODE_WORLD_WRITEABLE
which is deprecated.
Moral:You cannot alter the preferences of other applications.
And you really should not want to do it either
Post a Comment for "Can I Write To Android Sharedpreference For A Different Package?"