Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

School of Engineering and Technology: Project Work

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 19

SCHOOL OF ENGINEERING AND TECHNOLOGY

Project Work
On
“ STOPWATCH ”
For the requirement of
6th Semester (4BCS603 – Mobile Application Development)
B.Tech. in COMPUTER SCIENCE AND ENGINEERING

Submitted By:

Name
VINOD KUMAR M (18BBTCS147)
VISHNU S (18BBTCS148)
DANIEL S (18BBTCS155)

Submitted to:

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


CMR University
Off Hennur - Bagalur Main Road,
Near Kempegowda International Airport, Chagalahatti,
Bengaluru, Karnataka-562149
Academic Year - 2020-21
SCHOOL OF ENGINEERING AND TECHNOLOGY
Chagalahatti, Bengaluru, Karnataka-562149

Department of Computer Science and Engineering

CERTIFICATE

Certified that the Project Work entitled “STOPWATCH” carried out by VISHNU
S(18BBTC148),VINOD KUMAR M(18BBTCS147),DANIEL S(18BBTCS155)
bonafide students of SCHOOL OF ENGINEERING AND TECHNOLGY, in
partial fulfillment for the award of BACHELOR OF TECHNOLOGY in 6th
Semester Computer Science and Engineering of CMR UNIVERSITY, Bengaluru
during the year 2021. It is certified that all corrections/suggestions indicated for the
Internal Assessment have been incorporated in the report. The project has been
approved as it satisfies the academic requirements in respect of project work
prescribed for the said degree.

Signature of Course In-charge Signature of HOD Signature of Dean

…………………… …………………… ……………………


Dept. of CSE Dept. of CSE SoET, CMRU, Bangalore
SoET, CMRU, Bangalore SoET, CMRU, Bangalore

Name of the Examiners: Signature with Date:

1. …………………… ……………………

2. …………………… ……………………
DECLARATION

I, VISHNU S, bearing USN 18BBTCS148, student of Bachelor of Technology,


Computer Science and Engineering, CMR University, Bengaluru, hereby declare that the Project
Work entitled “STOPWATCH” submitted by me, for the award of the Bachelor’s degree in
Computer Science and Engineering to CMR University is a record of bonafide work carried out
independently by me under the supervision and guidance of Dr. T. Parameswaran, Associate
Professor, Dept of CSE, CMR University.

I further declare that the work reported in this mini project work has not been submitted
and will not be submitted, either in part or in full, for the award of any other degree in this
university or any other institute or University.

Place: Bengaluru (VISHNU S)


Date: 25/05/2021 (18BBTCS148)

iii
ACKNOWLEDGEMENT

The satisfaction that accompanies the successful completion of this project would be
incomplete without the mention of the people who made it possible, without whose constant
guidance and encouragement would have made efforts go in vain.
I express my sincere gratitude to my project guide Dr. T. Parameswaran, Associate
Professor, Dept of CSE, without whose constant guidance and support the project would not be
successful.
I also express my sincere thanks to my project co guide Dr. R. Sathyaraj, Assistant
Professor, Dept of CSE, whose constant guidance and support for the successful completion of
the project.
I would like to express my thanks to Dr. Rubini P, Associate Professor and Head,
Department of Computer Science and Engineering, School of Engineering and Technology,
CMR University, Bangalore, for his encouragement that motivated me for the successful
completion of Project work.
I express my heartfelt sincere gratitude to Dr. C. Prabhakar Reddy, Dean, School
of Engineering and Technology, CMR University for his support.

(VISHNU S)

iv
TABLE OF CONTENTS

CHAPTE CONTENTS PAGE


R NO. NO.

LIST OF FIGURES vi
ABSTRACT vii

1 INTRODUCTION 08
1.1. Overview 09
09
1.2. Objective

1.3. Organisation of the project


2 SOFTWARE AND HARDWARE REQUIREMENTS 10
2.1. Software Requirements
2.2. Hardware requirements

3 SYSTEM DEVELOPMENT PROCESS 11


3.1. Flow Chart 11
3.2. Design 13
3.3. Implementation 13

4 RESULTS AND DISCUSSION 15


4.1. Stop watch app
5 SYSTEM DESIGN 1

6 IMPLEMENTATION 18
6.1. CODE SNIPPETS 19

v
LIST OF FIGURES

Name of the Figure Page No

1.1 STOPWACH APPLICATION 01

2.2 BLOCK DIAGRAM OF STOPWATCH 04

3.2 FLOWCHART 06

3.3 DESIGN OF STOPWATCH 06

4.1 SCREENSHOT OF RESULTS 14

vi
ABSTRACT

A stopwatch is a simple app that is used to record or measure time. It has mainly 4 main
functions as shown below: Start: To start the stopwatch time from the beginning or from the
pause state. Stop: To stop the stopwatch time and reset the time to zero. This stopwatch project is
a software and hardware co-design. A stopwatch is a simple app that is used to record or measure
time. It has mainly 3 main functions Start: To start the stopwatch time from the beginning or
from the pause state Stop: To stop the stopwatch time and reset the time to zero. And reset
according to our project we are able to use the best method that can be used to write the program
the main reason is we can know the time can be executed.

vii
CHAPTER 1 JNDraw 2021

INTRODUCTION

Stopwatch is one of the most important and useful thing for all the athletics and all the persons
who is preparing them selves for online examination. In the current world when android is on its
top most of persons use android applications to do their personal tasks. It is is another simple
android project idea that will work the same as a normal handheld timepiece that measures the
time elapsed between its activation and deactivation. This application will have three buttons that
are: start, stop, and hold. This application would need to use Java and XML. For this application,
we need to set the timer properly as it is initially set to milliseconds, and that should be
converted to minutes and then hours properly. The users can use this application and all they’d
need to do is, start the stopwatch and then stop it when they are done. They can also pause the
timer and continue it again when they like. It is a simple app that is used to record or measure
time. It has mainly 4 main functions as shown below: Start: To start the stopwatch time from the
beginning or from the pause state. Stop:To stop the stopwatch time and reset the time to zero.
The stopwatch we designed is a time-keeping device that is meant to measure the time elapsed
from the start to end of any event.

B Tech, Dept of CSE, SoET, CMR University


8
JNDraw 2021

1.1Overview
A stopwatch is a handheld timepiece designed to measure the amount of time that elapses
between its activation and deactivation. A large digital version of a stopwatch designed for
viewing at a distance, The timing functions are traditionally controlled by two buttons on the
case. Pressing the top button starts the timer running, and pressing the button a second time stops
it, leaving the elapsed time displayed. A press of the second button then resets the stopwatch to
zero. In the process of surveying existing sports stopwatch apps, we have downloaded, tried and
analyzed a lot of existing stopwatch apps from different global app stores. This is a stopwatch
app overview with a certain minimum quality or app store ranking.

1.2 Objective
The main objective of this project is it gives people to learn and develop knowledge in designing
the application. To appreciate the hardware and software interfacing of a system.To design, write
and test an programming which meets a technical specification in a given target system.To
demonstrate the project how it works and build a fully functional stopwatch.To train and create a
new project from the hardware and simplicity studio software.

1.3 Organization of the report


Chapter 1: It contains the introduction about project, overview of the project, aim and objectives
of the project.
Chapter 2: Discussed about the different types of hardware and software which are used to carry
out the project.
Chapter 3: Discussed about design, implementation and flow chart of the project
Chapter 4: Discussed about experiment results obtained from the experiment

B Tech, Dept of CSE, SoET, CMR University


9
CHAPTER 2 JNDraw 2021

HARDWARE AND SOFTWARE REQUIREMENTS

2.1. HARDWARE:
 Android v9.0 (pie)
 6 Gb Ram
 Display screen with working touch
 1 Gb Storage

2.2. SOFTWARE:
2.2.1. Android Studio:
It is an Integrated Development Environment (IDE) that Android use to develop
applications. It incorporates with the IntelliJ IDEA, a Java Integrated Development Environment
when you edit codes and develop tools.  Android Studio provides more features that enhance our
productivity while building Android apps.

Each project in Android Studio contains one or more modules with source code files and
resource files. Types of modules include:

 Android app modules


 Library modules
 Google App Engine modules
By default, Android Studio displays your project files in the Android project view. This view is
organized by modules to provide quick access to your project's key source files. All the build
files are visible at the top level under Gradle Scripts and each app module contains the following
folders:

 Manifests: Contains the AndroidManifest.xml file.


 Java: Contains the Java source code files, including JUnit test code.
 Res: Contains all non-code resources, such as XML layouts, UI strings, and bitmap
images.

B Tech, Dept of CSE, SoET, CMR University


10
JNDraw 2021

CHAPTER 3

SYSTEM DEVELOPMENT PROCESS


A stopwatch is widely used in the sports sector for time-keeping, having a stopwatch in the
cellular phone becomes very handy for coaches, trainers, runners, and other sports professionals.
Apart from sports, a stopwatch is used in the education sector, for time-keeping during quizzes,
debate competitions. The design and the Java Code of a stopwatch are very elementary. There
are three buttons in the userinterface. First, the “start” button is used for starting the timer from
an initial zero second. Second, the “stop” button, which can also be named the “pause” button,
stops the increment but doesn’t take the reading back to zero. If you click on the “start” button
again, the timer will increment from the value at which it was stopped earlier. The last button is
the “reset” button, it sets the value of the timer back to zero seconds

FLOW CHART

DESIGN
The UI design can be created easily with the help of the following UI components: A Linear
Layout with a vertical orientation that acts as the parent. A Text View for displaying the timer. A
Linear Layout with horizontal orientation to hold the three buttons

B Tech, Dept of CSE, SoET, CMR University


11
JNDraw 2021

IMPLEMENTATION
Create a new project and name it. We have named our project as stopwatch. After doing so we
will see two files opened in front of us, So in the file activity_main.xml.After writing the code
for activity_main.xml we’ll write the code in MainActivity.java file. After writing both the code
we’re ready to run the android project.

CODE SNIPPETS

Activity_main.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="300dp"
android:layout_height="300dp"

B Tech, Dept of CSE, SoET, CMR University


12
JNDraw 2021

android:orientation="vertical"
android:gravity="center"
android:layout_gravity="center"
android:background="@drawable/bg_round"
tools:context=".MainActivity">

<Chronometer
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/chronometer"
android:format="00:00:00"
android:textSize="40sp"
android:textStyle="bold"
android:textColor="@android:color/white"/>

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp">

<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/bt_start"
android:background="@android:color/transparent"
android:src="@drawable/ic_play"/>

<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/bt_stop"
android:background="@android:color/transparent"
android:src="@drawable/ic_stop"/>

</LinearLayout>

</LinearLayout>

Ic_play.xml
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="40dp"
android:height="40dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="#FFF"
android:pathData="M8,5v14l11,-7z"/>
</vector>

Ic_pause.xml

B Tech, Dept of CSE, SoET, CMR University


13
JNDraw 2021

<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="40dp"
android:height="40dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="#FFF"
android:pathData="M6,19h4L10,5L6,5v14zM14,5v14h4L18,5h-4z"/>
</vector>

Ic_stop.xml
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="40dp"
android:height="40dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="#FFF"
android:pathData="M6,6h12v12H6z"/>
</vector>

Bg_round.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">

<solid android:color="@android:color/holo_blue_light"/>
<corners android:radius="300dp"/>

</shape>

MainActivity.java
package com.androidcoding.stopwatchdemo;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.os.Handler;
import android.os.SystemClock;
import android.view.View;
import android.widget.Chronometer;
import android.widget.ImageButton;

public class MainActivity extends AppCompatActivity {


Chronometer chronometer;
ImageButton btStart,btStop;

private boolean isResume;


Handler handler;
long tMilliSec,tStart,tBuff,tUpdate = 0L;
int sec,min,milliSec;

B Tech, Dept of CSE, SoET, CMR University


14
JNDraw 2021

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

chronometer = findViewById(R.id.chronometer);
btStart = findViewById(R.id.bt_start);
btStop = findViewById(R.id.bt_stop);

handler = new Handler();

btStart.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (!isResume) {
tStart = SystemClock.uptimeMillis();
handler.postDelayed(runnable,0);
chronometer.start();
isResume = true;
btStop.setVisibility(View.GONE);

btStart.setImageDrawable(getResources().getDrawable(R.drawable.ic_pause)
);
} else {
tBuff += tMilliSec;
handler.removeCallbacks(runnable);
chronometer.stop();
isResume = false;
btStop.setVisibility(View.VISIBLE);

btStart.setImageDrawable(getResources().getDrawable(R.drawable.ic_play)
);
}
}
});

btStop.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v){
if (!isResume){

btStart.setImageDrawable(getResources().getDrawable(R.drawable.ic_play)
);
tMilliSec = 0L;
tStart = 0L;
tBuff = 0L;
tUpdate = 0L;
sec = 0;
min = 0;
milliSec = 0;
chronometer.setText("00:00:00");
}
}

B Tech, Dept of CSE, SoET, CMR University


15
JNDraw 2021

});
}

public Runnable runnable = new Runnable() {


@Override
public void run() {
tMilliSec = SystemClock.uptimeMillis() - tStart;
tUpdate = tBuff + tMilliSec;
sec = (int) (tUpdate/1000);
min = sec/60;
sec = sec%60;
milliSec = (int) (tUpdate%100);
chronometer.setText(String.format("%02d",min)
+":"+String.format("%02d",sec)+":"+String.format("%02d",milliSec));
handler.postDelayed(this, 60);
}
};
}

CHAPTER 7

RESULTS AND OUTPUT

B Tech, Dept of CSE, SoET, CMR University


16
JNDraw 2021

CHAPTER 8

CONCLUSION

The stopwatch feature allows you to measure elapsed times. By using the corresponding buttons,
the stopwatch can be started, stop and reset. After we done with our project about stopwatch we
are able to learn and develop knowledge. We are also able learn how to developed skills and
knowledge in systematic design approach. According to our project we are able to use the best
method that can be used to write the program the main reason is we can know the time can be
executed.

B Tech, Dept of CSE, SoET, CMR University


17
JNDraw 2021

REFERCENCES
1)www.geeksforgeeks.org/how-to-create-a-stopwatch-app-usingandroid-studio/
2)www.projectgurukul.org/android-project-stopwatch/
3)www.c-sharpcorner.com/article/creating-stop-watch-androidapplication-tutorial/
4)/www.android-examples.com/android-create-stopwatch-exampletutorial-in-android-studio/

B Tech, Dept of CSE, SoET, CMR University


18
JNDraw 2021

B Tech, Dept of CSE, SoET, CMR University


19

You might also like