Android: how to create database and insert, update, delete data

Android provides easy way to manage  structured data in SQLite database. It has full support for SQLite database. Any databases you create will be accessible by name to any class in the application, but not outside the application.

You need to follow the steps to create a database in SQLite on Android.

  1. Create database in SQLite using  MySQLiteOpenHelper extends SQLiteOpenHelper
  2. Open database
  3. Create data tables
  4. Insert data into the tables
  5. Query data from database
  6. Close database once work is finished

Code Example:

Advertisements

About M Moniruzzaman
A passionate software engineer, have been developing applications on various platforms such as Android, iPhone, .Net (C#) technologies and web based ASP.NET, PHP, JavaScript, jQuery technologies for more than 10 years. Especially I have expertise on developing applications for Android and iPhone, as well as service oriented, client-server based applications where clients will be reside on Android/iPhone that communicate with WCF(.NET) service hosted on server. I have completed certification in Microsoft Certified Professional Developer (MCPD) on .Net 4 . I have completed my graduation in -- B.Sc. (Engineering) in Computer Science and Engineering, ShahJalal University of Science and Technology, Bangladesh. Thanks, M. Moniruzzaman (Zaman)

6 Responses to Android: how to create database and insert, update, delete data

  1. Pankaj Doshi says:

    after I make a database on my android phone can i connect it to a desktop or laptop and then perhaps map the entire database on to pc and vice versa (from pc to phone) via gprs

    is this possible ?
    hw should go abt doin this ?

  2. Vaibhav says:

    Hi..
    can you help me out to create database using SQLiteOpenHelper ???
    I am facing problems in creating database using this?
    Thanks in advance….!!

  3. thity says:

    very nice tutorial

  4. Zain Afzal (10349984) says:

    Visit the link http://www.thenewboston.org > videos & tutorials > android development, he explains every single line of code brilliantly.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: