开发者

How to configure application settings in android?

In my application I have to keep some setting options for a user, like currency type, language, Calendar view (Either Calendar or List) etc开发者_C百科.

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.


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


Android has Shared Preference specifically for this purpose. http://developer.android.com/reference/android/content/SharedPreferences.html


The solution would be to use shared preference

You can also look into PreferenceActivity which helps in building a setting page.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜