如何查看保存在android数据库(SQLite)中的数据? [英] How to view data saved in android database(SQLite)?

查看:43
本文介绍了如何查看保存在android数据库(SQLite)中的数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以从 eclipse(来自 file explorer)查看数据库,但我想查看整个细节,我的意思是我插入的数据,但我无法查看.我在 F Drive 上安装了完整的 Android.

解决方案

您可以使用模拟器的 DDMS 访问此文件夹.除非您拥有已获得 root 权限的设备,否则您无法在真实设备上访问此位置.

您可以在 Eclipse 中查看表结构和数据.步骤如下

  1. 为 Eclipse 安装 SqliteManagerPlugin.如果您已经拥有,请跳至第 5 步.
  2. 此处
  3. 将*.jar文件放到eclipse/dropins/文件夹下
  4. 重启eclipse
  5. 在 eclipse 的右上角,单击 DDMS 图标
  6. 在左侧面板中选择合适的模拟器
  7. 在主面板的文件资源管理器选项卡中,转到/data/data/[YOUR.APP.NAMESPACE]/databases
  8. 在 DDMS 图标下方,当您选择数据库时,应该有一个新的蓝色数据库图标亮起.单击它,您将看到 Questoid Sqlite Manager 选项卡打开以查看您的数据.

*注意:如果数据库没有亮起,可能是因为您的数据库没有 *.db 文件扩展名.确保您的数据库名为 [DATABASE_NAME].db

*注意:如果你想使用没有 .db-Extension 的数据库:

  1. 下载这个 Questoid SqLiteBrowser:http://www.java2s.com/Code/JarDownload/com.questoid/com.questoid.sqlitebrowser_1.2.0.jar.zip

  2. 解压并放入 eclipse/dropins(不是插件)

查看更多信息

I am able to view the database from eclipse(from file explorer), but I want to view the whole detail, I mean the data that I have inserted, which I am unable. And my complete Android installation has made on F Drive.

解决方案

You can access this folder using the DDMS for your Emulator. you can't access this location on a real device unless you have a rooted device.

You can view Table structure and Data in Eclipse. Here are the steps

  1. Install SqliteManagerPlugin for Eclipse. Jump to step 5 if you already have it.
  2. Download the *.jar file from here
  3. Put the *.jar file into the folder eclipse/dropins/
  4. Restart eclipse
  5. In the top right of eclipse, click the DDMS icon
  6. Select the proper emulator in the left panel
  7. In the File Explorer tab on the main panel, go to /data/data/[YOUR.APP.NAMESPACE]/databases
  8. Underneath the DDMS icon, there should be a new blue icon of a Database light up when you select your database. Click it and you will see a Questoid Sqlite Manager tab open up to view your data.

*Note: If the database doesn't light up, it may be because your database doesn't have a *.db file extension. Be sure your database is called [DATABASE_NAME].db

*Note: if you want to use a DB without .db-Extension:

  1. Download this Questoid SqLiteBrowser: http://www.java2s.com/Code/JarDownload/com.questoid/com.questoid.sqlitebrowser_1.2.0.jar.zip

  2. Unzip and put it into eclipse/dropins (not Plugins)

Check this for more information

这篇关于如何查看保存在android数据库(SQLite)中的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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