Login and Registration form in Android

In this tutorial we will discuss how to create Login and Registration Form in Android. This is required for any app, where the user is required to register and then login to his account. This tutorial is second part of create database in android using sqlitedatabase. So before continuing, make sure that you have knowledge of previous tutorial then come to this tutorial.


click here to get code of androidmanifest.xml

This is the view of manifest file this file reamins unchanged in this application  

Activity_Main.xml 

click here to get code of Activity_Main.xml

In This we can desing the xml layout for registeration form from which the data is entered by the user is stored in the database here is the some snapshots of the coding parts and the design parts u can check it and if u want to download the xml code of this layout u can download it by clicking on the link given above by clicking on Activity_Main.xml

 


 

Activity_Main2.xml

click here to get code of Activity_Main2.xml

In This we can desing the xml layout for Login form from which the data is entered by the user and match in the database either the user is registered or un registered. here is the some snapshots of the coding parts and the design parts u can check it and if u want to download the xml code of this layout u can download it by clicking on the link given above by clicking on Activity_Main2.xml


MainActivity.java

click here to get code of MainActivity.java

In this We can use the SQLiteDatabse For Create The Database Then We can execute query according to our requirements in this we can execute three queries of sql first is for create the database name "androidgts" and second is for to create the table name "tutorials" and last is for to insert values in the table and we can intilize the set on listner to the log in button for go to the login page activity if the user is already register

now here is the some snapshots of code u can check it and if u want to copy this code click on the link which is provided above by clicking on MainActivity.java

 


Main2Activity.java

click here to get code of Main2Activity.java

In this we can use the cursor function to check the user is exist or not if exists either it will open the new activity or making toast with "User granted" and if the user is not registered it will generated the message "User Denied"

now here is the some snapshots of code u can check it and if u want to copy this code click on the link which is provided above by clicking on Main2Activity.java

 

 

Run Your Application 

I can use the genymotion emulator to run this application its is reliable and free for personal use   





Thanks For Reading this tutorial Keep update for more tutorials and if u have any problem Ask Freely in the comment session and in the ask questions tab

Komentar

Postingan Populer