Registration and Login form in Android Studio

Login and Registration form in Android Studio

Step1: Today we are creating a registration and login page in the android studio

Step2: If you have not any idea, so read this full article to create a login and registration form

Step3: Start with Creating a new Project>File>New>New Project

Login and registration form in android studio code-Programmer Knows

Step4:  After creating the project

Below is the activity

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <include
        android:id="@+id/toolbar"
        layout="@layout/activity_toolbar"
        >

    </include>
    <TextView
        android:id="@+id/Wamu"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="WAMU!"
        android:layout_marginTop="10dp"
        android:layout_marginLeft="20dp"
        android:textColor="#000"
        android:textSize="40dp"
        android:textStyle="bold"
        android:layout_below="@id/toolbar"
        >

    </TextView>
    <EditText
        android:id="@+id/ph1"
        android:layout_width="match_parent"
        android:layout_height="40dp"
        android:hint=" Phone Number or Email"
        android:drawableLeft="@drawable/email_sign"
        android:textSize="20dp"
        android:background="#fff"
        android:layout_marginLeft="20dp"
        android:layout_marginRight="20dp"
        android:layout_marginTop="10dp"
        android:layout_below="@id/Wamu"
        android:textColor="#000"

        />

    <EditText
        android:id="@+id/Pa2"
        android:layout_width="match_parent"
        android:layout_height="40dp"
        android:hint=" Password"
        android:inputType="textPassword"
        android:drawableLeft="@drawable/lock_open"
        android:background="#fff"
        android:layout_below="@id/ph1"
        android:layout_marginLeft="20dp"
        android:layout_marginRight="20dp"
        android:layout_marginTop="10dp"
        android:textColor="#000"
        android:textSize="20dp"

        >
</EditText>

    <Button
        android:id="@+id/login"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#6A95CC"
        android:layout_marginLeft="40dp"
        android:layout_centerInParent="true"
        android:layout_marginTop="40dp"
        android:layout_below="@id/Pa2"
        android:text="Login"
        android:textSize="20dp"
        android:textColor="#fff"
>
</Button>
    <TextView
        android:id="@+id/or"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="OR"
        android:layout_centerInParent="true"
        android:layout_below="@id/login"
        android:layout_marginTop="10dp"
        android:layout_marginBottom="10dp"
        android:textSize="30dp"
        android:textColor="#000"
         />
    <Button
        android:id="@+id/caa"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#6A95CC"
        android:layout_marginLeft="40dp"
        android:layout_centerInParent="true"
        android:text="Create an account"
        android:layout_below="@id/or"
        android:textSize="20dp"
        android:textColor="#fff"
        >
    </Button>

</RelativeLayout>
package com.example.e_commerce;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate( savedInstanceState );
        setContentView( R.layout.activity_main );
    }
    }


<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <include
        android:id="@+id/toolbar"
        layout="@layout/activity_toolbar"
        >

    </include>
    <TextView
        android:id="@+id/Wamu"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="WAMU!"
        android:layout_marginTop="@dimen/_10sdp"
        android:layout_marginLeft="@dimen/_20sdp"
        android:textColor="#000"
        android:textSize="@dimen/_40sdp"
        android:textStyle="bold"
        android:layout_below="@id/toolbar"
        >

    </TextView>
    <EditText
        android:id="@+id/ph1"
        android:layout_width="match_parent"
        android:layout_height="@dimen/_40sdp"
        android:hint=" Name"
        android:drawableLeft="@drawable/name_1"
        android:textSize="@dimen/_20sdp"
        android:background="#fff"
        android:layout_marginLeft="@dimen/_20sdp"
        android:layout_marginRight="@dimen/_20sdp"
        android:layout_marginTop="@dimen/_10sdp"
        android:layout_below="@id/Wamu"
        android:textColor="#000"

        />


    <EditText
        android:id="@+id/number"
        android:layout_width="match_parent"
        android:layout_height="@dimen/_40sdp"
        android:hint=" Number"
        android:drawableLeft="@drawable/number_2"
        android:background="#fff"
        android:layout_below="@id/ph1"
        android:layout_marginLeft="@dimen/_20sdp"
        android:layout_marginRight="@dimen/_20sdp"
        android:layout_marginTop="@dimen/_20sdp"
        android:textColor="#000"
        android:textSize="@dimen/_20sdp"

        >
    </EditText>

    <EditText
        android:id="@+id/email"
        android:layout_width="match_parent"
        android:layout_height="@dimen/_40sdp"
        android:hint=" Email"
        android:drawableLeft="@drawable/email_sign"
        android:background="#fff"
        android:layout_below="@id/number"
        android:layout_marginLeft="@dimen/_20sdp"
        android:layout_marginRight="@dimen/_20sdp"
        android:layout_marginTop="@dimen/_20sdp"
        android:textColor="#000"
        android:textSize="@dimen/_20sdp"

        >
    </EditText>

    <EditText
        android:id="@+id/password"
        android:layout_width="match_parent"
        android:layout_height="@dimen/_40sdp"
        android:hint=" Password"
        android:inputType="textPassword"
        android:drawableLeft="@drawable/lock_open"
        android:background="#fff"
        android:layout_below="@id/email"
        android:layout_marginLeft="@dimen/_20sdp"
        android:layout_marginRight="@dimen/_20sdp"
        android:layout_marginTop="@dimen/_20sdp"
        android:textColor="#000"
        android:textSize="@dimen/_20sdp"
        >
    </EditText>

    <Button
        android:id="@+id/register"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#6A95CC"
        android:layout_marginLeft="@dimen/_40sdp"
        android:layout_centerInParent="true"
        android:layout_marginTop="@dimen/_40sdp"
        android:layout_below="@id/password"
        android:text="Register"
        android:textSize="@dimen/_20sdp"
        android:textColor="#fff"
        >
    </Button>
    <TextView
        android:id="@+id/or"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="OR"
        android:layout_centerInParent="true"
        android:layout_below="@id/register"
        android:layout_marginTop="@dimen/_10sdp"
        android:layout_marginBottom="@dimen/_10sdp"
        android:textSize="@dimen/_30sdp"
        android:textColor="#000"
        />
    <Button
        android:id="@+id/login"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#6A95CC"
        android:layout_marginLeft="@dimen/_40sdp"
        android:layout_centerInParent="true"
        android:text="Log in"
        android:layout_below="@id/or"
        android:textSize="@dimen/_20sdp"
        android:textColor="#fff"
        >
    </Button>



</RelativeLayout>
package com.example.e_commerce;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class Signup extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_signup);
    }
}
So ,Here it is Registeration form and login form in android studio