0% found this document useful (0 votes)
27 views

Mad 200200107038

This document is a laboratory manual for a mobile application development course. It contains information on conducting practical experiments related to developing Android applications. The manual provides objectives, procedures, and assessment rubrics for 10 experiments. The experiments cover topics like designing login activities, implementing different layouts, using intents to create activities, options menus, recycler views, themes and styles, saving and retrieving user data and preferences, location services, and animations. The manual aims to enhance students' skills in mobile application development and help them achieve relevant industry-defined competencies and outcomes through hands-on practical work.

Uploaded by

Ghetiya Niraj
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Mad 200200107038

This document is a laboratory manual for a mobile application development course. It contains information on conducting practical experiments related to developing Android applications. The manual provides objectives, procedures, and assessment rubrics for 10 experiments. The experiments cover topics like designing login activities, implementing different layouts, using intents to create activities, options menus, recycler views, themes and styles, saving and retrieving user data and preferences, location services, and animations. The manual aims to enhance students' skills in mobile application development and help them achieve relevant industry-defined competencies and outcomes through hands-on practical work.

Uploaded by

Ghetiya Niraj
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 67

Laboratory Manual for

Mobile Application Development


(3170726)

B.E. Semester 7
Computer Engineering

Government Engineering College,


Rajkot

Name Enrollment Number


Government Engineering College, Rajkot

Certificate

This is to certify that Mr./Ms.


Enrollment No. of B.E. Semester Computer
Engineering of this Inst tute (GTU Code: 020) has satisfactorily completed the
Practical / Tutorial work for the subject for the
academic year 202 -2 .

Place:

Date:

Name and Sign of Faculty member

Head of the Department

Student Enrollment No :200200107038 Page 1 of 66


Preface

Main motto of any laboratory/practical/field work is for enhancing required skills as well as creating
ability amongst students to solve real time problem by developing relevant competencies in psychomotor
domain. By keeping in view, GTU has designed competency focused outcome-based curriculum for
engineering degree programs where sufficient weightage is given to practical work. It shows importance
of enhancement of skills amongst the students and it pays attention to utilize every second of time allotted
for practical amongst students, instructors and faculty members to achieve relevant outcomes by
performing the experiments rather than having merely study type experiments. It is must for effective
implementation of competency focused outcome-based curriculum that every practical is keenly designed
to serve as a tool to develop and enhance relevant competency required by the various industry among
every student. These psychomotor skills are very difficult to develop through traditional chalk and board
content delivery method in the classroom.

Accordingly, this lab manual is designed to focus on the industry defined relevant outcomes, rather than
old practice of conducting practical to prove concept and theory. By using this lab manual students can
go through the relevant theory and procedure in advance before the actual performance which creates an
interest and students can have basic idea prior to performance.

This in turn enhances pre-determined outcomes amongst students. Each experiment in this manual begins
with competency, industry relevant skills, course outcomes as well as practical outcomes (objectives).
The students will also achieve safety and necessary precautions to be taken while performing practical.
This manual also provides guidelines to faculty members to facilitate student centric lab activities
through each experiment by arranging and managing necessary resources in order that the students follow
the procedures with required safety and necessary precautions to achieve the outcomes. It also gives an
idea that how students will be assessed by providing rubrics. Utmost care has been taken while preparing
this lab manual however always there is chances of improvement. Therefore, we welcome constructive
suggestions for improvement and removal of errors if any.

There are a growing number of people who uses smartphones and tablets and hence mobile app
development has ability to access a large segment. Android has an advantage of being open source. This
course will enable the students to develop mobile application using Android.

Student Enrollment No :200200107038 Page 2 of 66


Practical – Course Outcome matrix

Course Outcomes (COs):

CO1 Understand Android architecture, activities and their life cycle.

CO2 Apply the knowledge to design user interface using Android UI A d Component

CO3 Manage system database, remote database operations using web services and Firebase

Apply knowledge of map, location services, Graphics, android system and background
CO4
services

CO5 Publish and distribute Android Application


Sr. CO CO CO CO CO
Objective(s) of Experiment
No. 1 2 3 4 5
Design Login activity and implement control events: Use
EditText, Checkbox and Buttons. And implement above
1. events using following layouts: √
1. Linear Layout
2. Relative Layout
3. Table Layout
Create Activities & implement following
1. Implicit intent
2. √ √
2. Explicit Intent
3. Start Activity for Result
3. Practical: Use an Options Menu √
Create a Recycler View and list the details of student using
following fields:
1. Name
4. √ √
2. Address
3. Photo (Image)
4. Delete (Button Operation)
5. Practical: Theme, Custom Styles, Drawable √
6. Practical: Save user data in a database √
7. Practical: Get and Save User Preferences √ √
8 Practical: make a use of android system √
Using location service get the current location and display in √ √
9
Text View
10 Practical: Display the use of animations √

Student Enrollment No :200200107038 Page 3 of 66


Index
(Progressive Assessment Sheet)
Sign.
Date Date
Asses of
Sr. Objective(s) of Experiment Pag of of Rem
sment Teac
No. e perf sub arks
Mar her
No. orm miss
ks with
ance ion
date
Design Login activity and implement control events: Use
EditText, Checkbox and Buttons. And implement above
events using following layouts:
1.
1. Linear Layout
2. Relative Layout
3. Table Layout
Create Activities & implement following
1. Implicit intent
2.
2. Explicit Intent
3. Start Activity for Result
3. Practical: Use an Options Menu
Create a Recycler View and list the details of student using
following fields:
1. Name
4.
2. Address
3. Photo (Image)
4. Delete (Button Operation)
5. Practical: Theme, Custom Styles, Drawable
6. Practical: Save user data in a database

7. Practical: Get and Save User Preferences


8 Practical: make a use of android system
Using location service get the current location and display in
9
Text View
10 Practical: Display the use of animations

Total

Student Enrollment No :200200107038 Page 4 of 66


Vision and Mission of Computer Department:
Vision:
✓ To achieve excellence for providing value-based education in Computer
Engineering through innovation, team work and ethical practices

Mission:
✓ To produce computer science and engineering graduates according to the
needs of industry, government, society and scientific community.
✓ To develop partnership with industries, government agencies and R and D
Organizations
✓ To motivate students/graduates to be entrepreneurs.
✓ To motivate students to participate in reputed conferences, workshops,
symposiums, sem nars and related technical activities

Student Enrollment No :200200107038 Page 5 of 66


Practical-1
AIM: Design Login activity and implement control events: Use EditText,
Checkbox and Buttons. And implement above events using following layouts:

1. Linear Layout 2. Relative Layout 3. Table Layout


Code: XML FILE, JAVA FILE

→Activity_Practical1.xml

<LinearLayout

xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:tools="http://schemas.android.com/tools"

android:layout_width="match_parent"

android:layout_height="match_parent"

xmlns:app="http://schemas.android.com/apk/res-auto"

android:orientation="vertical"

tools:context=".MainActivity">

<RelativeLayout

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:elevation="36dp"

tools:ignore="UselessParent">

<TextView

android:id="@+id/tvName"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="Name : Pratik P shah"

android:textColor="@color/black"

Student Enrollment No :200200107038 Page 6 of 66


android:textStyle="normal"

android:textSize="15sp"

android:layout_marginStart="46dp"

android:layout_marginEnd="46dp"

android:layout_marginTop="10dp"/>

<TextView

android:id="@+id/tverno"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_below="@id/tvName"

android:layout_marginStart="46dp"

android:layout_marginTop="10dp"

android:layout_marginEnd="46dp"

android:text="Er no : 180130107098"

android:textColor="@color/black"

android:textSize="15sp"

android:textStyle="normal" />

<TextView

android:id="@+id/tvaim1"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="Aim 1: Design Login activity and implement control events : Use EditText,
Checkbox and Buttons."

android:textColor="@color/black"

Student Enrollment No :200200107038 Page 7 of 66


android:layout_below="@id/tverno"

android:textStyle="normal"

android:textSize="15sp"

android:layout_marginStart="46dp"

android:layout_marginEnd="46dp"

android:layout_marginTop="10dp"/>

<TextView

android:id="@+id/tvaim2"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="Aim 2: Implement Practical 1 using following layouts: 1. Linear Layout 2.


Relative Layout 3. Table Layout."

android:textColor="@color/black"

android:layout_below="@id/tvaim1"

android:textStyle="normal"

android:textSize="15sp"

android:layout_marginStart="46dp"

android:layout_marginEnd="46dp"

android:layout_marginTop="10dp"/>

<LinearLayout

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:orientation="vertical"

android:id="@+id/llayout"

android:layout_marginLeft="46dp"

Student Enrollment No :200200107038 Page 8 of 66


android:layout_marginRight="46dp"

android:layout_centerVertical="true">

<com.google.android.material.textfield.TextInputLayout

android:layout_width="match_parent"

android:layout_height="wrap_content"

style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"

app:startIconDrawable="@drawable/user"

android:hint="Enter Your ID"

android:id="@+id/tilId"

app:endIconMode="clear_text"

>

<com.google.android.material.textfield.TextInputEditText

android:padding="10dp"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:id="@+id/etId"

android:inputType="text"/>

</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_marginTop="15dp"

style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"

app:startIconDrawable="@drawable/lock"

Student Enrollment No :200200107038 Page 9 of 66


app:endIconMode="password_toggle"

android:hint="Enter Your Password"

android:id="@+id/tilPassword">

<com.google.android.material.textfield.TextInputEditText

android:padding="10dp"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:id="@+id/etPassword"

android:inputType="textPassword"/>

</com.google.android.material.textfield.TextInputLayout>

<CheckBox

android:id="@+id/chBox"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="Remember Me?"

android:layout_marginTop="7dp"

android:buttonTint="@color/black"

/>

<TableLayout

android:layout_width="match_parent"

android:layout_height="wrap_content">

<TableRow

android:layout_width="match_parent"

Student Enrollment No :200200107038 Page 10 of 66


android:layout_height="wrap_content">

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="Need Help?"

android:layout_column="1"

android:textColor="@color/black"

/>

<Button

android:id="@+id/btnLogin"

android:layout_width="0200dp"

android:layout_marginStart="20dp"

android:layout_height="wrap_content"

android:layout_column="2"

android:text="LogIn"

android:layout_marginLeft="20dp" />

</TableRow>

</TableLayout>

</LinearLayout>

<LinearLayout

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:orientation="horizontal"

Student Enrollment No :200200107038 Page 11 of 66


android:weightSum="2"

android:layout_alignParentBottom="true"

android:gravity="center"

android:padding="10dp"

>

<TextView

android:layout_width="0dp"

android:layout_height="wrap_content"

android:text="Dont Have an Account?"

android:textColor="@color/black"

android:layout_gravity="bottom"

android:layout_weight="1"/>

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:textColor="@color/black"

android:text="Register Instead."

android:layout_gravity="bottom"

android:textStyle="bold"

/>

</LinearLayout>

</RelativeLayout>

</LinearLayout>

Student Enrollment No :200200107038 Page 12 of 66


1
2
3
4 →Practical_1.java

5 package com.example.mad_practicals.Practical_1;
6
7
8
9 import androidx.appcompat.app.AppCompatActivity;
10
11
12
13 import android.os.Bundle;

14 import android.view.View;

15 import android.widget.Button;

16 import android.widget.CheckBox;

17 import android.widget.Toast;

18 import com.example.mad_practicals.R;
19
20 import com.google.android.material.textfield.TextInputEditText;

21 import java.util.Objects;

22 public class Practical_1 extends AppCompatActivity {

23 TextInputEditText etId;

24 TextInputEditText etPass;

25 Button btnSubmit;

26 CheckBox checkBox;

27 Button btnSS;

28 String check="";
29
30
31 @Override
32
33 protected void onCreate(Bundle savedInstanceState) {

34 super.onCreate(savedInstanceState);

35 setContentView(R.layout.activity_practical1);

Student Enrollment No :200200107038 Page 13 of 66


btnSubmit=findViewById(R.id.btnLogin);

etId=findViewById(R.id.etId);

etPass=findViewById(R.id.etPassword); checkBox

=findViewById(R.id.chBox);

btnSubmit.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {if

(!checkEmptyFields()) {

if(checkBox.isChecked()){

check="With Checkbox";

}else {

check="Without CheckBox";

Toast.makeText(getApplicationContext(),
Objects.requireNonNull(etId.getText()).toString() + " LoggedIN " + check,
Toast.LENGTH_LONG).show();

});

private boolean checkEmptyFields() {boolean

e=false;

if (Objects.requireNonNull(etId.getText()).toString().trim().isEmpty()){

etId.setError("Please enter your ID");

e=true;

Student Enrollment No :200200107038 Page 14 of 66


}else {

etId.setError(null);

if (Objects.requireNonNull(etPass.getText()).toString().trim().equals("")){

etPass.setError("Please Enter your Password");

e=true;

}else {

etPass.setError(null);

return e;

Output:

Student Enrollment No :200200107038 Page 15 of 66


References used by the students:

Rubric wise marks obtained:

RUBRICS 1 2 3 4 5 TOTAL

MARKS

Student Enrollment No :200200107038 Page 16 of 66


Practical-2
AIM: Create Activities & implement following
1. Implicit intent 2. Explicit Intent 3. Start Activity for Result
Code:
Activity_implicit_intent.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=".Practical_3.ImplicitIntentActivity">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter the URL"
android:id="@+id/etUrl"
android:layout_marginTop="20dp"
app:layout_constraintTop_toTopOf="parent"/>

<Button
android:id="@+id/btnURL"
android:layout_width="200dp"
android:layout_height="60dp"

android:text="Clich here"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/etUrl" />
</androidx.constraintlayout.widget.ConstraintLayout>
Activity_explicit_intent.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=".Practical_3.ExplicitIntentActivity">

<Button
android:id="@+id/btnpre"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="50dp"
android:layout_marginLeft="50dp"
android:layout_marginTop="100dp"
android:text="GO back to Implicit Intent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<Button
android:id="@+id/btnnext"
android:layout_width="wrap_content"
Student Enrollment No :200200107038 Page 17 of 66
android:layout_height="wrap_content"
android:layout_marginEnd="50dp"
android:layout_marginRight="50dp"
android:layout_marginBottom="100dp"
android:text="Go next "
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
Activity_start_act_for_result1.xml
<?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"
android:orientation="vertical"
tools:context=".Practical_3.StartActForResult_1stActivity">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="15sp"

android:text="Hello"
android:textStyle="normal"
android:textColor="@color/black"
android:padding="10dp"
android:gravity="center"
android:layout_marginTop="100dp"
android:id="@+id/tvDisplay"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Get Message From Another activity"
android:id="@+id/btnDisplay"
android:layout_marginTop="50dp"
android:layout_marginStart="52dp"
android:layout_marginEnd="52dp"/>

</LinearLayout>
Activity_start_act_for_result2.xml
<?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"
android:gravity="center"

android:orientation="vertical"
tools:context=".Practical_3.StartActForResult_2Activity">

<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
Student Enrollment No :200200107038 Page 18 of 66
android:id="@+id/etSend"
android:hint="Enter a string"
android:padding="10dp"
android:textColor="@color/black"
/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Send String"
android:layout_marginTop="20dp"
android:id="@+id/btnSend"
/>
</LinearLayout>
Activity_third_Practical.xml
<?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=".Practical_3.ThirdPractical"
android:orientation="vertical">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="36dp"
tools:ignore="UselessParent">
<androidx.appcompat.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/toolBar3"
app:title="Practical 3"
android:background="@color/Green"
app:titleTextColor="@color/white"
/>
<TextView
android:id="@+id/tvName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Name: Pratik P shah"
android:textColor="@color/black"
android:layout_below="@id/toolBar3"
android:textStyle="normal"

android:textSize="15sp"
android:layout_marginStart="46dp"
android:layout_marginEnd="46dp"
android:layout_marginTop="10dp"/>
<TextView
android:id="@+id/tverno"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Er no: 180130107098"
Student Enrollment No :200200107038 Page 19 of 66
android:textColor="@color/black"
android:layout_below="@id/tvName"
android:textStyle="normal"
android:textSize="15sp"
android:layout_marginStart="46dp"
android:layout_marginEnd="46dp"
android:layout_marginTop="10dp"/>
<TextView
android:id="@+id/tvaim1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Aim 3: Create Activities and implement following 1. Implicit intent 2. Explicit
Intent 3. Start Activity For Result"
android:textColor="@color/black"
android:layout_below="@id/tverno"
android:textStyle="normal"

android:textSize="15sp"
android:layout_marginStart="46dp"
android:layout_marginEnd="46dp"
android:layout_marginTop="10dp"/>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:orientation="vertical"
android:layout_marginStart="46dp"
android:layout_marginEnd="46dp"
android:gravity="center"
>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Implicit Intent"
android:id="@+id/btnImplicit"/>

<Button
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"

android:text="Explicit Intent"
android:id="@+id/btnExplicit"/>

<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="StartActivityFOrResult"
android:layout_marginTop="10dp"
android:id="@+id/btnStartActivityFOrResult"/>

</LinearLayout>
</RelativeLayout>

Student Enrollment No :200200107038 Page 20 of 66


</LinearLayout>
ExplicitIntentActivity.java
package com.example.mad_practicals.Practical_3;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.example.mad_practicals.R;

public class ExplicitIntentActivity extends AppCompatActivity {

Button btnPre;
Button btnNext;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_explicit_intent);

btnNext=findViewById(R.id.btnnext);
btnPre=findViewById(R.id.btnpre);

btnPre.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(ExplicitIntentActivity.this,ImplicitIntentActivity.class));
}
});
btnNext.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new
Intent(ExplicitIntentActivity.this,StartActForResult_1stActivity.class));
}

});
}
}
ImplicitIntentActivity.java
package com.example.mad_practicals.Practical_3;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.example.mad_practicals.R;

Student Enrollment No :200200107038 Page 21 of 66


public class ImplicitIntentActivity extends AppCompatActivity {

EditText etURL;
Button btnURL;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_implicit_intent);

etURL=findViewById(R.id.etUrl);
btnURL=findViewById(R.id.btnURL);
btnURL.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(etURL.getText().toString()));
startActivity(intent);
}
});
}
}
StartActForResult_1Activity.java
package com.example.mad_practicals.Practical_3;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.example.mad_practicals.R;

public class StartActForResult_1stActivity extends AppCompatActivity {

TextView tvDisplay;
Button btnDisplay;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_start_act_for_result1st);

tvDisplay=findViewById(R.id.tvDisplay);
btnDisplay=findViewById(R.id.btnDisplay);
btnDisplay.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new
Intent(StartActForResult_1stActivity.this,StartActForResult_2Activity.class);
startActivityForResult(intent,2);
}
});
}
Student Enrollment No :200200107038 Page 22 of 66
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
if (requestCode==2){

String message=data.getStringExtra("message");
tvDisplay.setText(message);
}
super.onActivityResult(requestCode, resultCode, data);
}
}
StartActForResult_2Activity.java
package com.example.mad_practicals.Practical_3;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.example.mad_practicals.R;

public class StartActForResult_2Activity extends AppCompatActivity {

EditText editText;
Button button;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_start_act_for_result2);

editText=findViewById(R.id.etSend);
button=findViewById(R.id.btnSend);

button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent();
intent.putExtra("message",editText.getText().toString());
setResult(2,intent);
finish();
}
});
}
}

ThirdPractical.java
package com.example.mad_practicals.Practical_3;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

Student Enrollment No :200200107038 Page 23 of 66


import com.example.mad_practicals.R;

public class ThirdPractical extends AppCompatActivity {

Button btn1;
Button btn2;
Button btn3;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_third_practical);

btn1=findViewById(R.id.btnImplicit);
btn2=findViewById(R.id.btnExplicit);
btn3=findViewById(R.id.btnStartActivityFOrResult);

btn1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(ThirdPractical.this,ImplicitIntentActivity.class);
startActivity(intent);
}
});

btn2.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {
Intent intent=new Intent(ThirdPractical.this,ExplicitIntentActivity.class);
startActivity(intent);
}
});
btn3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(ThirdPractical.this,StartActForResult_1stActivity.class);
startActivity(intent);
}
});
}
}
Outpu

Student Enrollment No :200200107038 Page 24 of 66


References used by the students:

Rubric wise marks obtained:

RUBRICS 1 2 3 4 5 TOTAL

MARKS

Student Enrollment No :200200107038 Page 25 of 66


Practical-3
Practical: Use an Options Menu

activity_main.xml

We have only one textview in this file.

File: activity_main.xml
1. <?xml version="1.0" encoding="utf-8"?>
2. <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.
com/apk/res/android"
3. xmlns:app="http://schemas.android.com/apk/res-auto"
4. xmlns:tools="http://schemas.android.com/tools"
5. android:layout_width="match_parent"
6. android:layout_height="match_parent"
7. tools:context="example.javatpoint.com.optionmenu.MainActivity">
8.
9. <android.support.design.widget.AppBarLayout
10. android:layout_width="match_parent"
11. android:layout_height="wrap_content"
12. android:theme="@style/AppTheme.AppBarOverlay">
13.
14. <android.support.v7.widget.Toolbar
15. android:id="@+id/toolbar"
16. android:layout_width="match_parent"
17. android:layout_height="?attr/actionBarSize"
18. android:background="?attr/colorPrimary"
19. app:popupTheme="@style/AppTheme.PopupOverlay" />
20.
21. </android.support.design.widget.AppBarLayout>
22.
23. <include layout="@layout/content_main" />
24.
25. </android.support.design.widget.CoordinatorLayout>
File: context_main.xml
1. <?xml version="1.0" encoding="utf-8"?>
2. <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/a
pk/res/android"

Student Enrollment No :200200107038 Page 26 of 66


3. xmlns:app="http://schemas.android.com/apk/res-auto"
4. xmlns:tools="http://schemas.android.com/tools"
5. android:layout_width="match_parent"
6. android:layout_height="match_parent"
7. app:layout_behavior="@string/appbar_scrolling_view_behavior"
8. tools:context="example.javatpoint.com.optionmenu.MainActivity"
9. tools:showIn="@layout/activity_main">
10.
11. <TextView
12. android:layout_width="wrap_content"
13. android:layout_height="wrap_content"
14. android:text="Hello World!"
15. app:layout_constraintBottom_toBottomOf="parent"
16. app:layout_constraintLeft_toLeftOf="parent"
17. app:layout_constraintRight_toRightOf="parent"
18. app:layout_constraintTop_toTopOf="parent" />
19.
20. </android.support.constraint.ConstraintLayout>
menu_main.xml

It contains three items as show below. It is created automatically inside the res/menu directory.

File: menu_main.xml
1. <menu xmlns:android="http://schemas.android.com/apk/res/android"
2. xmlns:app="http://schemas.android.com/apk/res-auto"
3. xmlns:tools="http://schemas.android.com/tools"
4. tools:context="example.javatpoint.com.optionmenu.MainActivity">
5.
6. <item android:id="@+id/item1"
7. android:title="Item 1"/>
8. <item android:id="@+id/item2"
9. android:title="Item 2"/>
10. <item android:id="@+id/item3"
11. android:title="Item 3"
12. app:showAsAction="withText"/>
13. </menu>

Student Enrollment No :200200107038 Page 27 of 66


Activity class

This class displays the content of menu.xml file and performs event handling on clicking the
menu items.

File: MainActivity.java
1. package example.javatpoint.com.optionmenu;
2.
3. import android.os.Bundle;
4. import android.support.v7.app.AppCompatActivity;
5. import android.support.v7.widget.Toolbar;
6. import android.view.Menu;
7. import android.view.MenuItem;
8. import android.widget.Toast;
9.
10. public class MainActivity extends AppCompatActivity {
11.
12. @Override
13. protected void onCreate(Bundle savedInstanceState) {
14. super.onCreate(savedInstanceState);
15. setContentView(R.layout.activity_main);
16. Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
17. setSupportActionBar(toolbar);
18. }
19.
20. @Override
21. public boolean onCreateOptionsMenu(Menu menu) {
22. // Inflate the menu; this adds items to the action bar if it is present.
23. getMenuInflater().inflate(R.menu.menu_main, menu);
24. return true;
25. }
26.
27. @Override
28. public boolean onOptionsItemSelected(MenuItem item) {
29. int id = item.getItemId();
30. switch (id){
31. case R.id.item1:

Student Enrollment No :200200107038 Page 28 of 66


32. Toast.makeText(getApplicationContext(),"Item 1 Selected",Toast.LENGTH_LONG).show(
);
33. return true;
34. case R.id.item2:
35. Toast.makeText(getApplicationContext(),"Item 2 Selected",Toast.LENGTH_LON
G).show();
36. return true;
37. case R.id.item3:
38. Toast.makeText(getApplicationContext(),"Item 3 Selected",Toast.LENGTH_LONG).show(
);
39. return true;
40. default:
41. return super.onOptionsItemSelected(item);
42. }
43. }
44. }
Output:

Output without clicking on the menu button.

Student Enrollment No :200200107038 Page 29 of 66


References used by the students:

Rubric wise marks obtained:

RUBRICS 1 2 3 4 5 TOTAL

MARKS

Student Enrollment No :200200107038 Page 30 of 66


Practical-4
write code Create a Recycler View and list the details of student using
following fields: 1. Name 2. Address 3. Photo (Image) 4. Delete (Button
Operation)

<!-- item_student.xml -->


<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

<ImageView
android:id="@+id.studentPhoto"
android:layout_width="64dp"
android:layout_height="64dp"
android:contentDescription="Student Photo" />

<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">

<TextView
android:id="@+id.studentName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="18sp" />

<TextView
android:id="@+id.studentAddress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="14sp" />

</LinearLayout>

<Button
android:id="@+id.deleteButton"
android:layout_width="wrap_content"
android:layout_height="64dp"
android:text="Delete" />

</LinearLayout>

Student Enrollment No :200200107038 Page 31 of 66


public class Student {
private String name;
private String address;
private String photoUrl;

public Student(String name, String address, String photoUrl) {


this.name = name;
this.address = address;
this.photoUrl = photoUrl;
}

public String getName() {


return name;
}

public String getAddress() {


return address;
}

public String getPhotoUrl() {


return photoUrl;
}
}

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.squareup.picasso.Picasso;
import java.util.List;

public class StudentAdapter extends RecyclerView.Adapter<StudentAdapter.StudentViewHolder> {

private List<Student> studentList;


private Context context;
private OnDeleteClickListener onDeleteClickListener;

public StudentAdapter(List<Student> studentList, Context context, OnDeleteClickListener


onDeleteClickListener) {
this.studentList = studentList;
this.context = context;
this.onDeleteClickListener = onDeleteClickListener;
}

@NonNull
@Override
public StudentViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(context).inflate(R.layout.item_student, parent, false);
return new StudentViewHolder(view);
}
Student Enrollment No :200200107038 Page 32 of 66
@Override
public void onBindViewHolder(@NonNull StudentViewHolder holder, int position) {
Student student = studentList.get(position);

holder.studentName.setText(student.getName());
holder.studentAddress.setText(student.getAddress());

// Load the student photo using Picasso (update with your image loading library)
Picasso.get().load(student.getPhotoUrl()).into(holder.studentPhoto);

holder.deleteButton.setOnClickListener(v -> {
onDeleteClickListener.onDeleteClick(position);
});
}

@Override
public int getItemCount() {
return studentList.size();
}

public interface OnDeleteClickListener {


void onDeleteClick(int position);
}

public class StudentViewHolder extends RecyclerView.ViewHolder {


ImageView studentPhoto;
TextView studentName;
TextView studentAddress;
Button deleteButton;

public StudentViewHolder(@NonNull View itemView) {


super(itemView);
studentPhoto = itemView.findViewById(R.id.studentPhoto);
studentName = itemView.findViewById(R.id.studentName);
studentAddress = itemView.findViewById(R.id.studentAddress);
deleteButton = itemView.findViewById(R.id.deleteButton);
}
}
}

import android.os.Bundle;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {

private List<Student> studentList = new ArrayList<>();


private RecyclerView recyclerView;
private StudentAdapter studentAdapter;

Student Enrollment No :200200107038 Page 33 of 66


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

recyclerView = findViewById(R.id.recyclerView);

// Add sample student data


studentList.add(new Student("John Doe", "123 Main St", "https://example.com/photo1.jpg"));
studentList.add(new Student("Jane Smith", "456 Elm St", "https://example.com/photo2.jpg"));

studentAdapter = new StudentAdapter(studentList, this, position -> {


// Handle the Delete button click
studentList.remove(position);
studentAdapter.notifyItemRemoved(position);
Toast.makeText(this, "Student deleted", Toast.LENGTH_SHORT).show();
});

recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(studentAdapter);
}
}

References used by the students:

Rubric wise marks obtained:

RUBRICS 1 2 3 4 5 TOTAL

MARKS

Student Enrollment No :200200107038 Page 34 of 66


Practical: 5 Theme, Custom Styles, Drawable

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


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.android.scorekeeper.MainActivity">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:text="@string/team_1"/>

<ImageButton
android:id="@+id/decreaseTeam1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:contentDescription="@string/minus_button"
android:src="@drawable/ic_minus" />

<TextView
android:id="@+id/score_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/initial_count"/>

<ImageButton
android:id="@+id/increaseTeam1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:contentDescription="@string/plus_button"
android:src="@drawable/ic_plus"/>
Student Enrollment No :200200107038 Page 35 of 66
</RelativeLayout>

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:text="@string/team_2"/>

<ImageButton
android:id="@+id/decreaseTeam2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:contentDescription="@string/minus_button"
android:src="@drawable/ic_minus"/>

<TextView
android:id="@+id/score_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/initial_count"/>

<ImageButton
android:id="@+id/increaseTeam2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:contentDescription="@string/plus_button"
android:src="@drawable/ic_plus"/>
</RelativeLayout>
</LinearLayout>

/**
* Method that handles the onClick of both the decrement buttons
* @param view The button view that was clicked
*/
public void decreaseScore(View view) {
//Get the ID of the button that was clicked
int viewID = view.getId();
switch (viewID){
//If it was on Team 1
case R.id.decreaseTeam1:
//Decrement the score and update the TextView
Student Enrollment No :200200107038 Page 36 of 66
mScore1--;
mScoreText1.setText(String.valueOf(mScore1));
break;
//If it was Team 2
case R.id.decreaseTeam2:
//Decrement the score and update the TextView
mScore2--;
mScoreText2.setText(String.valueOf(mScore2));
}
}

/**
* Method that handles the onClick of both the increment buttons
* @param view The button view that was clicked
*/
public void increaseScore(View view) {
//Get the ID of the button that was clicked
int viewID = view.getId();
switch (viewID){
//If it was on Team 1
case R.id.increaseTeam1:
//Increment the score and update the TextView
mScore1++;
mScoreText1.setText(String.valueOf(mScore1));
break;
//If it was Team 2
case R.id.increaseTeam2:
//Increment the score and update the TextView
mScore2++;
mScoreText2.setText(String.valueOf(mScore2));
}
}

Output

Student Enrollment No :200200107038 Page 37 of 66


References used by the students:

Rubric wise marks obtained:

RUBRICS 1 2 3 4 5 TOTAL

MARKS

Student Enrollment No :200200107038 Page 38 of 66


Practical:6 Save user data in a database

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


<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">

<!--Edit text to enter course name-->


<EditText
android:id="@+id/idEdtCourseName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:hint="Enter course Name" />

<!--edit text to enter course duration-->


<EditText
android:id="@+id/idEdtCourseDuration"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:hint="Enter Course Duration" />

<!--edit text to display course tracks-->


<EditText
android:id="@+id/idEdtCourseTracks"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:hint="Enter Course Tracks" />

<!--edit text for course description-->


<EditText
android:id="@+id/idEdtCourseDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:hint="Enter Course Description" />

<!--button for adding new course-->


<Button
android:id="@+id/idBtnAddCourse"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="Add Course"
Student Enrollment No :200200107038 Page 39 of 66
android:textAllCaps="false" />

</LinearLayout>

import android.content.ContentValues;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DBHandler extends SQLiteOpenHelper {

// creating a constant variables for our database.


// below variable is for our database name.
private static final String DB_NAME = "coursedb";

// below int is our database version


private static final int DB_VERSION = 1;

// below variable is for our table name.


private static final String TABLE_NAME = "mycourses";

// below variable is for our id column.


private static final String ID_COL = "id";

// below variable is for our course name column


private static final String NAME_COL = "name";

// below variable id for our course duration column.


private static final String DURATION_COL = "duration";

// below variable for our course description column.


private static final String DESCRIPTION_COL = "description";

// below variable is for our course tracks column.


private static final String TRACKS_COL = "tracks";

// creating a constructor for our database handler.


public DBHandler(Context context) {
super(context, DB_NAME, null, DB_VERSION);
}

// below method is for creating a database by running a sqlite query


@Override
public void onCreate(SQLiteDatabase db) {
// on below line we are creating
// an sqlite query and we are
// setting our column names
// along with their data types.
String query = "CREATE TABLE " + TABLE_NAME + " ("
+ ID_COL + " INTEGER PRIMARY KEY AUTOINCREMENT, "
+ NAME_COL + " TEXT,"
Student Enrollment No :200200107038 Page 40 of 66
+ DURATION_COL + " TEXT,"
+ DESCRIPTION_COL + " TEXT,"
+ TRACKS_COL + " TEXT)";

// at last we are calling a exec sql


// method to execute above sql query
db.execSQL(query);
}

// this method is use to add new course to our sqlite database.


public void addNewCourse(String courseName, String courseDuration, String
courseDescription, String courseTracks) {

// on below line we are creating a variable for


// our sqlite database and calling writable method
// as we are writing data in our database.
SQLiteDatabase db = this.getWritableDatabase();

// on below line we are creating a


// variable for content values.
ContentValues values = new ContentValues();

// on below line we are passing all values


// along with its key and value pair.
values.put(NAME_COL, courseName);
values.put(DURATION_COL, courseDuration);
values.put(DESCRIPTION_COL, courseDescription);
values.put(TRACKS_COL, courseTracks);

// after adding all values we are passing


// content values to our table.
db.insert(TABLE_NAME, null, values);

// at last we are closing our


// database after adding database.
db.close();
}

@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
// this method is called to check if the table exists already.
db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
onCreate(db);
}
}

Student Enrollment No :200200107038 Page 41 of 66


import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

// creating variables for our edittext, button and dbhandler


private EditText courseNameEdt, courseTracksEdt, courseDurationEdt,
courseDescriptionEdt;
private Button addCourseBtn;
private DBHandler dbHandler;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

// initializing all our variables.


courseNameEdt = findViewById(R.id.idEdtCourseName);
courseTracksEdt = findViewById(R.id.idEdtCourseTracks);
courseDurationEdt = findViewById(R.id.idEdtCourseDuration);
courseDescriptionEdt = findViewById(R.id.idEdtCourseDescription);
addCourseBtn = findViewById(R.id.idBtnAddCourse);

// creating a new dbhandler class


// and passing our context to it.
dbHandler = new DBHandler(MainActivity.this);

// below line is to add on click listener for our add course button.
addCourseBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

// below line is to get data from all edit text fields.


String courseName = courseNameEdt.getText().toString();
String courseTracks = courseTracksEdt.getText().toString();
String courseDuration = courseDurationEdt.getText().toString();
String courseDescription = courseDescriptionEdt.getText().toString();

// validating if the text fields are empty or not.


if (courseName.isEmpty() && courseTracks.isEmpty() &&
courseDuration.isEmpty() && courseDescription.isEmpty()) {
Toast.makeText(MainActivity.this, "Please enter all the data..",
Toast.LENGTH_SHORT).show();
return;
}

Student Enrollment No :200200107038 Page 42 of 66


// on below line we are calling a method to add new
// course to sqlite data and pass all our values to it.
dbHandler.addNewCourse(courseName, courseDuration,
courseDescription, courseTracks);

// after adding the data we are displaying a toast message.


Toast.makeText(MainActivity.this, "Course has been added.",
Toast.LENGTH_SHORT).show();
courseNameEdt.setText("");
courseDurationEdt.setText("");
courseTracksEdt.setText("");
courseDescriptionEdt.setText("");
}
});
}
}

Output

Student Enrollment No :200200107038 Page 43 of 66


References used by the students:

Rubric wise marks obtained:

RUBRICS 1 2 3 4 5 TOTAL

MARKS

Student Enrollment No :200200107038 Page 44 of 66


Practical:7 Get and Save User Preferences

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


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
tools:ignore="HardcodedText">

<TextView
android:id="@+id/textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="32dp"
android:text="Shared Preferences Demo"
android:textColor="@android:color/black"
android:textSize="24sp" />

<!--EditText to take the data from the user and save the
data in SharedPreferences-->
<EditText
android:id="@+id/edit1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/textview"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:hint="Enter your Name"
android:padding="10dp" />

<!--EditText to take the data from the user and save the
data in SharedPreferences-->
<EditText
android:id="@+id/edit2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/edit1"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:hint="Enter your Age"
android:inputType="number"
android:padding="10dp" />
</RelativeLayout>

Student Enrollment No :200200107038 Page 45 of 66


import androidx.appcompat.app.AppCompatActivity;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.widget.EditText;

public class MainActivity extends AppCompatActivity {


private EditText name, age;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
name = findViewById(R.id.edit1);
age = findViewById(R.id.edit2);
}

// Fetch the stored data in onResume() Because this is what


will be called when the app opens again
@Override
protected void onResume() {
super.onResume();
// Fetching the stored data from the
SharedPreference
SharedPreferences sh =
getSharedPreferences("MySharedPref", MODE_PRIVATE);
String s1 = sh.getString("name", "");
int a = sh.getInt("age", 0);

// Setting the fetched data in the EditTexts


name.setText(s1);
age.setText(String.valueOf(a));
}

// Store the data in the SharedPreference in the onPause()


method
// When the user closes the application onPause() will be
called and data will be stored
@Override
protected void onPause() {
super.onPause();
// Creating a shared pref object with a file name
"MySharedPref" in private mode
SharedPreferences sharedPreferences =
getSharedPreferences("MySharedPref", MODE_PRIVATE);
SharedPreferences.Editor myEdit =
sharedPreferences.edit();

// write all the data entered by the user in


SharedPreference and apply
myEdit.putString("name",
name.getText().toString());
Student Enrollment No :200200107038 Page 46 of 66
myEdit.putInt("age",
Integer.parseInt(age.getText().toString()));
myEdit.apply();
}
}

Output

References used by the students:

Rubric wise marks obtained:

RUBRICS 1 2 3 4 5 TOTAL

MARKS

Student Enrollment No :200200107038 Page 47 of 66


Practical:8 make a use of android system

<?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"
android:background="#168BC34A"
tools:context=".MainActivity">

<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="1.0"
tools:ignore="MissingConstraints">

<TextView
android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="170dp"
android:fontFamily="@font/roboto"
android:text="@string/heading"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:textColor="@android:color/holo_green_dark"
android:textSize="36sp"
android:textStyle="bold" />

<Button
android:id="@+id/startButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="20dp"
android:background="#4CAF50"
android:fontFamily="@font/roboto"
android:text="@string/startButtonText"
android:textAlignment="center"
Student Enrollment No :200200107038 Page 48 of 66
android:textAppearance="@style/TextAppearance.AppCompat.Display1"
android:textColor="#FFFFFF"
android:textStyle="bold" />

<Button
android:id="@+id/stopButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="20dp"
android:background="#4CAF50"
android:fontFamily="@font/roboto"
android:text="@string/stopButtonText"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.AppCompat.Display1"
android:textColor="#FFFFFF"
android:textStyle="bold" />

<ImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="80dp"
app:srcCompat="@drawable/banner" />
</LinearLayout>

</androidx.constraintlayout.widget.ConstraintLayout>

import android.app.Service;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.IBinder;
import android.provider.Settings;
import androidx.annotation.Nullable;

public class NewService extends Service {

// declaring object of MediaPlayer


private MediaPlayer player;

@Override

// execution of service will start


// on calling this method
public int onStartCommand(Intent intent, int flags, int startId) {

// creating a media player which


// will play the audio of Default
// ringtone in android device
Student Enrollment No :200200107038 Page 49 of 66
player = MediaPlayer.create( this, Settings.System.DEFAULT_RINGTONE_URI );

// providing the boolean


// value as true to play
// the audio on loop
player.setLooping( true );

// starting the process


player.start();

// returns the status


// of the program
return START_STICKY;
}

@Override

// execution of the service will


// stop on calling this method
public void onDestroy() {
super.onDestroy();

// stopping the process


player.stop();
}

@Nullable
@Override
public IBinder onBind(Intent intent) {
return null;
}
}

Student Enrollment No :200200107038 Page 50 of 66


import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

// declaring objects of Button class


private Button start, stop;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate( savedInstanceState );
setContentView( R.layout.activity_main );

// assigning ID of startButton
// to the object start
start = (Button) findViewById( R.id.startButton );

// assigning ID of stopButton
// to the object stop
stop = (Button) findViewById( R.id.stopButton );

// declaring listeners for the


// buttons to make them respond
// correctly according to the process
start.setOnClickListener( this );
stop.setOnClickListener( this );
}

public void onClick(View view) {

// process to be performed
// if start button is clicked
if(view == start){

// starting the service


startService(new Intent( this, NewService.class ) );
}

// process to be performed
// if stop button is clicked
else if (view == stop){

// stopping the service


stopService(new Intent( this, NewService.class ) );

}
}
}
Student Enrollment No :200200107038 Page 51 of 66
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.services_in_android">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="preloaded_fonts"
android:resource="@array/preloaded_fonts" />

<!-- Mention the service name here -->


<service android:name=".NewService"/>

</application>

</manifest>

Output

Student Enrollment No :200200107038 Page 52 of 66


References used by the students:

Rubric wise marks obtained:

RUBRICS 1 2 3 4 5 TOTAL

MARKS

Student Enrollment No :200200107038 Page 53 of 66


Practical:9 Using location service get the current location and display in
Text View

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


<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.getuserlocation">

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />


<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"
/>

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.GetUserLocation">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />


</intent-filter>
</activity>
</application>

</manifest>

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


<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#4caf50"
android:gravity="center"
android:orientation="vertical">

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="120dp"
android:src="@drawable/gfgimage" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-black"
android:text="Latitude:" />
Student Enrollment No :200200107038 Page 54 of 66
<TextView
android:id="@+id/latTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Latitude will be here! "
android:textColor="#f5f5f5" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-black"
android:text="Longitude:" />

<TextView
android:id="@+id/lonTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Longitude will be here! "
android:textColor="#f5f5f5" />

</LinearLayout>

import android.Manifest;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.location.Location;
import android.location.LocationManager;
import android.os.Bundle;
import android.os.Looper;
import android.provider.Settings;
import android.widget.TextView;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;

import com.google.android.gms.location.FusedLocationProviderClient;
import com.google.android.gms.location.LocationCallback;
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.location.LocationResult;
import com.google.android.gms.location.LocationServices;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;

public class MainActivity extends AppCompatActivity {

// initializing
Student Enrollment No :200200107038 Page 55 of 66
// FusedLocationProviderClient
// object
FusedLocationProviderClient mFusedLocationClient;

// Initializing other items


// from layout file
TextView latitudeTextView, longitTextView;
int PERMISSION_ID = 44;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

latitudeTextView = findViewById(R.id.latTextView);
longitTextView = findViewById(R.id.lonTextView);

mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);

// method to get the location


getLastLocation();
}

@SuppressLint("MissingPermission")
private void getLastLocation() {
// check if permissions are given
if (checkPermissions()) {

// check if location is enabled


if (isLocationEnabled()) {

// getting last
// location from
// FusedLocationClient
// object
mFusedLocationClient.getLastLocation().addOnCompleteListener(new
OnCompleteListener<Location>() {
@Override
public void onComplete(@NonNull Task<Location> task) {
Location location = task.getResult();
if (location == null) {
requestNewLocationData();
} else {
latitudeTextView.setText(location.getLatitude() +
"");
longitTextView.setText(location.getLongitude() +
"");
}
}
});
} else {
Student Enrollment No :200200107038 Page 56 of 66
Toast.makeText(this, "Please turn on" + " your location...",
Toast.LENGTH_LONG).show();
Intent intent = new
Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
startActivity(intent);
}
} else {
// if permissions aren't available,
// request for permissions
requestPermissions();
}
}

@SuppressLint("MissingPermission")
private void requestNewLocationData() {

// Initializing LocationRequest
// object with appropriate methods
LocationRequest mLocationRequest = new LocationRequest();
mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
mLocationRequest.setInterval(5);
mLocationRequest.setFastestInterval(0);
mLocationRequest.setNumUpdates(1);

// setting LocationRequest
// on FusedLocationClient
mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);
mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback,
Looper.myLooper());
}

private LocationCallback mLocationCallback = new LocationCallback() {

@Override
public void onLocationResult(LocationResult locationResult) {
Location mLastLocation = locationResult.getLastLocation();
latitudeTextView.setText("Latitude: " + mLastLocation.getLatitude() + "");
longitTextView.setText("Longitude: " + mLastLocation.getLongitude() + "");
}
};

// method to check for permissions


private boolean checkPermissions() {
return ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_COARSE_LOCATION) ==
PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED;

// If we want background location


// on Android 10.0 and higher,
// use:
Student Enrollment No :200200107038 Page 57 of 66
// ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_BACKGROUND_LOCATION) ==
PackageManager.PERMISSION_GRANTED
}

// method to request for permissions


private void requestPermissions() {
ActivityCompat.requestPermissions(this, new String[]{
Manifest.permission.ACCESS_COARSE_LOCATION,
Manifest.permission.ACCESS_FINE_LOCATION}, PERMISSION_ID);
}

// method to check
// if location is enabled
private boolean isLocationEnabled() {
LocationManager locationManager = (LocationManager)
getSystemService(Context.LOCATION_SERVICE);
return locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER) ||
locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
}

// If everything is alright then


@Override
public void
onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[]
grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);

if (requestCode == PERMISSION_ID) {
if (grantResults.length > 0 && grantResults[0] ==
PackageManager.PERMISSION_GRANTED) {
getLastLocation();
}
}
}

@Override
public void onResume() {
super.onResume();
if (checkPermissions()) {
getLastLocation();
}
}
}

Output

Student Enrollment No :200200107038 Page 58 of 66


References used by the students:

Rubric wise marks obtained:

RUBRICS 1 2 3 4 5 TOTAL

MARKS

Student Enrollment No :200200107038 Page 59 of 66


Practical:10 Display the use of animations

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


<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<ImageView
android:id="@+id/imageview"
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="40dp"
android:contentDescription="@string/app_name"
android:src="@drawable/gfgimage" />

<LinearLayout
android:id="@+id/linear1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/imageview"
android:layout_marginTop="30dp"
android:orientation="horizontal"
android:weightSum="3">

<!--To start the blink animation of the image-->


<Button
android:id="@+id/BTNblink"
style="@style/TextAppearance.AppCompat.Widget.Button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_weight="1"
android:padding="3dp"
android:text="@string/blink"
android:textColor="@color/white" />

<!--To start the rotate animation of the image-->


<Button
android:id="@+id/BTNrotate"
style="@style/TextAppearance.AppCompat.Widget.Button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_weight="1"
android:padding="3dp"
android:text="@string/clockwise"
Student Enrollment No :200200107038 Page 60 of 66
android:textColor="@color/white" />

<!--To start the fading animation of the image-->


<Button
android:id="@+id/BTNfade"
style="@style/TextAppearance.AppCompat.Widget.Button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_weight="1"
android:padding="3dp"
android:text="@string/fade"
android:textColor="@color/white" />

</LinearLayout>
<LinearLayout
android:id="@+id/linear2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/linear1"
android:layout_marginTop="30dp"
android:orientation="horizontal"
android:weightSum="3">

<!--To start the move animation of the image-->


<Button
android:id="@+id/BTNmove"
style="@style/TextAppearance.AppCompat.Widget.Button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_weight="1"
android:padding="3dp"
android:text="@string/move"
android:textColor="@color/white" />

<!--To start the slide animation of the image-->


<Button
android:id="@+id/BTNslide"
style="@style/TextAppearance.AppCompat.Widget.Button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_weight="1"
android:padding="3dp"
android:text="@string/slide"
android:textColor="@color/white" />

<!--To start the zoom animation of the image-->


<Button
android:id="@+id/BTNzoom"
Student Enrollment No :200200107038 Page 61 of 66
style="@style/TextAppearance.AppCompat.Widget.Button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_weight="1"
android:padding="3dp"
android:text="@string/zoom"
android:textColor="@color/white" />

</LinearLayout>

<!--To stop the animation of the image-->


<Button
android:id="@+id/BTNstop"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/linear2"
android:layout_marginLeft="30dp"
android:layout_marginTop="30dp"
android:layout_marginRight="30dp"
android:text="@string/stop_animation" />

</RelativeLayout>

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


<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha android:fromAlpha="0.0"
android:toAlpha="1.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:duration="500"
android:repeatMode="reverse"
android:repeatCount="infinite"/>
</set>

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


<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_interpolator">

<!-- duration is the time for which animation will work-->


<alpha
android:duration="1000"
android:fromAlpha="0"
android:toAlpha="1" />

<alpha
android:duration="1000"
android:fromAlpha="1"
android:startOffset="2000"
android:toAlpha="0" />
Student Enrollment No :200200107038 Page 62 of 66
</set>

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


<set
xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator"
android:fillAfter="true">

<translate
android:fromXDelta="0%p"
android:toXDelta="75%p"
android:duration="700" />
</set>

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


<set
xmlns:android="http://schemas.android.com/apk/res/android">
<rotate
android:duration="6000"
android:fromDegrees="0"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="360" />

<rotate
android:duration="6000"
android:fromDegrees="360"
android:pivotX="50%"
android:pivotY="50%"
android:startOffset="5000"
android:toDegrees="0" />

</set>
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true" >
<scale
android:duration="500"
android:fromXScale="1.0"
android:fromYScale="1.0"
android:interpolator="@android:anim/linear_interpolator"
android:toXScale="1.0"
android:toYScale="0.0" />
</set>

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


<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true" >

<scale
Student Enrollment No :200200107038 Page 63 of 66
android:interpolator="@android:anim/linear_interpolator"
android:duration = "1000"
android:fromXScal = "1"
android:fromYScale = "1"
android:pivotX = "50%"
android:pivotY = "50%"
android:toXScale = "2"
android:toYScale = "2"/>
</set>

import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.ImageView;

public class MainActivity extends AppCompatActivity {

ImageView imageView;
Button blinkBTN, rotateBTN, fadeBTN, moveBTN, slideBTN, zoomBTN, stopBTN;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
imageView = findViewById(R.id.imageview);
blinkBTN = findViewById(R.id.BTNblink);
rotateBTN = findViewById(R.id.BTNrotate);
fadeBTN = findViewById(R.id.BTNfade);
moveBTN = findViewById(R.id.BTNmove);
slideBTN = findViewById(R.id.BTNslide);
zoomBTN = findViewById(R.id.BTNzoom);
stopBTN = findViewById(R.id.BTNstop);

blinkBTN.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// To add blink animation
Animation animation =
AnimationUtils.loadAnimation(getApplicationContext(), R.anim.blink_animation);
imageView.startAnimation(animation);
}
});

rotateBTN.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// To add rotate animation
Animation animation =
Student Enrollment No :200200107038 Page 64 of 66
AnimationUtils.loadAnimation(getApplicationContext(), R.anim.rotate_animation);
imageView.startAnimation(animation);
}
});
fadeBTN.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// To add fade animation
Animation animation =
AnimationUtils.loadAnimation(getApplicationContext(), R.anim.fade_animation);
imageView.startAnimation(animation);
}
});
moveBTN.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// To add move animation
Animation animation =
AnimationUtils.loadAnimation(getApplicationContext(), R.anim.move_animation);
imageView.startAnimation(animation);
}
});
slideBTN.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// To add slide animation
Animation animation =
AnimationUtils.loadAnimation(getApplicationContext(), R.anim.slide_animation);
imageView.startAnimation(animation);
}
});
zoomBTN.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// To add zoom animation
Animation animation =
AnimationUtils.loadAnimation(getApplicationContext(), R.anim.zoom_animation);
imageView.startAnimation(animation);
}
});
stopBTN.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// To stop the animation going on imageview
imageView.clearAnimation();
}
});
}
}

Student Enrollment No :200200107038 Page 65 of 66


Output

References used by the students:

Rubric wise marks obtained:

RUBRICS 1 2 3 4 5 TOTAL

MARKS

Student Enrollment No :200200107038 Page 66 of 66

You might also like