6DataStorage0.pptxVIP

  • 1
  • 0
  • 约5.29千字
  • 约 31页
  • 2017-04-26 发布于上海
  • 举报
6DataStorage0

6. Data Storage;Shared Preference Internal Storage External Storage SQL Lite Content Provider;Traditional OS : File System Organized using tree view Files have permission : 777 Android All files are private to app Provide APIs to access by other app;Store private primitive data in key-value pairs Accepted data type: boolean, float, int, long, and string Useful for storing user preferences;SharedPreferences sp = MainHello.this.getSharedPreferences(hello, 0); int age = sp.getInt(“Age”, 0); // read SharedPreferences.Editor ed = sp.edit(); // write ed.putString(Name, mike); ed.putInt(Age, 33);

文档评论(0)

1亿VIP精品文档

相关文档