Android - How Can I View A Sql Database Created In My App? I'm Running It On The Android Emulator In Eclipse
Solution 1:
Hi
1. In the Eclipse look at the File Explorer tab (near the Console tab). Or look at menu "Window -> Show View -> Other... -> File Explorer". Emulator should be run. In the File Explorer window go to the folder "data/data/[your_package_name]/databases/". There you can find your database. You can export it to the your computer. At the right top corner of the window there is a button "pull a file from device". Select database, click that button and save a database on the computer.
2. Program "sqlite browser" can shows a data in the database. You can download it here. It is easy to use.
Solution 2:
The database is stored in the following location on the emulator (assuming your app has the package com.example.app
and a database named db-name.db
):
/data/data/com.example.app/db-name.db
You can access it from the command line as follows:
cmd> adb -e shellcmd> sqlite3 /data/data/com.example.app/databases/db-name.dbsqlite> select * from table_name;sqlite> 1|Example Item 1|1|sqlite> 2|Example Item 2|2|sqlite>
Solution 3:
If you want to browse your databases inside eclipse follow these instructions taken from here:
1.Download the Questoid Plugin
2.Place the file in your Eclipse plugins folder (e.g. /usr/lib/eclipse/plugins)
3.Restart Eclipse
4.Start up an Android Emulator w/ Debugging in Eclipse
5.Switch to the DDMS Perspective in Eclipse
6.Go to the 'File Explorer' tab to locate your device's database file
7.Navigate to: e.g. 'data -> data -> com.myproject -> databases -> myproject
8.Open the database file in Questoid (see screen shot)
9.Switch to the 'Questoid SQLite Browser' tab that appears
10.Switch to the 'Browse Data' sub tab
11.Select your table from the drop down menu
12.Browse your data here and onward into the digital sunset
Post a Comment for "Android - How Can I View A Sql Database Created In My App? I'm Running It On The Android Emulator In Eclipse"