Professional Documents
Culture Documents
Practical No. 04
Practical No. 04
Practical No. 04
Experiment No. 04
Title of the experiment Develop a program to display Hello World on screen.
MainActivity.java
activity_main.xml
Exercise:
activity_main.xml:
<?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">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
android:textSize="40dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
</androidx.constraintlayout.widget.ConstraintLayout>
activity_main.xml:
<?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">
<TextView
android:id="@+id/t1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="50dp"
android:text="Student Name: Diksha Jadhav"
android:textSize="25dp"
android:gravity="center"
android:paddingBottom="40dp"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/t2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Marks"
android:textSize="25dp"
android:gravity="center"
android:paddingBottom="10dp"
app:layout_constraintTop_toBottomOf="@id/t1" />
<TextView
android:id="@+id/t3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="English - 80/100"
android:textSize="25dp"
android:gravity="center"
android:paddingBottom="10dp"
app:layout_constraintTop_toBottomOf="@id/t2" />
<TextView
android:id="@+id/t4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Maths - 90/100"
android:gravity="center"
android:textSize="25dp"
app:layout_constraintTop_toBottomOf="@id/t3"
android:paddingBottom="10dp" />
<TextView
android:id="@+id/t5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Science - 85/100"
</androidx.constraintlayout.widget.ConstraintLayout>
Process related (15M) Product related (10M) Total (25M) Sign of the teacher