Hi Folks !

Scratching your head developing a android login module without sql lite database ? Here is exact tutorial to create login system where you can validate username and password.

No database nothing. You need to specify username and password in your java file.

If you are in GTU then you must check this program

GTU MCA SLMC Program 2

  • To understand Activity, Intent .
  • a.  Create sample application with login module.(Check username and password)
  • b.  On successful login, go to next screen. And on failing login, alert user using Toast.
  • c.  Also pass username to next screen

Lets get started.

Android Studio Login Check Username and password

Design a Two Screens |  First to Let user enter username and passoword and Second to show welcome message.

  • Take 2 editText and give a unique id.
  • Put a button for onclick event.

Here is the code of activity_main.xml

Here is your next screen to show your welcome message.
second.xml

You just need to take one textview to show the message to the user.

Now actual coding part starts in this java file which is given below

LoginSuccess.java to show Successfull login message.

This is layout we are just fetching the username from main acitvity with “usr” variable.

Strings.xml

These are the only files you need to build your login system that checks your username and password.
If you face any errors feel free to comment.

Leave a Reply

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