轻量级数据库储存
1.创建 getSharedPreferences
SharedPreferences settings = getSharedPreferences(“setting”, 0);
//2、让setting处于编辑状态
SharedPreferences.Editor editor = settings.edit();
//3、存放数据
editor.putString(“name”,”ATAAW”);
editor.putString(“URL”,”ATAAW.COM”);
//4、完成提交
editor.commit();
B、读取数据信息
//1、获取Preferences
SharedPreferences settings = getSharedPreferences(“setting”, 0);
//2、取出数据
String name = settings.getString(“name”,”默认值”);
String url = setting.getString(“URL”,”default”);