I have an Android application that has many user preferences. Some preferences are custom, meaning that a Preference class modifies a value a little bit. Most of the preferences have defaults, which are applied via call to PreferenceManager.setDefaultValues() that honors such custom preferences. There is a number of common usage scenarios of my application, but currently preference defaults cover only one of them. I want to ask a use about which scenario she would prefer. But I do not know how to apply defaults in the same clean and simple way based on the user choice. Any ideas?
Update
The defaults should be applied on the first run only. User is asked how he plans to use an application and defaults are applied based on his answer. He will be later able to tune each setting individually so there is no reason to reapply defaults later. And this is only a helper for users with little experience, it’s needed because I receive feedback that some settings are not obvious without having continuous experience.
I think the main question is, when should the user allowed to apply use case specific defaults (initially, any time?), and what does he expect when they will be applied (does it make any sense to switch back?, etc).
I would assume there might be dependencies regarding any underlying data which has been collected over time, and which the user expects to keep.
If you intend to support such a complex situation, then I’d see the model as three-layered: A set of use-case specific default values, a set of use-case specific changes which get applied, and the final projection (defaults overridden by adjustments). The intention here being that the user can switch back to his original use-case without losing individualized settings.
Just first thoughts without deeper knowledge of your app’s nature.
Update
In accordance with your clarification, my suggestion is to use one preference file per use case and call PreferenceManager.setDefaultValues(Context, String, int, int, boolean).