Menggunakan Sthetho untuk melihat data Realm Android lewat Google Chrome

install dependensi sthetho dan realmsthetho di gradle android anda

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

dan compile repository yang support realm stheto

compile 'com.facebook.stetho:stetho:1.4.1'
compile 'com.uphyca:stetho_realm:2.0.0'

Lalu buat class yang extends Apikasi android anda

new class -> NamaAplikasi

package com.cyanlabsid.namaaplikasi.app;
import android.app.Application;
import com.facebook.stetho.Stetho;
import com.uphyca.stetho_realm.RealmInspectorModulesProvider;
import io.realm.Realm;
/**
* Created by faisal on 17/05/17.
*/
public class NamaAplikasi extends Application {
    @Override
public void onCreate() {
super.onCreate();
//realm init
Realm.init(this);
//init stetho realm
Stetho.initialize(
Stetho.newInitializerBuilder(this)
.enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
.enableWebKitInspector(Stetho.defaultInspectorModulesProvider(this))
.enableWebKitInspector(RealmInspectorModulesProvider.builder(this).build())
.build());
}
}

Tambahkan nama di AndroidManifest.xml bagian <application></application>

<application
android:name="namaaplikasi"

Setelah itu buka di chrome chrome://inspect

Setelah itu pilih resource-> Web SQL -> default.realm

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.