Git Product home page Git Product logo

speasy's Introduction

SpEasy

项目介绍

安卓存储工具SharedPreferences的orm封装,通过对对象的操作,完成数据的读取和存储,简单好用,存储和读取只需要一句话调用!

软件架构

SharedPreferencesUtil:简单封装的工具类,可以直接使用,但是每次操作都需要自己处理异常; SharedPreferencesTrait:封装对象,所有模型类文件都要继承自这个类才有效; SpEasy:最终封装结果,在Application中初始化之后,可以做到一行代码存储,一行代码读取数据,通过操作对象,完成数据的操作;

使用教程

  1. 下载speasy文件夹中的三个文件,copy到你的项目中;
  2. 在Application中进行初始化,在初始化时如果不指定全局的异常处理,就会默认调用一个空的异常处理; SpEasy.init(this,this);或者SpEasy.init(this); 初始化示例图
  3. 书写一个模型类,并且继承自SharedPreferencesTrait类,赋予其参数的get和set方法; 模型类
  4. 通过操作类来存储和删除数据 存储数据 查询数据
  5. 如果需要处理结果,可以使用封装的commit提交的方法putxxx(),这类方法带有boolean的返回值,表示是否存储成功;

注意事项

  1. 进行数据存储和查询之前必须进行初始化操作,不然会报空指针;
  2. 目前对Set没有支持,后面再加,支持其他基本类型{String,int,long,boolean,float};
  3. 后面预计增加Config配置类,把一些写死的东西规整到配置类信息中;

联系我

  1. 码云:@zFox
  2. GitHub:jy231613
  3. CSDN:https://blog.csdn.net/qq_36676433
  4. wechat:jy271613
  5. QQ:2757525207

speasy's People

Contributors

jy231613 avatar

Stargazers

 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.