从 Android Studio 浏览 SQLite 数据库 [英] Browse SQLite database from Android Studio

查看:40
本文介绍了从 Android Studio 浏览 SQLite 数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有任何适用于 Android Studio 的 SQLite 插件可以让用户浏览创建的数据库?

解决方案

2020 年 7 月更新

借助 Android Studio 4.1(Canary 6 及更高版本),您可以使用新的数据库检查器检查、查询和修改应用的数据库.

您可以在此处找到

  • http://facebook.github.io/stetho/

  • I would like to know is there any SQLite plugin for Android Studio which will allow user to browse the created database?

    解决方案

    UPDATE July 2020

    With Android Studio 4.1 (Canary 6 and higher), you can inspect, query, and modify your app's databases using the new Database Inspector.

    You can find the official doc here.


    Currently there isn't an official plugin for DB Inspection in your apps.

    • You can use the DDMS : Tools > Android > Android Device Monitor as described in @Subhalaxmi's answer

    • There is a beta plugin provided by idescout that you can try here.

    • There is the Stetho tool (open source and free) provided by Facebook

    I suggest you using the Stetho open-sourced tool provided by Facebook. It is simple to implement and very powerful.

    Just add the dependencies in your build.gradle

    dependencies {
        // Stetho core
        compile 'com.facebook.stetho:stetho:1.3.1'       
    
        //Optional network helper
        compile 'com.facebook.stetho:stetho-okhttp:1.3.1'       
    }
    

    Then just initialize the tool in your Application class:

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

    Finally just open Chrome on your pc and navigare in chrome://inspect.

    Here you can display the database in the app (with read/write capabilities), and you can run queries.

    You can find more info about Stetho here:

    这篇关于从 Android Studio 浏览 SQLite 数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆