O'Reilly logo

PhoneGap 4 Mobile Application Development Cookbook by Zainul Setyo Pamungkas

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. It is ideal for saving and querying dynamic information within a mobile application.

How to do it...

In this recipe, we will create a mobile application that will allow us to store text entries in a local SQLite database, and then query the database to retrieve all saved items:

  1. Firstly, create a new PhoneGap project named sqlite by running the following line:
    phonegap create sqlite com.myapp.sqlite sqlite
    
  2. Add the devices platform. You can choose to use Android, iOS, or both:
    cordova platform add ios
    cordova platform add android
    
  3. Open www/index.html ...

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