0% found this document useful (0 votes)
13 views8 pages

Practical No

The document describes an Android layout XML file for a table layout. The table layout contains multiple table rows with text views to display student names and ages. Column 1 displays names and column 2 displays ages.

Uploaded by

Vinod Marne
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)
13 views8 pages

Practical No

The document describes an Android layout XML file for a table layout. The table layout contains multiple table rows with text views to display student names and ages. Column 1 displays names and column 2 displays ages.

Uploaded by

Vinod Marne
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/ 8

Practical no -4

android:background="#FFC107"

tools:context=".MainActivity">

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:background="#2196F3"

android:text="Hello World!"

android:textColor="#000000"

android:textSize="24sp"

android:textStyle="bold"

app:layout_constraintBottom_toBottomOf="parent"

app:layout_constraintEnd_toEndOf="parent"

app:layout_constraintLeft_toLeftOf="parent"

app:layout_constraintRight_toRightOf="parent"

app:layout_constraintStart_toStartOf="parent"

app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

android:background="#FFC107" tools:context=".MainActivity">

<TextView android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:background="#2196F3"

android:text="Hello World!"

android:textColor="#000000" android:textSize="24sp"

android:textStyle="bold"

app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.Constra
Ans 2:

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

<TableLayout 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"

android:background="#f6f6f6" tools:context=".MainActivity">

<TableRow android:background="#98ded9" android:padding="5px">

<TextView android:layout_width="wrap_content" android:layout_height="wrap_content"


android:text="Students_Information" android:textColor="#161d6f" android:textSize="30sp"
android:textStyle="bold" />

</TableRow>

<TableRow android:background="#c7ffd8" android:padding="5px" >

<TextView android:id="@+id/text1"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Name:


Heet ; Marks: 96" android:textColor="#161d6f" android:textSize="30sp" android:textStyle="bold"
/></TableRow>

<TableRow android:background="#98ded9" android:padding="5px">

<TextView android:id="@+id/text2"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Name:


Meet ; Marks: 97" android:textColor="#161d6f"

android:textSize="30sp" android:textStyle="bold" />

</TableRow>

<TableRow android:background="#c7ffd8" android:padding="5px">

<TextView android:id="@+id/text3"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Name:


Pratik ; Marks: 99" android:textColor="#161d6f" android:textSize="30sp" android:textStyle="bold" />

</TableRow>

<TableRow android:background="#98ded9" android:padding="5px">

<TextView android:id="@+id/text4"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Name:


Shaun ; Marks: 96" android:textColor="#161d6f" android:textSize="30sp"
android:textStyle="bold" /></TableRow>

<TableRow android:background="#c7ffd8" android:padding="5px">

<TextView android:id="@+id/text5"
android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Name:
Naman ; Marks: 97" android:textColor="#161d6f" android:textSize="30sp"
android:textStyle="bold" /></TableRow>

<TableRow android:background="#98ded9" android:padding="5px">

<TextView android:id="@+id/text6"

android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Name:


Hisbaan ; Marks: 92" android:textColor="#161d6f" android:textSize="30sp"
android:textStyle="bold" />

</TableRow>

</TableLayout>
Practical No. 5
Ans 1.

<?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:layout_width="match_parent"
android:layout_height="match_parent" tools:context=".MainActivity">

<LinearLayout android:layout_width="match_parent" android:layout_height="match_parent"


android:orientation="vertical" tools:layout_editor_absoluteX="199dp"
tools:layout_editor_absoluteY="362dp">

<TextView android:id="@+id/textView" android:layout_width="match_parent"

android:layout_height="wrap_content" android:background="#03A9F4" android:text="Name: Heet"


android:textColor="#000000" android:textSize="24sp" android:textStyle="bold" />

<TextView android:id="@+id/textView2" android:layout_width="match_parent"


android:layout_height="wrap_content" android:background="#FFC107" android:text="Age:19"
android:textColor="#000000" android:textSize="24sp" android:textStyle="bold" />

<TextView android:id="@+id/textView3" android:layout_width="match_parent"


android:layout_height="wrap_content" android:background="#03A9F4"
android:text="Mobile_No:123456789" android:textColor="#000000" android:textSize="24sp"
android:textStyle="bold" />

</LinearLayout>

</androidx.constraintlayout.widget.ConstraintLayout>
Ans 2:

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

<AbsoluteLayout 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" android:background="#c7ffd8" tools:context=".MainActivity"


tools:ignore="Deprecated">

<TextView android:id="@+id/textView"

android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_x="12dp" android:layout_y="338dp" android:text="Name: Heet"
android:textColor="#161d6f" android:textSize="18sp" android:textStyle="bold" />

<TextView android:id="@+id/textView2" android:layout_width="wrap_content"


android:layout_height="wrap_content" android:layout_x="135dp" android:layout_y="338dp"
android:text="Age: 18" android:textColor="#161d6f" android:textSize="18sp"
android:textStyle="bold" />

<TextView android:id="@+id/textView3" android:layout_width="wrap_content"


android:layout_height="wrap_content" android:layout_x="213dp" android:layout_y="338dp"
android:text="Phone_no: 123456789" android:textColor="#161d6f" android:textSize="18sp"
android:textStyle="bold" />

</AbsoluteLayout>
Practical No. 6

Ans 1. <?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:layout_width="match_parent"
android:layout_height="match_parent" tools:context=".MainActivity">

<TableLayout android:layout_width="match_parent" android:layout_height="match_parent"


android:background="#31326f" tools:layout_editor_absoluteX="125dp"
tools:layout_editor_absoluteY="245dp">

<TableRow android:layout_width="match_parent" android:layout_height="match_parent">

<TextView android:id="@+id/textView1" android:layout_width="250dp"


android:layout_height="wrap_content" android:layout_column="1" android:layout_gravity="center"
android:paddingTop="25dp" android:paddingBottom="25dp" android:text="Name"
android:textColor="#ffc93c" android:textSize="30sp" android:textStyle="bold" />

<TextView android:id="@+id/textView2" android:layout_width="170dp"


android:layout_height="wrap_content"

android:layout_column="2"

android:layout_gravity="center" android:paddingTop="25dp" android:paddingBottom="25dp"


android:text="AGE" android:textColor="#ffc93c" android:textSize="30sp" android:textStyle="bold" />

</TableRow>

<TableRow android:layout_width="match_parent" android:layout_height="match_parent">

<TextView android:id="@+id/textView3" android:layout_width="250dp"


android:layout_height="wrap_content" android:layout_column="1" android:layout_gravity="center"
android:text="Heet" android:textColor="#ffc93c" android:textSize="30sp"
android:textStyle="bold" />

<TextView android:id="@+id/textView4" android:layout_width="170dp"


android:layout_height="wrap_content" android:layout_column="2" android:layout_gravity="center"
android:text="19" android:textColor="#ffc93c" android:textSize="30sp" android:textStyle="bold" />

</TableRow>

<TableRow android:layout_width="match_parent" android:layout_height="match_parent">

<TextView android:id="@+id/textView5" android:layout_width="250dp"


android:layout_height="wrap_content" android:layout_column="1" android:layout_gravity="center"
android:text="Shaun" android:textColor="#ffc93c" android:textSize="30sp"
android:textStyle="bold" />

<TextView android:id="@+id/textView6"
android:layout_width="170dp"

android:layout_height="wrap_content" android:layout_column="2"

android:layout_gravity="center" android:text="19" android:textColor="#ffc93c"


android:textSize="30sp" android:textStyle="bold" />

</TableRow>

<TableRow android:layout_width="match_parent" android:layout_height="match_parent">

<TextView android:id="@+id/textView7" android:layout_width="250dp"


android:layout_height="wrap_content" android:layout_column="1" android:layout_gravity="center"
android:text="Pratik" android:textColor="#ffc93c" android:textSize="30sp"
android:textStyle="bold" />

<TextView android:id="@+id/textView8" android:layout_width="170dp"


android:layout_height="wrap_content" android:layout_column="2" android:layout_gravity="center"
android:text="18" android:textColor="#ffc93c" android:textSize="30sp" android:textStyle="bold" />

</TableRow>

<TableRow android:layout_width="match_parent" android:layout_height="match_parent">

<TextView android:id="@+id/textView9" android:layout_width="250dp"


android:layout_height="wrap_content" android:layout_column="1" android:layout_gravity="center"
android:text="Gaurang" android:textColor="#ffc93c" android:textSize="30sp"
android:textStyle="bold" />

<TextView android:id="@+id/textView10"

android:layout_width="170dp"

<TextView android:id="@+id/textView20" android:layout_width="170dp"


android:layout_height="wrap_content" android:layout_column="2" android:layout_gravity="center"
android:text="18" android:textColor="#ffc93c" android:textSize="30sp" android:textStyle="bold" />

</TableRow>

</TableLayout>

</androidx.constraintlayout.widget.ConstraintLayout>

You might also like