Back to Top

Create Android App with SQLite database using Phonegap

To setup SQLite for Android-Phonegap application

Here I am going to move one step ahead for Android Phonegap application article Series.Last what we have seen is To restrict screen orientation in Android.In this article, I am going to explain how to setup SQLite Cordova for Android application.

SQLite is an Open Source Database which is embedded into Android. SQLite supports standard relational database features like SQL syntax, transactions and prepared statements. Moreover, SQLite requires very less memory at runtime.

Must Read: Getting Started With PhoneGap

So, You can download SQLite Cordova plugin from here.Now, Let’s see how to install plugin for android application.

First of all, add required js into your js folder of assets and js are SQLite.js,qunit-1.5.0.js and SQLite.coffee files.

Next,Add your plugin file of SQLite into src folder.

Go to XML folder and open config.XML and place below line of code:

That’s it.You are done with SQLite plugin installation in Android application.

Now, It’s time to connect with SQLite database, so here is the syntax to connect with database.

Read: Solution: Header moves using jQuery mobile and Phonegap in Android

You can check your SQLite database into DDMS >> file explore >> data >> data >> project package >> databases >> FILENAME.

You can use SQLite Cordova plugin and code for both android and iOS application.

In next article, we will see Basic Query and connection of SQLite database. I’m hoping that you’ve found this article helpful.

As always, thanks for reading. Don’t Forget to Follow us on Twitter or Subscribe us to Get the Latest Updates.

Comments (8)

  1. […] previous article we have covered the To setup SQLite for Android-Phonegap application. In this article we are about to explore the SQLIte statements used in Android/iOS using […]

  2. Hey. When you are saying to copy your plugin file into src folder, then do we need to paste the whole unzipped folder or just the android folder inside the src folder in plugin file?

    1. Just plugin file into your src folder

  3. Dont understand this step: Next,Add your plugin file of SQLite into src folder.
    and
    Go to xml folder and open config.xml and place below line of code:

    1. Means, Add your plugin file into SQLite >> src folder. Then after go to folder “XML” and open file “config.xml”

  4. Kalanidhi M says:

    Can you please tell me the plug in name , because of there are three file named as plugin.

    1. Hello Kalanidhi,

      I have provided plugin link on article. Have you check that?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Most Popular Posts

How to get Last Post in WordPress

Posted on 12 years ago

Bhumi

Buffered Vs Unbuffered Queries in PHP

Posted on 12 years ago

Bhumi

The Reader’s Poll – August 2014

Posted on 10 years ago

Bhumi