OnePill本地保存用户的结构

sharedPreferences存储的数据

  1. int Code code

表示当前用户的类别:医生为1,用户为2.

  1. Sting user user

存储当前user的json字符串

  1. String doctor doctor

存储当前doctor的json字符串

  1. List userList userList

存储登陆过的用户列表

  1. List doctorList doctorList

存储登陆过的医生列表

sharedPreferences包含的方法

  1. 获取SharedPreferences对象 SharedPreferences getShared(Context context,String file)

  2. 获取Edit SharedPreferences.Editor getSharedEdit(Context context,String file)

  3. 保存User boolean saveUser(Context context, UserPatient userPatient)

  4. 保存Doctor boolean saveDoctor(Context context, UserDoctor userDoctor)

  5. 判断User是否存在 boolean userExist(Context context)

  6. 断Doctor是否存在 boolean doctorExist(Context context)

  7. 删除User boolean delUser(Context context)

  8. 删除Doctor boolean delDoctor(Context context)

  9. 获取userList List<UserPatient> userList(Context context)

  10. 获取doctorList List<UserDoctor> doctorList(Context context)

posted @ 2020-04-18 21:01  两小无猜  阅读(119)  评论(0编辑  收藏  举报