0% found this document useful (0 votes)
11 views4 pages

Practical No 5

The document outlines a practical assignment for developing an Android application using Linear and Absolute Layouts. It includes XML code for the layout design featuring various UI components such as EditTexts, TextViews, RadioButtons, and CheckBoxes, along with a Java class for the main activity. The code demonstrates how to set up the layout and handle window insets for a better user interface experience.

Uploaded by

kaverinagare39
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)
11 views4 pages

Practical No 5

The document outlines a practical assignment for developing an Android application using Linear and Absolute Layouts. It includes XML code for the layout design featuring various UI components such as EditTexts, TextViews, RadioButtons, and CheckBoxes, along with a Java class for the main activity. The code demonstrates how to set up the layout and handle window insets for a better user interface experience.

Uploaded by

kaverinagare39
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

Practical No : 5

Title : Develop A Program To Implement Linear Layout And Absolute Layout


Class : TYCM-WIN Batch : B Roll No : 46
**********************************************************************************

android:layout_x="50dp"
<?xml version="1.0" encoding="utf-8"?> android:layout_y="100dp"
<AbsoluteLayout android:textSize="20dp"
xmlns:android="http://schemas.android.com/a android:layout_marginTop="20dp"/>
pk/res/android"
<EditText
xmlns:app="http://schemas.android.com/apk/r android:layout_width="wrap_content"
es-auto" android:layout_height="wrap_content"
android:textColor="#F44336"
xmlns:tools="http://schemas.android.com/tool android:layout_x="70dp"
s" android:layout_y="120dp"
android:id="@+id/main" android:text="Last Name"
android:layout_width="match_parent" android:minHeight="48dp"
android:layout_height="match_parent"
tools:context=".MainActivity" />
android:background="@drawable/images"> <EditText
android:layout_width="wrap_content"
<TextView android:layout_height="wrap_content"
android:layout_width="wrap_content" android:textColor="#F44336"
android:layout_height="wrap_content" android:text="First Name"
android:text="Collage Student Admission android:layout_x="178dp"
Form!!!!" android:layout_y="120dp"
android:textSize="26dp" android:minHeight="48dp"
android:textColor="@color/white" />
android:layout_x="2dp"
android:layout_y="30dp" <EditText
android:layout_width="wrap_content"
/> android:textColor="#F44336"
<EditText android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_x="280dp"
android:layout_height="wrap_content" android:layout_y="120dp"
android:textColor="#009688" android:minHeight="48dp"
android:text="Middle Name"/>
android:text="**************************
********************" </AbsoluteLayout>
android:minHeight="48dp"
android:textSize="20dp" <AbsoluteLayout
android:layout_y="70dp"/> android:layout_width="wrap_content"
android:layout_height="wrap_content"
<AbsoluteLayout android:layout_y="20dp">
android:layout_width="match_parent"
android:layout_height="wrap_content" <TextView
android:layout_y="35dp" android:layout_width="wrap_content"
> android:layout_height="wrap_content"
android:textColor="@color/white"
<TextView android:text="GENDER:"
android:layout_width="wrap_content" android:textSize="20dp"
android:layout_height="wrap_content" android:layout_x="50dp"
android:textColor="@color/white" android:layout_y="200dp"/>
android:text="NAME :" <RadioGroup
android:layout_width="wrap_content" android:textSize="20dp"/>
android:layout_height="wrap_content" <EditText
android:id="@+id/rg1" android:layout_width="wrap_content"
android:textColor="@color/white" android:layout_height="wrap_content"
android:layout_x="100dp" android:layout_x="100dp"
android:layout_y="230dp" android:layout_y="300dp"
android:orientation="horizontal"> android:textColor="#F44336"
android:minHeight="48dp"
<RadioButton android:text="Enter The Phone
Number........"/>
android:layout_width="wrap_content"
</AbsoluteLayout>
android:layout_height="wrap_content"
android:text="Male" <AbsoluteLayout
android:id="@+id/rg1m" android:layout_width="wrap_content"
android:textColor="@color/white" android:layout_height="wrap_content"
android:textSize="18dp"/> android:layout_y="30dp">

<RadioButton <TextView
android:layout_width="wrap_content"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:text="Do You Speak Any
android:layout_height="wrap_content" Language Other Than English :"
android:textColor="@color/white" android:layout_x="50dp"
android:text="Female" android:textSize="20dp"
android:id="@+id/rg1fm" android:textColor="@color/white"
android:textSize="18dp" android:layout_y="380dp"/>

/> <RadioGroup
android:layout_width="wrap_content"
<RadioButton android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_width="wrap_content" android:id="@+id/rg2"
android:layout_x="100dp"
android:layout_height="wrap_content" android:layout_y="450dp" >
android:text="Other"
android:textColor="@color/white" <RadioButton
android:id="@+id/rg1o"
android:textSize="18dp"/> android:layout_width="wrap_content"

</RadioGroup> android:layout_height="wrap_content"
</AbsoluteLayout> android:id="@+id/rgy1"
android:text="YES"
<AbsoluteLayout android:textColor="@color/white"
android:layout_width="wrap_content" android:textSize="18sp" />
android:layout_height="wrap_content"
android:layout_y="40dp"> <RadioButton

<TextView android:layout_width="wrap_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_x="50dp" android:id="@+id/rgy2"
android:layout_y="270dp" android:textColor="@color/white"
android:text="PHONE NO :" android:text="No"
android:textColor="@color/white" android:textSize="18sp" />
</RadioGroup>

</AbsoluteLayout> <CheckBox
android:layout_width="wrap_content"
<AbsoluteLayout android:layout_height="wrap_content"
android:layout_width="wrap_content" android:textSize="18dp"
android:layout_height="wrap_content" android:text="CSS"
android:layout_y="30dp"> android:layout_x="140dp"
android:textColor="@color/white"
<TextView android:layout_y="560dp"
android:layout_width="wrap_content" android:id="@+id/css"
android:layout_height="wrap_content" />
android:text="How Many Languages
You Are Known :" <CheckBox
android:textColor="@color/white" android:layout_width="wrap_content"
android:layout_x="50dp" android:layout_height="wrap_content"
android:textSize="20dp" android:textSize="18dp"
android:layout_y="520dp"/> android:text="JS"
android:layout_x="220dp"
<CheckBox android:layout_y="560dp"
android:layout_width="wrap_content" android:textColor="@color/white"
android:layout_height="wrap_content" android:id="@+id/js"
android:textSize="18dp" />
android:text="HTML" <CheckBox
android:layout_y="560dp" android:layout_width="wrap_content"
android:textColor="@color/white" android:layout_height="wrap_content"
android:layout_x="50dp" android:textSize="18dp"
android:id="@+id/html" /> android:text="MAD"
android:textColor="@color/white"
android:layout_x="280dp"
android:layout_y="560dp"
android:id="@+id/mad"
/>

</AbsoluteLayout>

</AbsoluteLayout>
package com.example.YASHHH;
import android.os.Bundlez

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

public class MainActivity extends AppCompatActivity {


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EdgeToEdge.enable(this);
setContentView(R.layout.activity_main);
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
return insets;
});
}
}

**********************************************************************************

OUTPUT :

You might also like