Practical No. 04

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

DEPARTMENT OF COMPUTER ENGINEERING

Subject: Mobile Application Development (MAD) Subject Code: 22617


Semester: 6 Course: CO6IA
Laboratory No: V119 Name of the Subject Teacher: Prof. Prasad Koyande
Name of the Student: Diksha Sunil Jadhav Roll Id: 21203A0057

Experiment No. 04
Title of the experiment Develop a program to display Hello World on screen.

Practical Related Questions:

1. List the files used to write Hello World program.

 MainActivity.java
 activity_main.xml

2. What is an activity in Android programming?

 In Android programming, an "activity" is a fundamental component of the Android


application's user interface.
 It represents a single screen with a user interface that users can interact with.
 Each activity is defined as a subclass of the Activity class and plays a crucial role in the
overall navigation and user experience within an Android app.

Exercise:

1. Write a program to display HelloWorld.

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"

Diksha Jadhav – 21203A0057 Page No. | 1


app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

2. Write a program to display student name and marks.

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"

Diksha Jadhav – 21203A0057 Page No. | 2


android:textSize="25dp"
android:gravity="center"
android:paddingBottom="10dp"
app:layout_constraintTop_toBottomOf="@id/t4" />
<TextView
android:id="@+id/t6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="SST - 84/100"
android:textSize="25dp"
android:gravity="center"
android:paddingBottom="10dp"
app:layout_constraintTop_toBottomOf="@id/t5" />
<TextView
android:id="@+id/t7"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Hindi - 98/100"
android:textSize="25dp"
android:gravity="center"
android:paddingBottom="10dp"
app:layout_constraintTop_toBottomOf="@id/t6" />
<TextView
android:id="@+id/t8"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Marathi - 99/100"
android:textSize="25dp"
android:gravity="center"
android:paddingBottom="10dp"
app:layout_constraintTop_toBottomOf="@id/t7" />

</androidx.constraintlayout.widget.ConstraintLayout>

Process related (15M) Product related (10M) Total (25M) Sign of the teacher

Diksha Jadhav – 21203A0057 Page No. | 3

You might also like