3

I have developed a phonegap application using cordova-2.4.0 for android. I have used the following code to create a database.

      var db = window.openDatabase(g_dbName, "1.0", "MyDB", 1000000);

I want to retrieve the location in my android device where the database file is created.

mmmmmm
  • 32,227
  • 27
  • 88
  • 117
Arpit Jain
  • 31
  • 4

3 Answers3

0

Android :

   in Ecllipse: Goto DDMS -> FileExplorar -> data ->  data -> packagename -> file_0 -> yourdb.db

IOS :

   /Users/userid/Library/Application Support/iPhone Simulator/6.1/Applications/unique id of package(221FEC9E-0A3C-48D8-95A2-B418CB0F1AE1)/Library/WebKit/LocalStorage/file__0
Amit Prajapati
  • 13,525
  • 8
  • 62
  • 84
0

Check my answer on this question. I wrote a plugin for cordova that gets the database full path on the android device, however it currently does not work in other platforms.

Community
  • 1
  • 1
Bruno_Ferreira
  • 1,305
  • 21
  • 33
0

• To view the database you need an Android Emulator, follow these steps:

Open Eclipse. Click on Windows > Open Perspective > DDMS. Go to File Explorer.

enter image description here

Then go to /data/data/package_name/databases (My package name was com.example.Sample).

enter image description here

You can see the database.

enter image description here

Anjy786
  • 145
  • 8