0% found this document useful (0 votes)
9 views

sneha

The document outlines the steps to create a login form in Android, detailing the XML layout for the main activity. It includes elements such as a header text view, user ID and password edit texts, and a login button. The layout is designed using a RelativeLayout to arrange the components appropriately.

Uploaded by

vedant dubey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

sneha

The document outlines the steps to create a login form in Android, detailing the XML layout for the main activity. It includes elements such as a header text view, user ID and password edit texts, and a login button. The layout is designed using a RelativeLayout to arrange the components appropriately.

Uploaded by

vedant dubey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Department of computer MAD LAB

science
Experiment -5
Aim: Creating a Login Form using backend in Android.
Steps:
The Main Activity File:

Activity_main.xml file:

<?xml version="1.0" encoding="utf-8"?>


<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" tools:context=".MainActivity">

<!--text view for heading-->


<TextView
android:id="@+id/idTVHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:gravity="center_horizontal"
android:padding="5dp" android:text="Welcome
to CGC" android:textAlignment="center"
android:textColor="@color/purple_700"
android:textSize="18sp" />

<!--edit text for user name-->


<EditText
android:id="@+id/idEdtUserName"
android:layout_width="match_parent"
android:layout_height="wrap_content"

2237023
Department of computer MAD LAB
science
android:layout_below="@id/idTVHeader"
android:layout_marginStart="10dp"
android:layout_marginTop="50dp"
android:layout_marginEnd="10dp"
android:hint="UserId"
android:inputType="textEmailAddress" />

<!--edit text for user password-->


<EditText
android:id="@+id/idEdtPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/idEdtUserName"
android:layout_marginStart="10dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="10dp"
android:hint="Enter Password"
android:inputType="textPassword" />

<!--button to register our new user-->


<Button
android:id="@+id/idBtnLogin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/idEdtPassword"
android:layout_marginStart="10dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="10dp"
android:text="Login"
android:textAllCaps="false" />

</RelativeLayout>

Output:

2237023
Department of computer MAD LAB
science

2237023
Department of CSE MAD LAB

2236909

You might also like