Android – Creating Registration Page using SQLITE Database

In this tutorial we will learn to create a registration page using SQLITE database in Android. Here you will get the concept of inserting data inside the SQLITE database. Also you will get to know about fetching data from SQLITE database. So let’s start.

Creating a New Android Project

  • As we all know the steps to make a new Android Project, so we not discussing it here. If you want to learn about that you can check this tutorial Android – Creating First New Project – 1 .
  • Take it as blank activity and move forward.
  • Now we will get our project structure.

Creating our Layout Design

  • Go to res –> layout –> activity_main.xml and copy the below code and save the file.

  • So now our layout will look like this as shown in figure.

Creating a Java Class for Database Operation

  • Right Click on Project and go to File –> New –> Class 
  • Give the name of the class. Here we are giving it as Sqlite and click on Finish.
  • Now we will get the new java class in which we will define all the database operation i.e. we will create the database, table and insert our data.
  • Copy the below code and paste it in Sqlite.java file just below the package line and save the file.

  • Now open MainActivity.java and copy the below code there just below the package file as given below and save the file.
 

  • Now we have to run the project. Right click on project, go to Run As –> Android Application.

Complete Video Tutorial :

Thank you for visiting our tutorial. If you have any doubts or queries regarding this, you can comment below in our comment section. Don’t forget to share the tutorial if you like it.

Share this post

Leave a Reply

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