Stetho-Realm is a Realm module for Stetho.
It displays Realm database content in Stetho instead of SQLite database content.
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.
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()
http://littlerobots.nl/blog/stetho-for-android-debug-builds-only/
Stetho-Realm is BSD-licensed.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。