Question 14: Write a program to create a login form for student registration system.
Download hole Program / Project code, by clicking following link:
List all the UI components which can be used to develop login window in Android Studio?
Here are some of the UI components that can be used to develop a login window in Android Studio:
- EditText: EditText can be used to allow the user to enter their email or username and password.
- TextView: TextView can be used to display the text "Email or Username" and "Password" to prompt the user to enter their credentials.
- Button: Button can be used to create the "Log In" button, which the user can click to submit their credentials.
- CheckBox: CheckBox can be used to create a "Remember Me" option, which will save the user's credentials so they don't have to enter them every time they log in.
- ProgressBar: ProgressBar can be used to indicate to the user that the login process is underway.
- ImageView: ImageView can be used to display a logo or image on the login screen.
- TextInputLayout: TextInputLayout can be used to display a hint or label for the EditText field.
Note that these are just some of the UI components that can be used to develop a login window in Android Studio. The exact components you choose will depend on the specific requirements of your app.
Programming Code:
Following code write in: MainActivity.java
package com.go2collage.practical_14;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
Following code write in: activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
android:orientation="vertical"
android:layout_margin="20dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Students Registration Form"
android:textSize="24sp"
android:textStyle="bold"
android:layout_marginTop="50dp"
android:textColor="@color/black"
android:textAlignment="center"
tools:ignore="HardcodedText" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:fontFamily="monospace"
android:hint="Enrollment or PRN number"
android:minHeight="48dp"
android:padding="10dp"
android:textColor="@color/black"
android:textColorHint="#757575"
android:textSize="18sp"
tools:ignore="Autofill,HardcodedText,TextFields" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:fontFamily="monospace"
android:hint="Password"
android:textColorHint="#757575"
android:minHeight="48dp"
android:padding="10dp"
android:textColor="@color/black"
android:textSize="18sp"
tools:ignore="Autofill,HardcodedText,TextFields" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Log In"
android:textColor="@color/white"
android:layout_marginTop="40dp"
android:textSize="22sp"
tools:ignore="HardcodedText" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Forgot Password ??"
android:textSize="16sp"
android:layout_marginTop="10dp"
android:textAlignment="center"
android:textColor="@color/black"
tools:ignore="HardcodedText" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="go2collage"
android:textSize="24sp"
android:textStyle="bold"
android:textAlignment="center"
android:layout_marginTop="50dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText" />
</LinearLayout>
Output:
0 Comments