I run all examples of storage class of Phone gap and developed the code as mentioned in
http://docs.phonegap.com/en/2.7.0/cordova_storage_storage.md.html#Storage.
Then at which location the DB file will be created?
I run all examples of storage class of Phone gap and developed the code as mentioned in
http://docs.phonegap.com/en/2.7.0/cordova_storage_storage.md.html#Storage.
Then at which location the DB file will be created?
The location of the database file is different in android 4.4. My app on android 4.1 has the db at "file:///data/data/{package_name}/app_database/file__0/0000000000000001.db" but on Android 4.4 the db file's at "file:///data/data/{package_name}/app_webview/databases/file__0/1".
I wrote a simple plugin for cordova that makes this distinction and returns a string with the full path of the db file. However it's not developed for other platforms like iOS or Windows Phone. Feel free to collaborate.
on which platform?
on Android the DB file is located in /data/data/{app.package}/databases and /data/data/{app.package}/app_database (credits: https://groups.google.com/forum/?fromgroups#!topic/phonegap/_OMN5C5flq8)
If you are using PhoneGap for Android you will find the database you created in the following folder
/data/data/{{full_package_name}}/app_database
Your app database is typically created under a folder like this:
file__0/0000000000000001.db (Please note that the number could change in your specific case, but you get the idea)
If you want to browse the data on that database, you could do
sqlite3 {{db_file_name.db}}
.header on
.tables
select * from {{tablename}}
.schema {{tablename}}
The DB file will be stored at /data/data/{package_name}/databases.
I recommend use "SQLitePlugin":