2

For a program that I have written myself, is there a method of accessing the data in an Eclipse view from inside the database? I know where the database file resides (com.blah.main > data > database > databasename), but I can't figure out how to view it, except in command line interfaces.

I thought perhaps because I'm new to Android development there was a plugin view I was overlooking that would make examining the data easier (and visually).

Organiccat
  • 5,633
  • 17
  • 57
  • 104
  • possible duplicate: http://stackoverflow.com/questions/3496635/how-can-i-view-my-android-apps-database-information – Will Tate Mar 15 '11 at 17:58
  • They seemed to be asking how to view it at all, I was wondering if there was an Eclipse plugin since I knew those methods (sqlite and adb). – Organiccat Mar 15 '11 at 18:38
  • I don't believe there is a plug-in. You can use `.dump` from `sqlite3` which will dump the whole thing. Unfortunately, I don't know a way to actively watch changes to it (which would be awesome =D). – Will Tate Mar 15 '11 at 18:52
  • Seems closest I can get is pulling the file (I used "Pull file from device" in Eclipse, see comment below) and then using the SQL Browser he recommended. – Organiccat Mar 15 '11 at 19:01
  • http://stackoverflow.com/a/10509605/1050479 – kmb64 May 09 '12 at 04:01
  • It was answered here: http://stackoverflow.com/questions/6333412/how-to-view-sql-database-in-eclipse-debug-mode-for-android – Renaro Santos Mar 10 '13 at 20:17

2 Answers2

3

If you know how to access the db file from eclipse and are on windows then you can take advantage of this SQLite Database Browser to view the information after transferring it to the pc. But as far as eclipse is concerned I am not familiar with a plugin that will allow you to view the db file on the device.

Quintin Robinson
  • 81,193
  • 14
  • 123
  • 132
  • While I can't see the data on the fly, I used this program in conjunction with pulling the file from the device via Eclipse. Under File Explorer (Android mode) select the DB then look to the top right of that window and there is an icon that looks like a disk. Save it anywhere and open it with aforementioned program. Closest I'll get for now! – Organiccat Mar 15 '11 at 19:01
  • @Organiccat outside of viewing the pulled DB with at the command line this is about as get as it gets without making a custom solution, glad it worked for you. – Quintin Robinson Mar 15 '11 at 20:06
3

For security reasons device DB are only readable by that DB's owner on the device - or via a ContentProvider that exposes the data. If your phone is rooted, you can read the databases using adb and sqlite3, see here. Motorola's MOTODEV enhancements offers a Database Explorer that might be helpful.

Community
  • 1
  • 1
DJC
  • 3,243
  • 3
  • 27
  • 31