Thanks to visit codestin.com
Credit goes to www.scribd.com

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

Exp 4

Practical

Uploaded by

ansarisadeem8879
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)
14 views2 pages

Exp 4

Practical

Uploaded by

ansarisadeem8879
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/ 2

Name: Midhat Ansari Roll no: 210403

Sub: Mobile Application Development (MAD) Branch: CO


Experiment No. 4: Develop a program to display Hello World on screen
1. Write a program to display ‘Hello World’
CODE:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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=".exp4_1">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Hello World!"
android:textSize="44sp"
android:gravity="center"
android:layout_marginTop="300sp"
android:textColor="@color/black"
android:fontFamily="sans-serif-condensed-medium"/>
</LinearLayout>

OUTPUT:

2. Write a program to display student name & marks


CODE:
<?xml version="1.0" android:layout_width="match_pare
encoding="utf-8"?> nt"
<LinearLayout android:layout_height="wrap_cont
xmlns:android="http://schemas.and ent"
roid.com/apk/res/android" android:orientation="vertical"
xmlns:app="http://schemas.android tools:context=".exp4_2">
.com/apk/res-auto" <LinearLayout
xmlns:tools="http://schemas.androi
d.com/tools" android:layout_width="match_pare
nt" android:layout_width="match_pare
nt"
android:layout_height="wrap_cont
ent" android:layout_height="wrap_cont
ent"
android:orientation="horizontal">
<TextView android:orientation="horizontal">
<TextView
android:layout_width="wrap_conte
nt" android:layout_width="wrap_conte
nt"
android:layout_height="wrap_cont
ent" android:layout_height="wrap_cont
android:text="Name: " ent"
android:textSize="34sp" android:text="Marks: "
android:fontFamily="sans- android:textSize="34sp"
serif-black" android:fontFamily="sans-
serif-black"
android:textColor="@color/black"
android:textColor="@color/black"
android:layout_marginTop="10sp"
android:layout_marginTop="10sp"
android:layout_marginLeft="10sp"
/> android:layout_marginLeft="10sp"
<EditText />
<EditText
android:layout_width="match_pare
nt" android:layout_width="match_pare
nt"
android:layout_height="wrap_cont
ent" android:layout_height="wrap_cont
android:textSize="34sp"/> ent"
</LinearLayout> android:textSize="34sp"/>
<LinearLayout </LinearLayout>
</LinearLayout>

OUTPUT:

You might also like