ObjectBox 文件存储查看

方便简单的查看 ObjectBox data.mdb 数据。

Object Box 是个好东西,效率很棒,我估计迟早会取代 GreenDao,可是查看存储的内容却非常不方便,找了一下还没找到什么好用的,那只能自己写一个喽。

GitHub 原文:https://github.com/renyuzhuo/rviewer

RViewer

A library to check the data saved by ObjectBox.

Getting started

In your build.gradle:

 dependencies {
   debugCompile 'cn.renyuzhuo.rviewer:rviewer:1.0.2'
   releaseCompile 'cn.renyuzhuo.rviewer:rviewer-no-op:1.0.2'
 }

In your Application class:

public class App extends Application {

    private BoxStore boxStore;
    private static App app;

    @Override
    public void onCreate() {
        super.onCreate();
        boxStore = MyObjectBox.builder().androidContext(this).build();
        app = this;

        ArrayList<Class> classes = new ArrayList<>();
        classes.add(Note.class); // Your Entitys
        ObjectViewBoxManager.getInstance().init(boxStore, classes);
    }
}

Notice: You Should all Add toString() like:

    @Override
    public String toString() {
        return "Note{" +
                "id=" + id +
                ", text='" + text + '\'' +
                ", date=" + date +
                '}';
    }

All the things is done.

operation.gif

Thanks

ObjectBox-viewer

License

MIT

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。