Android -- SharedPreferences
1. Storage information: // name of the xml file used for storage in the name table. If it does not exist, it is automatically created. mode operation permission 0 is the default operation permission SharedPreferences settings = getSharedPreferences (String name, int mode); // The file enters the editing state SharedPreferences. editor editor = settings. edit (); // The key is the project name, the value is the value of the project, and the xml node and value editor. putString (String key, String value); // submit the modification editor. commit (); 2. Read Information: SharedPreferences settings = getSharedPreferences (String name, int mode); // key indicates the project name, And defValue indicates that the phase is not obtained. Default Value: String mPreferences = settings. getString (String key, String defValue); it stores key-value pair data based on XML files and is usually used to store some simple configuration information. Its storage location is in the/data/<package name>/shared_prefs directory.