I want to implement SQLite database for iPhone using PhoneGap. I know some basics SQLite database in iPhone native application. But how can I implement SQLite database in PhoneGap?
See Question&Answers more detail:osI want to implement SQLite database for iPhone using PhoneGap. I know some basics SQLite database in iPhone native application. But how can I implement SQLite database in PhoneGap?
See Question&Answers more detail:osWe ended up using the PhoneGap SQLite plugin, here's why:
We started off using a plain old Web SQL Database in our PhoneGap app, but ran into the following limitations:
We initially worked around this issue by copying a pre-populated sqlite3 database to a special directory where it would be picked up by WebKit (e.g. as described here)
However, in our latest attempt to submit the app, we were told the app violated iOS Data Storage Guidelines, presumably because it was copying the database file to a non-standard location.
So we went with using the PhoneGap SQLite plugin instead: This allowed us to include a large pre-populated sqlite3 database in our app and access it from javascript via the plugin. Unfortunately, the plugin doesn't provide exactly the same javascript interface as the browser, but it's fairly close.