Tag Archives: sqlite

sqlite_feature

Howdy all, today I am going to show you how to CRUD(Create ,Read,Update,Delete) in Android Application in a simplest way, this is very awesome tutorial and simple one. Every one specially for novice who think that Database is very difficult.So without wasting time lets dig inside-

Sqlite is a RDBMS contained in a C programming library functions.
Download Code

So Lets start with basics and database queries –

Create database – Database Name- StudentRecordsDB

Create Table -Table Name student . With column names.

Insert Data-

Update Data-

Select Data-

Delete Data-

Note – So these are the basic queries for database and whenever we have to insert,update,delete we will use exeSQL . And in case of Select we will use rawQUERY.

One more thing if we have to check that our database is really created or not then we can check it by going to –

Goto DDMS ==> File explorer ==> data ==> data ==>package name ==>database name

databasesqlite

Now quickly start with designing part in Android Application –

Now it will show errors for Strings.xml file so paste the below code in your Strings.xml.

Now your MainActivity.java file in your Android Application in which you will do CRUD operations .

Note – Cursor (Database) is control structure that enables traversal over a Record in the database.We can point to any row to Records in the database with its object.

Builder is a class for showing a alert to the user that something is happened. It has two String type parameters.

MainActivity.java is your java file and I put all the CRUD within this file-

In the above code I have made two methods for showing messages on Alertbox and other is ClearText for clearing text after performing Records.

In this my column names are –

Rollno

Name

Marks

With VARCHAR datatype – You can set PRIMARY KEY later on.

In this I have just create Database and create Table and then perform simple if else condition to perform SQLITE DATABASE CRUD.This is simple and minor Project based on Local Database connectivity for Student Management System in Android.

Now you can Run your project  So Practice Hard and learn as much you can  :p

OutPut –

sqlite_androidarena

sqlite_insert

sqlite_update

sqlite_view

Please share your view and ask me anything . :p