1 Star 0 Fork 0

张龙智 / stetho-realm

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Stetho-Realm

Stetho-Realm is a Realm module for Stetho.

It displays Realm database content in Stetho instead of SQLite database content.

Set-up

Download

grab via Gradle:

repositories {
    maven {
        url 'https://github.com/uPhyca/stetho-realm/raw/master/maven-repo'
    }
}

dependencies {
    compile 'com.facebook.stetho:stetho:1.5.0'
    compile 'com.uphyca:stetho_realm:2.1.0'
}

Stetho-Realm 2.0 supports Stetho 1.1 or newer and Realm 2.0.0 or newer. If you'd like to use Stetho-Realm with Realm 0.80.0 to Realm 1.2.0, please use the latest version of Realm 0.x.

Integration

In your Application class, please initialize Stetho with RealmInspectorModulesProvider.ProviderBuilder as follows.

RealmInspectorModulesProvider.ProviderBuilder appends Realm module. You can use RealmInspectorModulesProvider.ProviderBuilder#baseProvider(InspectorModulesProvider) in order to customized InspectorModulesProvider instead of default provider.

public class MyApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();

        Realm.init(this);

        Stetho.initialize(
                Stetho.newInitializerBuilder(this)
                        .enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
                        .enableWebKitInspector(RealmInspectorModulesProvider.builder(this).build())
                        .build());
    }
}

By calling some methods in RealmInspectorModulesProvider.ProviderBuilder, you can include metadata table in table list, and can provide database file name pattern. And also you can specify base folder for database files, encryption keys, limit, sort order.

    RealmInspectorModulesProvider.builder(this)
            .withFolder(getCacheDir())
            .withEncryptionKey("encrypted.realm", key)
            .withMetaTables()
            .withDescendingOrder()
            .withLimit(1000)
            .databaseNamePattern(Pattern.compile(".+\\.realm"))
            .build()

use Stetho in debug build only

http://littlerobots.nl/blog/stetho-for-android-debug-builds-only/

License

Stetho-Realm is BSD-licensed.

TODO

  • coexistence with SQLite module.
  • implementation of update, delete, etc.

deployment memo

  1. update version information
  2. ./gradlew clean assemble :stetho_realm:publishMavenPublicationToMavenRepository
  3. git add, commit, push (on master branch)

空文件

简介

暂无描述 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/rightGuy/stetho-realm.git
git@gitee.com:rightGuy/stetho-realm.git
rightGuy
stetho-realm
stetho-realm
master

搜索帮助