如何利用现有的SQLite数据库在Android模拟器? [英] How access existing sqlite database on Android Emulator?

查看:295
本文介绍了如何利用现有的SQLite数据库在Android模拟器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,即时通讯新与Android中数据库的工作,而我似乎无法弄清楚如何查看创建数据库。

So im new to working with databases in android, and I cant seem to figure out how to view a created database.

我创建的数据库适配器类: http://pastebin.com/UevBHMJ7 在我的主要活动类: http://pastebin.com/amWEX5Rz

I created the database adapter class: http://pastebin.com/UevBHMJ7 and in my main activity class: http://pastebin.com/amWEX5Rz

我运行在一个没有问题的模拟器,但我怎么查看其中的内容? 这本书即时阅读写着使用DDMS检查Android设备/模拟器的文件系统....数据库下的数据库文件夹中创建 并具有在Eclipse中的数据库文件夹中的数据库的图像。 我不知道是什么的第一部分的真正含义(使用DDMS?),而且不知道哪里/数据/数据​​文件夹是,人们提了。

I run it in the emulator with no issues, but how do I view the contents? The book im reading says "examine the file system of the Android device/emulator using DDMS....the database is created under the database folder" and has an image of the database under a database folder in Eclipse. I dont know what the first part really means (using DDMS?) and have no idea where the /data/data folder is that people mention.

运行,即使在SQLite3的CMD并键入.tables不会产生任何的数据库。

Even running SQLite3 in CMD and typing ".tables" doesn't yield any database.

对于任何人谁可能是同样的问题,因为我是,在Eclipse中转到窗口>打开Persepective>其它> DDMS。导航到像从下面的答案图像数据库,选择数据库,然后点击floppydisk图标拉从设备的文件右上角。

For anyone who might be in the same problem as I was, In Eclipse Go to Window>Open Persepective>Other>DDMS. Navigate to the DB like the image from the answer below, select the database then click on the floppydisk icon to pull the file from the device on the top right.

推荐答案

在模拟器,DDMS中的位置应该是在文件浏览器选项卡/data/data/com.yourNamespace/databases。

In the emulator, the location in DDMS should be /data/data/com.yourNamespace/databases in the File Explorer tab.

这是DDMS透视图的照片。在右侧的文件浏览器选项卡,你会深入到数据库文件夹。这些是虚拟文件夹,这样你就不会发现它们在系统上。要检查分贝,你会选择图标的从设备中拉出文件(对不起,它得到了裁切掉在这个截图)和SQLite中打开该文件。

This is a pic of the DDMS perspective. In the File Explorer tab on the right, you would drill down to the databases folder. These are virtual folders, so you won't find them on your system. To examine the db, you would select the icon for Pull file from the device (sorry, it got cropped out in this screenshot) and open that file in SQLite.

BTW哪本书使用?

这篇关于如何利用现有的SQLite数据库在Android模拟器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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