摘要:
这种存储方式是用来保存用户的设置的参数的重点关键字SharedPreferences preferences = context.getSharedPreferences("zhao", Context.MODE_PRIVATE);获取一个SharedPreference获取编辑器Editor editor = preferences.edit();private Context context;public PreferenceService(Context context) {this.context = context;}public void save(String 阅读全文
摘要:
重点关键字InputStream xml = getClass().getClassLoader().getResourceAsStream("person.xml"); 获取包下文件XmlPullParser parser = Xml.newPullParser(); 实例化pull parser.setInput(xml, "UTF-8"); 设置读取位置parser.getName()获取标签名称parser.getAttributeValue(0)获取标签第一个属性值parser.nextText()获取标签值public static List 阅读全文
摘要:
Environment管理外存储设备向SD卡输出文件,Environment.getExternalStorageDirectory().toString()SD卡路径File file = new File(new File(Environment.getExternalStorageDirectory().toString()),filenametext); FileOutputStream outStream = new FileOutputStream(file); outStream.write(filecontenttext.getBytes()); outStream.clos. 阅读全文