22

Possible Duplicate:
Where does Android emulator store SQLite database?

I am using SQLite and phonegap to create a multi platform app. However, I have run across an issue.

I am now looking for the location the phonegap stores the database files named 0000000000000001.db and database.db

I have found this for iPhone, however cannot seem to get the location for the Android. I am currently running on a simulator and actual device (ARCHOS).

Community
  • 1
  • 1
SingleWave Games
  • 2,618
  • 9
  • 36
  • 52

3 Answers3

24

Open the DDMS perspective Window: (window->open perspective->other->DDMS) It should open in a new tab.

Go to DDMS -> file explorer -> data -> data -> see your package name -> databases -> here your database file. (In the upper right, choose "Pull file" from device.) Export it and open through an Sqlite database connector.

You will see your updated data. Before taking these steps make sure that you have run your application first.

Eric Leschinski
  • 146,994
  • 96
  • 417
  • 335
OnkarDhane
  • 1,450
  • 2
  • 14
  • 24
  • 1
    Thanks found it, however do you know how I can access this file when it is on a device? – SingleWave Games Feb 10 '12 at 12:01
  • I am basically required to create a dynamic database using phonegap, therefore your point on building the .apk file will work for the orginal build. However, I will require access to this database in order to update my data. Would this still be possible the way you have mentioned above. Thanks – SingleWave Games Feb 12 '12 at 12:37
  • 6
    Note: DDMS cannot see or access the `/data/data/` path if the device is not **rooted**! If your device is rooted, use `adb pull` to copy the file via USB to your PC. – Bill The Ape Jul 02 '13 at 07:39
  • DDMS doesn't have access to /data/data directory, is possible to set permission without root ? – Saravana Jul 12 '15 at 05:20
10

Here you can find your database, but only on emulator

enter image description here

Natali
  • 2,934
  • 4
  • 39
  • 53
6

usually the database of app resides at the below folder

/data/data/[packagename]/databases

But have never used phonegap, so this might be different. You could check at above location.

nandeesh
  • 24,740
  • 6
  • 69
  • 79
  • 1
    I am using Eclipse and have looked in the folder within my workspace however cannot seem to find a data folder. Im a noob to this so I would appreciate it if you could point me in the direction to find the folder you mentioned above. Thanks – SingleWave Games Feb 10 '12 at 11:40
  • the database is dynamically created, this wont be in your workspace but on the device, you need to go to ddms and do as @Natali has posted – nandeesh Feb 10 '12 at 11:51
  • Thanks found it, however do you know how I can access this file when it is on a device? – SingleWave Games Feb 10 '12 at 11:59
  • you need a rooted device to extract this database and it will be in the same directory as emulator – nandeesh Feb 10 '12 at 12:04
  • 4
    Note: DDMS cannot see or access the `/data/data/` path if the device is not **rooted**! If your device is rooted, use `adb pull` to copy the file via USB to your PC. – Bill The Ape Jul 02 '13 at 07:37