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

code MAD

The document contains multiple practical exercises by Adling Asha Devidas, showcasing different Android layout types including LinearLayout, AbsoluteLayout, ConstraintLayout, FrameLayout, and TableLayout. Each practical includes XML code snippets for creating user interface components such as TextViews, EditTexts, and Buttons. The exercises demonstrate various attributes and configurations for UI elements in Android development.

Uploaded by

Priti Mane
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

code MAD

The document contains multiple practical exercises by Adling Asha Devidas, showcasing different Android layout types including LinearLayout, AbsoluteLayout, ConstraintLayout, FrameLayout, and TableLayout. Each practical includes XML code snippets for creating user interface components such as TextViews, EditTexts, and Buttons. The exercises demonstrate various attributes and configurations for UI elements in Android development.

Uploaded by

Priti Mane
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Practical No: 1

Name: Adling Asha Devidas Roll No: 24/36-06

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

<LinearLayout

xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:orientation="vertical"

>

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:id="@+id/t1"

android:text="Enter your Name"

android:textSize="30sp"

android:layout_margin="20dp"

/>

<EditText

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:id="@+id/e2"

android:hint="Enter your Name"

android:ems="10"

android:layout_margin="20dp"

/>

<Button
android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:id="@+id/b1"

android:text="click here"

android:textSize="30sp"

android:layout_margin="20dp"

/>

</LinearLayout>

Output:
Practical No: 2

Name: Adling Asha Devidas Roll No: 24/36-06

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

<AbsoluteLayout

xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

>

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:id="@+id/t1"

android:text="krishana"

android:textSize="40sp"

android:textColor="#00f"

android:layout_x="100sp"

android:layout_y="300dp"

</AbsoluteLayout>
Output:
Practical No: 4

Name: Adling Asha Devidas Roll No: 24/36-06

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

<androidx.constraintlayout.widget.ConstraintLayout
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:id="@+id/main"

android:layout_width="match_parent"

android:layout_height="match_parent"

tools:context=".MainActivity">

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="Hello World!"

android:textSize="50dp"

app:layout_constraintBottom_toBottomOf="parent"

app:layout_constraintEnd_toEndOf="parent"

app:layout_constraintStart_toStartOf="parent"

app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
Output:
Practical No: 5

Name: Adling Asha Devidas Roll No: 24/36-06

Absolute Layout

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

<AbsoluteLayout

xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

>

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:id="@+id/t1"

android:text="krishana"

android:textSize="40sp"

android:textColor="#00f"

android:layout_x="100sp"

android:layout_y="300dp"

</AbsoluteLayout>
Output:

Linear Layout

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

<LinearLayout

xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:orientation="vertical"
>

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:id="@+id/t1"

android:text="radhesham"

android:textColor="#00f"

android:textSize="50sp"

android:background="#0f0"

/>

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:id="@+id/t2"

android:text="vrindavan"

android:textSize="50sp"

android:layout_marginTop="20dp"

android:textColor="#00f"

android:background="#0f0"

/>

</LinearLayout>

Output:
Practical No:6

Name: Adling Asha Devidas Roll No: 24/36-06

Frame Layout

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

<FrameLayout

xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

>

<ImageView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_margin="20dp"

android:scaleType="fitCenter"

android:src="@drawable/flower"

/>

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="vpp"
android:textSize="30sp"

android:gravity="center"/>

</FrameLayout>

Output:

Table Layout

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

<TableLayout

xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="match_parent"

android:layout_height="match_parent"

>
<TableRow

android:layout_width="match_parent"

android:layout_height="wrap_content"

>

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:id="@+id/t1"

android:text="college"

android:textSize="30sp"

/>

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:id="@+id/t2"

android:text="vidya pratishthans"

android:textSize="30sp"

/>

</TableRow>

<TableRow

android:layout_width="wrap_content"

android:layout_height="wrap_content"

>

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"
android:text="address "

android:textSize="30sp"

/>

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:id="@+id/t3"

android:text="indapur"

android:textSize="30sp"

/>

</TableRow>

</TableLayout>

Output:

You might also like