17

I am looking for a way to see realtime (as I debug) what is in my SQL database.

Does anyone know how to do this? I have tried looking through the variables tab but can't seem to find anything.

easycheese
  • 5,859
  • 10
  • 53
  • 87
  • 1
    This question, answered [here](http://stackoverflow.com/questions/2530548/browse-data-in-android-sqlite-database), may help. – omermuhammed Jun 13 '11 at 16:42

5 Answers5

21

Open view Window->Show View->File Explorer.
In this view go to data/data/"your app name"/databases/"your database" This is you database file.
I use Questoid SQLite browser (It was available in www.questoid.com/Forums/tabid/59/aff/9/aft/7/afv/topic/Default.aspx) plugin for eclipse.

Mohammed H
  • 6,880
  • 16
  • 81
  • 127
woodshy
  • 4,085
  • 3
  • 22
  • 21
  • I tried opening File Explorer, it comes up at the bottom but all of the options to open files, etc are grayed out... – easycheese Jun 13 '11 at 16:49
  • 1
    have you selected your database? – woodshy Jun 13 '11 at 16:51
  • Not sure what you mean, there is no option to select anything. There is nothing in the File Explorer Window. Do I need the plugin? – easycheese Jun 13 '11 at 16:53
  • 1
    refer http://developer.android.com/guide/developing/debugging/ddms.html DDMS provides a File Explorer tab that ... This feature is useful in examining files that are created by your application or if you want to transfer files to and from the device. To work with an emulator or device's file system: In the Devices tab, select the emulator that you want to view the file system for. To copy a file from the device, locate the file in the File Explorer and click the Pull file button. To copy a file to the device, click the Push file button on the File Explorer tab. – woodshy Jun 13 '11 at 17:00
  • Ah...figured out why it wouldnt show anything. I use my phone as a test device and it won't pull from that. But when I use an emulator it shows data. I also tried looking up that SQLite plugin but when I try to navigate to the download page it times out every time. – easycheese Jun 13 '11 at 17:09
  • Ok, so I pulled the file, but what program can I use to open it? I tried notepad and it sort of worked but not well. Excel failed as well...And I couldn't make Access open it – easycheese Jun 13 '11 at 17:16
  • try to install plugin from here http://jaxenter.com/manage-sqlite-for-android-11339.html – woodshy Jun 13 '11 at 17:18
  • Finally got a copy, its no longer being distributed as a separate plugin, have to download Android Dev Tools. This is PERFECT though, exactly what I needed, thanks!!!! ALthough unfortunately it looks like my data is good. My query code s good as well...damn...now I have to find out my real problem... – easycheese Jun 13 '11 at 19:15
  • congrats! :) post your question here - we'll help :) – woodshy Jun 13 '11 at 19:22
  • Yeah, I think I figured it out in the shower this morning. Stupid mistake, I never ran the open() method. Haven't had a chance to test it though. – easycheese Jun 14 '11 at 05:38
  • In Emulator it works fine,But when i connect my phone i am not able to view DB. Any idea Y? – Ads Nov 02 '12 at 07:27
  • 4
    You need to root your device to be able to do so. – Marcin Orlowski Mar 22 '13 at 16:43
4

I don't know of any way to view it through Eclipse but you can perform queries on the database through the ADB. Check out Examining sqlite3 Databases from a Remote Shell.

Haphazard
  • 10,900
  • 6
  • 43
  • 55
  • Thanks, I'm going to try one of the plugins someone mentioned first. I would prefer an Eclipse option as opposed to ADB. – easycheese Jun 13 '11 at 16:56
1

Database is stored in data/data/your package name/your database name.

andrewsi
  • 10,807
  • 132
  • 35
  • 51
sarah
  • 11
  • 1
1

Hi I just found how to show tables on eclipse,

if the database Icon still Gray :

Preference -> Android -> DDMS ->

select open in eclipse instead of save on the disqu...

good luck :)

Renjith K N
  • 2,613
  • 2
  • 31
  • 53
0

Follow below step:-

  1. Download .jar file

  2. Place the plugin .jar 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 (mine appears next to LogCat by default)

  10. Switch to the 'Browse Data' sub tab Select your table from the drop down menu Browse your data here and onward into the digital sunset

refer link

duggu
  • 37,851
  • 12
  • 116
  • 113