Having more than one Shared Preference file in Android

android, sharedpreferences

Solution

Yes you can maintain as many shared preference files for an app as you can. Just define separate classes for each of them.

Problem

Is it possible to have more than one SharedPreference file in Android and if so how would I go about setting it up? I plan for the first SharedPreference to store around 7 values which will not be user based values. The second SharedPreference would contain user based values. In this case if the user signed out from my application only the SharedPreference containing user based values would be cleared.

Original source

Related problems