开发者

How to open a SQLite database in a SQLite management tool

I am working on an Android project and have a prob开发者_运维技巧lem with SQLite database management.

I have downloaded a SQLite Management tool and dont know how to open the database and test.

File -> open database ->

I know the DB file is in, /data/data/package_name/databases, but how to find it in windows explorer. (Shortly how to find the path to open the SQLite database in management tool)


It is possible to browse an android db file in windows OS using "SQLite Database Browser".

Copy your db file to your desktop PC and open it using this application.

download this appliaction here


The filesystems of your computer and of your Android device/simulator are distinct. You can copy files back and forth, but you cannot open files in the Android filesystem from the computer (and vice versa).

If you're using Eclipse, open up the Android/File Explorer view, and use the "Pull from device"/"Push to device" buttons in that view's toolbar to copy files back and forth. That's the best you can do.

EDIT: in theory, you can run Samba on an emulator or on a rooted phone; then you can forward the SMB port to the host and have a merry file service time with the database. See the Greater Internet for the Samba guidance.


In addition to Seva's answer, unless your device is rooted you won't be able to access the database file of the app on a real device; you'll only be able to copy it over from an emulator.


One other option is to use SQLite3 in adb. It is built into adb. Below is a link for adb and another for using SQLite3 in it.

How to use adb http://developer.android.com/guide/developing/tools/adb.html

Using SQlite3 through adb http://www.sqlite.org/sqlite.html

Hope this helps, George


You're probably already talking about the SQLite file coming from the emulator, aren't you? If yes, and you're having problems because the SQLite management tool doesn't see the file, save it with a .sqlite extension!


You can achieve this by two options, take an example, we created our db file in external storage,

1-using ADB, adb pull /mnt/shell/emulated/0/(your_db_name) any_path_you_pull

note: if you create some folders update the command accordingly.

2-using DDMS, DDMS/File Explorer/mnt/shell/emulated/0/(your_db_name) and you can pull by using the pull button in the right corner of DDMS window after the db file is selected.

You can also put your db file by using push using the same way. To view, db you can use any SQLite viewer tool.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜