首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用windows的stetho领域查看领域数据库

如何使用windows的stetho领域查看领域数据库
EN

Stack Overflow用户
提问于 2017-02-06 01:16:52
回答 1查看 1.6K关注 0票数 0

我很难用Stetho浏览器查看我的领域数据库。我看了这个堆叠溢出的答案,到了第二个链接中的图像点。在上面写着检查的地方,我的电脑上什么都没有。它只显示没有检查按钮的模拟器的名称。我以前能得到检查按钮,但它一直没有工作。如果有人能帮忙的话,我们会非常感激的!

远程目标

本地宿主

为x86 #模拟器构建的Android 5554

如何在领域浏览器中查看我的领域文件?

https://i.stack.imgur.com/qWtv2.png

编辑

App Build.gradle

代码语言:javascript
复制
    apply plugin: 'com.android.application'
    apply plugin: 'realm-android'

android {
compileSdkVersion 25
buildToolsVersion "24.0.2"

defaultConfig {
    applicationId "com.example.android.chargerpoints"
    minSdkVersion 17
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

ext {
supportLibVersion = '25.0.0'
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.1.0'
compile "com.android.support:appcompat-v7:${supportLibVersion}"
compile "com.android.support:design:${supportLibVersion}"

// Gradle dependency on Stetho
compile 'com.facebook.stetho:stetho:1.4.1'
compile 'com.uphyca:stetho_realm:2.0.0'


}

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

项目build.gradle

代码语言:javascript
复制
buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.2.3'
    classpath "io.realm:realm-gradle-plugin:2.3.0"

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files

}
}

allprojects {
repositories {
        jcenter()
    }
}

task clean(type: Delete) {
delete rootProject.buildDir
}

MyApplication.java

代码语言:javascript
复制
package com.example.android.chargerpoints;

import android.app.Application;

import com.facebook.stetho.Stetho;
import com.uphyca.stetho_realm.RealmInspectorModulesProvider;

import io.realm.Realm;
import io.realm.RealmConfiguration;

public class MyApplication extends Application{

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

    Realm.init(this);

    RealmConfiguration config = new RealmConfiguration.Builder()
            .name("Chargers.realm")
            .schemaVersion(1)
            .build();

    Realm.setDefaultConfiguration(config);

    // Use the config
    Realm realm = Realm.getInstance(config);

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

    realm.close();
}
}

AndroidManifest.xml

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.chargerpoints">

<application
    android:name= "MyApplication"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity android:name=".CouponsActivity"
        android:label="@string/title_coupons"
        android:parentActivityName = ".MainActivity">
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value=".MainActivity"/>
    </activity>

    <activity android:name=".MyDealsActivity"
        android:label="@string/title_my_deals"
        android:parentActivityName=".MainActivity">
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value=".MainActivity"/>
    </activity>

    <activity android:name=".IndividualCouponActivity"
        android:label="@string/title_individual_coupon"
        android:parentActivityName=".MainActivity">
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value=".MainActivity"/>
    </activity>

    <activity android:name=".HelpActivity"
        android:label="@string/title_help"
        android:parentActivityName=".MainActivity">
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value=".MainActivity"/>
    </activity>

    <activity android:name=".RedeemedCouponActivity"
        android:label="@string/title_redeemed_coupon"
        android:parentActivityName=".MainActivity">
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value=".MainActivity"/>
    </activity>

</application>

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-02-08 17:48:31

你似乎把两件事混为一谈: Stetho和领域浏览器。领域浏览器是用于查看领域数据库的OSX实用程序。如果您正在使用OSX,请从App获取浏览器,然后使用亚行从您的设备/模拟器中提取数据库,如所述的这里

如果不使用OSX,则可以使用这个图书馆从设备/模拟器本身浏览数据库。

最后,有一个用于领域的Stetho插件,这里。要使用它,您必须将它与Stetho库一起添加到应用程序中。这两个库的文档都很好。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42059175

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档