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

Android XML Layouts for Hello World and Student Info

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

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 DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

Android XML Layouts for Hello World and Student Info

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

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 DOCX, PDF, TXT or read online on Scribd

Q. Write a program to display HelloWorld.

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


<LinearLayout
xmlns:android="[Link]
s/android"

xmlns:app="[Link]
auto"
xmlns:tools="[Link]
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" Q. Write a program to display student name
/> and marks.

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


<LinearLayout
xmlns:android="[Link]
s/android"

xmlns:app="[Link]
auto"
xmlns:tools="[Link]
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
android:layout_margin="20sp"
android:padding="10sp"
android:background="@color/white"
tools:context=".MainActivity">
android:gravity="center"
<LinearLayout android:layout_marginBottom="10sp">
android:layout_width="match_parent" <TextView
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:gravity="center" android:layout_height="wrap_content"
android:layout_marginBottom="10sp"> android:text="Marks : "
<TextView android:textColor="@color/black"
android:layout_width="wrap_content" android:textSize="20sp"/>
android:layout_height="wrap_content" <TextView
android:text="Name : " android:layout_width="wrap_content"
android:fontFamily="times new roman" android:layout_height="wrap_content"
android:textColor="@color/black" android:text="98.34% "
android:textSize="20sp"/> android:fontFamily="times new roman"
android:textColor="@color/black"
<TextView android:textSize="20sp"/>
android:layout_width="wrap_content"
android:layout_height="wrap_content" </LinearLayout>
android:text="Ganesh Kumbhar "
android:fontFamily="times new roman" </LinearLayout>
android:textColor="@color/black"
android:textSize="20sp"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"

You might also like