问题
In my application I have to keep some setting options for a user, like currency type, language, Calendar view (Either Calendar or List) etc.
Here I am confused whether I have to configure all this by creating database tables or should keep this in any xlm or text file. Please guide if there any more convenient way? thanks.
回答1:
you can use android shared preferences to store a users preferences. Alternatively you can store "global" variables if you create a Application instance which has static or instance variables to access (but these values can be lost if your Activity is destroyed)
The answer on this thread has details on global application to store application wide variables
Hope that helps
回答2:
Android has Shared Preference specifically for this purpose. http://developer.android.com/reference/android/content/SharedPreferences.html
回答3:
The solution would be to use shared preference
You can also look into PreferenceActivity which helps in building a setting page.
来源:https://stackoverflow.com/questions/5699310/how-to-configure-application-settings-in-android