Storage in Apache Cordova/PhoneGap

While its very fun to play with HTML and Javascript to make our application do lots of crazy things, sooner or later we're going to need to store information for later consumption. Whether its a user profile or a list, we are going to need to store in the device so that the user can retrieve the information later as needed. For this we have several options, with one of the most used being SQLite.

Setting SQLite in Apache Cordova

Considering we create an Apache Cordova project such as the one used in MyFirstApp, we proceed to add the SQLite plugin to it so that we can access the functions provided.

$ sudo cordova plugin add cordova-sqlite-storage

Once installed we proceed to create the functions necessary to create, update and modify our database.

Storage in Monaca

Next we'll reproduce the code using AngularJS and OnsenUI+Monaca in our app.