Reading local sqlite file from phonebook

I can create sqlite DB in phonegap / html5 via window.openDatabase . I will have a large amount of data, so I want to send it using the application.

So, I can store sqlite DB somewhere in the application (it should work on both iOS and Android). In particular, where is shortName.db stored when I call

var db = openDatabase(shortName, version, displayName, maxSize);

And can I pre-populate this sqlite file. (In a telephone conversation environment)

+7
source share
3 answers
+3
source

I did not use PhoneGap, I only created HTML5 applications that use Web SQL. However, if you ask if you can submit an application with a pre-populated SQLite database, then yes you can. Probably the easiest approach would be to provide table creation scripts as part of the application. When it starts first, you can run the scripts and your database will be fully initialized.

+2
source

An alternative approach for deploying the bulk data that I came up with is simply serializing it into text files and deploying the files along with the application.

You can use the file API provided by PhoneGap to download these files as strings and parse them using Ext.util.JSON.decode ().

Finally, use MemoryProxy to integrate the decoded data with the rest of Sencha Touch, and you are gold.

+2
source

All Articles