Specification for using SharedPreferences in Android projects

1、 What is SharedPreferences from?

SharedPreferences is one of the four Android data storage technologies (SharedPreferences, SQLite, content provider and file). SharedPreferences handles a key value (key value pair), which is often used to store some lightweight data.

(the official website is the best place to learn Android)

Official website link: http://developer.android.com/reference/android/content/SharedPreferences.html

2、 Simple use

1. Create a sharecontents class to store the key of key value

2. Create a sharemanager class to uniformly manage the get and set methods of SharedPreferences, which is equivalent to setting or the value of key value.

3. Demo of SharedPreferences

You can find the demo of this section here

Link to this article: http://www.cnblogs.com/liqw/p/4148411.html

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>