O'Reilly logo

PhoneGap Mobile Application Development Cookbook by Matt Gifford

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a local SQLite database

SQLite databases are a fantastic way to store structured information from a web context. SQLite is a self-contained transactional database that does not require any configuration. This is ideal for saving and querying dynamic information within a mobile application.

How to do it...

For this recipe we will create a mobile application that will allow us to store text entries into a local SQLite database and then query the database to retrieve all saved items.

  1. Firstly, create the HTML layout for our page, including the reference to the cordova-2.0.0.js file:
    <!DOCTYPE html> <html> <head> <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width;" /> <title>My ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required