1:-
<?xml version="1.0" encoding="utf-8" ?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"
  android:layout_margin="10sp">
  <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">
      <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/Username"/>
      <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/Username"
        android:hint="@string/Username"/>
  </LinearLayout>
  <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">
      <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/Password"/>
      <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/Password"
        android:hint="@string/Password"
        android:inputType="textPassword"/>
  </LinearLayout>
  <Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/Submit"
    android:id="@+id/Submit"
    android:layout_gravity="center"/>
  <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/Display"
    android:text=""
    android:layout_gravity="center"
    android:textStyle="bold"
    android:textSize="30sp"
    android:textColor="@color/black"/>
</LinearLayout>
package com.example.edit;
import android.app.Activity;
import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends Activity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     setContentView(R.layout.activity_main);
     EditText username=findViewById(R.id.Username);
     EditText password=findViewById(R.id.Password);
     Button submit=findViewById(R.id.Submit);
     TextView display=findViewById(R.id.Display);
    submit.setOnClickListener(v->{
           String Username=username.getText().toString();
           String Password=password.getText().toString();
           display.setText(getString(R.string.Display,Username,Password));
        }
    );
    }
}
2:-
<?xml version="1.0" encoding="utf-8" ?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"
  android:layout_margin="10sp">
    <LinearLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal">
        <TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="@string/Name"/>
        <EditText
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:id="@+id/Name"
          android:hint="@string/Name"
          android:inputType="textPersonName"/>
    </LinearLayout>
    <LinearLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal">
        <TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="@string/DOB"/>
        <EditText
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:id="@+id/DOB"
       android:hint="@string/DOB"
       android:inputType="date"/>
  </LinearLayout>
  <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">
    <TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="@string/BloodGroup"/>
    <EditText
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:id="@+id/BloodGroup"
      android:hint="@string/BloodGroup"/>
  </LinearLayout>
  <Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/Submit"
    android:id="@+id/Submit"
    android:layout_gravity="center"/>
  <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/Display"
    android:text=""
    android:layout_gravity="center"
    android:textStyle="bold"
    android:textSize="30sp"
    android:textColor="@color/black"/>
</LinearLayout>
package com.example.edit;
import android.app.Activity;
import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends Activity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     setContentView(R.layout.activity_main);
     EditText name=findViewById(R.id.Name);
     EditText dob=findViewById(R.id.DOB);
     EditText bloodGroup=findViewById(R.id.BloodGroup);
     Button submit=findViewById(R.id.Submit);
     TextView display=findViewById(R.id.Display);
        submit.setOnClickListener(v->{
               String Name=name.getText().toString();
               String Dob=dob.getText().toString();
               String BloodGroup=bloodGroup.getText().toString();
               display.setText(getString(R.string.Display,Name,Dob,BloodGroup));
            }
        );
    }
}