首页 > 移动平台 > 详细

在Android Studio中查看Sqlite的方法

时间:2017-04-24 15:03:21      阅读:387      评论:0      收藏:0      [点我收藏+]

只说最好的方法,使用工具stetho:http://facebook.github.io/stetho/ 
1.在Gragle中加上如下语句:

dependencies {
    // Stetho core
    compile ‘com.facebook.stetho:stetho:1.3.1‘
    //If you want to add a network helper
    compile ‘com.facebook.stetho:stetho-okhttp3:1.3.1‘
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

2.在自己Android源代码的Application类中(如果没有就创建一个,继承自android.app.Application)的加入代码:

    @Override
    public void onCreate() {
        super.onCreate();
        Stetho.initializeWithDefaults(this);
        new OkHttpClient.Builder()
                .addNetworkInterceptor(new StethoInterceptor())
                .build();
    }
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

3.编译app,安装至手机并运行该app。 
4.打开Chrome浏览器,输入网址 
chrome://inspect 
5.检测到手机上运行的app,点击inspect链接,进入手机信息管理页面: 
技术分享 
6.在Web SQL中可以轻松查看自己的Sqlite表格,并可以输入sqlite代码进行操作。

 
 

在Android Studio中查看Sqlite的方法

原文:http://www.cnblogs.com/wangfeng520/p/6756706.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!