0% found this document useful (0 votes)
6 views2 pages

Practical No. 04

The document contains XML code for two Android layouts. The first layout displays 'Hello World!!!' in a TextView, while the second layout shows a student's name and marks. Both layouts are designed with specific attributes for appearance and alignment.

Uploaded by

ganeshkumbhar638
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Practical No. 04

The document contains XML code for two Android layouts. The first layout displays 'Hello World!!!' in a TextView, while the second layout shows a student's name and marks. Both layouts are designed with specific attributes for appearance and alignment.

Uploaded by

ganeshkumbhar638
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Q. Write a program to display HelloWorld.

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


<LinearLayout
xmlns:android="http://schemas.android.com/apk/re
s/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"
android:layout_gravity="center"
android:gravity="center"
android:orientation="horizontal"
android:background="@color/white"
tools:context=".MainActivity">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!!!"
android:textSize="30dp"
android:textColor="@color/black"
android:fontFamily="times new roman"
android:textStyle="italic"
/>

</LinearLayout>

Q. Write a program to display student name


and marks.

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


<LinearLayout
xmlns:android="http://schemas.android.com/apk/re
s/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"
android:orientation="vertical"
android:gravity="center" </LinearLayout>
android:layout_margin="20sp"
android:padding="10sp" </LinearLayout>
android:background="@color/white"
tools:context=".MainActivity">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginBottom="10sp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Name : "
android:fontFamily="times new roman"
android:textColor="@color/black"
android:textSize="20sp"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Ganesh Kumbhar "
android:fontFamily="times new roman"
android:textColor="@color/black"
android:textSize="20sp"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginBottom="10sp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Marks : "
android:textColor="@color/black"
android:textSize="20sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="98.34% "
android:fontFamily="times new roman"
android:textColor="@color/black"
android:textSize="20sp"/>

You might also like