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

MAJOR PROJECT REPORT

ON

Topic

Quiz Android Application

Course Name / Code – MAJOR PROJECT / 20ODMCR753

SUBMITTED IN PARTIAL FULFILMENT

FOR THE REQUIREMENTS OF THE DEGREE OF

MASTER OF COMPUTER APPLICATIONS (MCA)

INSTITUTE OF DISTANCE & ONLINE LEARNING

CHANDIGARH UNIVERSITY, MOHALI

PUNJAB

SUBMITTED TO: SUBMITTED BY:

Programme Coordinator – MCA Student Name: Neha Rai


Institute of Distance & Online Learning UID: D20MCA11023
Chandigarh University MCA-Batch - Jul 2020
Mohali, Punjab
AKNOWLEDGEMENT

It is a matter of pleasure for me to thank all the persons who have contributed directly
or indirectly towards the successful completion of my major project report titled
“Quiz Android Application”.

At the very outset, I would like to offer a token of heartfelt gratitude to the
management and teachers at Institute of Distance and Online Learning at Chandigarh
University for granting me a learning opportunity on how to work towards a report.

This acknowledgement would not be complete without expressing gratitude to my


family and friends who have stood by me through all the trying hours, dilemma and
panic.

With much appreciation and gratitude.

Name of student: Neha Rai

UID No: D20MCA11023


STUDENT DECLARATION

I hereby declare that my Major Project Report titled “Quiz Android Application” is
a bonafide record of the project work which I have submitted to Institute of Distance
Education and Online Learning, Chandigarh University in partial fulfillment of the
credit requirements for the degree of Master of Computer Applications is my
authentic work. This minor project report has not been copied, duplicated or
plagiarised from any other paper, journal, document or book and has not been
submitted to any educational institute or otherwise for the award of any certificate,
diploma, degree or recognition.

This is an authentic piece of work and in case there is any query regarding the same,
I shall be held responsible for answering any queries in this regard.

Name of student: Neha Rai

UID No. D20MCA11023

Place: Jaipur

Date: 30th June, 2022


NEHA RAI MCA 4TH SEM D20MCA11023

Introduction:

Relevance:
Quiz Contest is an android application that has general questions related to current
affairs and computer. It has multiple choice questions with time limit and it also
calculate scores of each correct answer. It is good for students of every age group it
helps in increasing general knowledge about world, Sports and computer etc. The
application helps the user to increase his/her knowledge. Since Smartphone mobiles
are being widely used by general population and students, the Quiz Contest
application can provide on the Student's mobile.

Problem Definition:
Quiz Contest is a application developed to conduct an quiz based on time
constraints. Quiz Contest system is accessed by entering the user name and
password which is added to the database. Before start of the quiz, the rules and
regulations are displayed that includes description of the time limit, number of
questions to be answered and scoring methods. Quiz is started by displaying one
question with four options each based on computer and general knowledge. if the
answer is correct, score is incremented by four and no negative marks for wrong
answers . If the time exceeds 20secs next question will come automatically after
giving few limited question's answer quiz application will inally direct you to the
score page. Final score will be displayed and updated in the database with
username.

Objective:

The main objective of “Quiz Contest” is to facilitate a user friendly environment for all
users and reduces the manual effort. In past days quiz is conducted manually but in further
resolution of the technology we are able to generate the score and pose the queries
automatically. The functional requirements include to create users that are going to
participate in the quiz, automatic score and report generation and administrative tasks like
add, delete, update for admin privilege users. In this application, all the permissions lies

1|Page
NEHA RAI MCA 4TH SEM D20MCA11023

with the administrator i.e., specifying the details of the quiz with checking result will show
to interviewee or not, addition of question and answers, marks for each question, Set timer
for each quiz and generate report with score for each quiz.

Basic Concepts &Tools:

Introduction to Java

Java is a programming language created by James Gosling from Sun


Microsystems (Sun) in 1991. The First publicly available version
of Java (Java 1.0) was released in 1995. Sun Microsystems was
acquired by the Oracle Corporation in 2010. Over time new
enhanced versions of Java have been released. The current version of
Java is Java 1.7 which is also known as Java 7. From the Java
programming language the Java platform evolved. The Java
platform allows software developers to write program code in other
languages than the Java programming language and still runs on the
Java virtual machine. The Java platform is usually associated with
the Java virtual machine and the Java core libraries.

Java Virtual machine

The Java virtual machine (JVM) is a software implementation of


a computer that executes programs like a real machine. The Java
virtual machine is written speciically for a speciic
operating system, e.g. for Linux a special implementation is
required as well as for Windows.

Java Runtime Environment vs. Java Development Kit

A Java distribution comes typically in two favours, the Java


Runtime Environment (JRE) and the Java Development Kit
(JDK).The Java runtime environment (JRE) consists of the JVM
and the Java class libraries and contains the necessary
2|Page
NEHA RAI MCA 4TH SEM D20MCA11023

functionality to start Java programs. The JDK contains in


addition the development tools necessary to create Java
programs. The JDK consists therefore of a Java compiler, the
Java virtual machine, and the Java class libraries.

Characteristics of Java

The target of Java is to write a program once and then run this
program on multiple operating systems. Java has the following
properties:

Platform independent: Java programs use the Java


virtual machine as abstraction and do not access the
operating system directly. This makes Java programs
highly portable. A Java program (which is standard
complaint and follows certain rules) can run
unmodiied on all supported platforms, e.g.
Windows or Linux.

Object-orientated programming language: Except


the primitive data types, all elements in Java are
objects.

Interpreted and compiled language: Java source


code is transferred into the byte code format which
does not depend on the target platform. These byte
code instructions will be interpreted by the Java
Virtual machine (JVM). The JVM contains a so called
Hotspot-Compiler which translates performance
critical byte code instructions into native code
instructions.

Automatic memory management: Java manages

3|Page
NEHA RAI MCA 4TH SEM D20MCA11023

the memory allocation and de-allocation for creating


new objects. The program does not have direct
access to the memory. The so-called garbage
collector deletes automatically objects to which no
active pointer exists.

Android

Android is a software platform and operating system for mobile


devices. Android is available as open source. It allows
developers to write managed code in the Java language,
controlling the device via Google-developed Java libraries.

Android SDK was released by Open Handset Alliance in the


month of November of the year 2007. Android was actually
developed using the kernel of Linux 2.6 and the highlighting
features of Android include the following:

• No fees for licensing,


distribution and release approval
• GSM, 3G EDGE networks for telephony

• IPC message passing


• Background processes and applications

• Complete multimedia hardware control

• API’s for location based services such as GPS.

Architecture of Android OS

The skeleton of Android framework and its constituents are


shown in the following figure:

4|Page
NEHA RAI MCA 4TH SEM D20MCA11023

Architecture of Android OS

Applications Layer

Android ships with a set of core applications including an email


client, SMS program, calendar, maps, browser, contacts and
others. All applications are built using the Java. Each of the
applications aims at performing a speciic task that it is actually
intended to do.

Application Framework Layer

The next layer is the application framework. This includes the


programs that manage the phone’s basic functions like resource
allocation, telephone applications, switching between processes
or programs and keeping track of the phone's physical location.
Application developers have full access to Android's application
framework. This allows them to take advantage of Android's
processing capabilities and support features when building an

5|Page
NEHA RAI MCA 4TH SEM D20MCA11023

Android application. We can think of the application framework


as a set of basic tools with which a developer can build much
more complex tools.

Libraries Layer

The next layer contains the native libraries of Android. These


shared libraries are all written in C or C++, compiled for the
particular hardware architecture used by the phone and
preinstalled by the phone vendor.

Android Runtime Layer

Android Runtime layer includes Dalvik Virtual Machine (DVM)


and a set of core java libraries. Every Android app gets its own
instance of DVM. Dalvik has been written so that a device can
run multiple virtual machines efficiently and it executes files
with .dex (Dalvik Executable Format) extension optimized for
minimum memory.

Components of Android

The basic components of an Android application include


Activity, Broadcast Receiver, Service, and Content Provider.
Each of the above, which when used for any application, has to
be declared in the AndroidManifest.xml. The user interface of
the component is determined by the Views. For the
communication among these basic components we use Intents
and Intent ilters which play crucial role during app
development.

6|Page
NEHA RAI MCA 4TH SEM D20MCA11023

A
cn
d r
o i
v
d
A
p
yp l
i c
a t
i o
n

Android Components

7|Page
NEHA RAI MCA 4TH SEM D20MCA11023

Activity

An Activity is, fundamentally, an object that has a


lifecycle. An Activity is a chunk of code that does
some work, as necessary. The work can include
displaying a UI to the user, though it doesn't have to
as some Activities never display UIs. Typically, we
designate one of our application's Activities as the
entry point to our application.

Broadcast Receiver

Broadcast Receiver is yet another type of


component that can receive and respond to
any of the broadcast announcements.

Service

A Service is a body of code that runs in the


background. It can run in its own process, or
in the context of another application's
process, depending on its needs. Other
components "bind" to a Service and invoke
methods on it via remote procedure calls. An
example of a Service is a media player; even
when the user quits the media- selection UI,
she probably still intends for her music to
keep playing. A Service keeps the music
going even when the UI has completed.

Content Provider

Content Provider is a data storehouse that


8|Page
NEHA RAI MCA 4TH SEM D20MCA11023

provides access to data on the device; the


classic example is the Content Provider that
is used to access the user's list of contacts.
Our application can access data that other
applications have exposed via a Content
Provider, and we can also define our own
Content Providers to expose data of our
own.

System Analysis:

Feasibility Study:
The feasibility study is an evaluation and analysis of the
potential of a proposed project which is based on extensive
investigation and research to support the process of decision
making. Depending on the results of the initial investigation
the survey is now expanded to a more detailed feasibility
study.

Feasibility Study
System: Quiz Contest Date: 15-06-2022
Author: XXX Page: 1
Product
The project is a Quiz android application . It will help its users toimprove their
general knowledge.
Technical Feasibility
The android application will be developed using Android Studio. The team is
competent in that.

9|Page
NEHA RAI MCA 4TH SEM D20MCA11023

Social Feasibility
Some training for the users/admin are required but all users are IT literate.
Market Research
Market research says that this application would be useful for the users as it
could seamlessly help them for their lifestyle.
Economic Feasibility

The application can be developed within budget.


Alternate Solution
Could be a desktop system but that would not be as portable.

Existing System:

➢ Then Welcome(user profile) will be appear user


has to choose any of two option 'Start Game', 'High
Score'.

➢ After choosing start game continue page will be appear to


continue game.

➢ After Clicking on continue multiple choice questions


will come automatically one by one with a specific
time limit.

➢ User has to choose any of four existing options and then


user has to hit the submit button and each right answer
will automatically count the score.

➢ At the end of the game it will show the score of the user.

All these endings demands new application which

10 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

will reduce the manual work & do everything


automatically. Also the existing systems have some
major drawbacks which motivate us to develop new
system.
Those drawbacks are as follows:

▪ Quest won't get update automatically need to


update manually.
▪ Existing systems has not type of fields in like
questions on History,Game,Sports,Geography
etc.
▪ There is possibility of hanging down the
existing systems.

Proposed System:

Unlike the websites where you need to make account for every quiz you
want to play, using this application based on android, then you will get
access to all quizzes from it. The proposed system is an application for
the Android platform mobiles will help in improving the knowledge
and accuracy. Android is a Linux-based operating system designed
primarily for touch screen mobile devices such as smart phones and
tablet computers, developed by Google in conjunction with the Open
Handset Alliance.

The proposed system will be developed for Android mobiles only


because the market share of Android is more than other operating
systems.

11 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

Table of Comparison :

Comparison of Existing System & Proposed System

Parameters Existing Proposed


System System
Method Manual Automatic
Time More time Less time
consuming consuming
Database Required Not required
Reliability Less More

Software Requirements:

Operating System: Android

Toolkit: Software Development


Toolkit(SDK)

Platform: Java and Android

Database: SQLite

Hardware Requirements:

❖ 2.3 minimum version (API 8)


❖ Android phone (Having Version Above
or 2.3)

12 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

Diagram:

Data Flow Diagram (DFD):

A data low diagram (DFD) is a graphical


representation of the "low" of data through an
information system, modeling its process aspects.
A DFD is often used as a preliminary step to create
an overview of the system. DFDs can also be used
for the visualization of data processing.

A DFD shows what kind of information will be input to and


output from the system, where the data will come from and go
to, and where the data will be stored. It does not show
information about the timing of process or information about
whether processes will operate in sequence or in parallel.

Level 0 DFD:

13 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

Use Case Diagram:

Entity-Relationship Diagram:

14 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

Table Diagram:

Design of database table which is named as Events is given below


---

Attribute Name Attribute type


Id Int
Name Text
Info Text
Period Text
Period_unit Text
Start_time Text

Form Design:

Components---

▪ Linear Layout (Vertical)


▪ Linear Layout (Horizontal)
▪ TextView(Medium)
▪ EditText
▪ Button
▪ CheckBox
▪ ListView
▪ Spinner
▪ ImageView
▪ AlertDialog

15 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

Testing:

❖ Objective:

The objective our test plan is to find and report


as many bugs as possible to improve the integrity of
our program. Although exhaustive testing is not
possible, we will exercise a broad range of tests to
achieve our goal. We will also test the user
friendliness of our app .The application will be used
as an important tool, but we would like to ensure that
it could be run on a variety of platforms with little
impact on performance or usability.

Process Overview :

The following represents the overall low of the


testing process:

 Identify the requirements to be tested. Aeltasr cases


shall be derived using the current Program
Speciication.
 Identify which particular test(s) will be usedto test
each module.
 Review the test data and test cases otensure that
the unit has been thoroughly veriied and that
the test data and test cases are adequate to
verify proper operation of the unit.
 Identify the expected results for each test.

16 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

 Document the test case configuration, etsdata, and


expected results.
 Perform the test(s).
 Document the test data, test cases, nda test
configuration used during the testing process.
This information shall be submitted via the
Unit/System Test Report (STR).
 Successful unit testing is required beforethe unit is
eligible for component integration/system testing.
 Unsuccessful testing requires a Bug ReporF
t orm to be
generated. This document shall describe the test
case, the problem encountered, it's possible cause,
and the sequence of events that led to the problem.
It shall be used as a basis for later technical
analysis.
 Test documents and reports shall besubmitted.
Any speciications to be reviewed, revised,
or updated shall be handled immediately.

Testing Process:
Design
System Test

Organize Design/Build
Project Design/Build Test Proc.

Organize
Project

17 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

The diagram above outlines


the Test Process approach that
will be followed.

➢ Organize Project involves creating a


System Test Plan, Schedule & Test
Approach, and
assigning
responsibilities.
➢ Design/Build System Test involves
identifying Test Cycles, Test Cases,
Entrance & Exit Criteria, Expected Results,
etc. In general, test conditions/expected
results will be identified by the Test Team
in conjunction with the Development
Team. The Test Team will then identify
Test Cases and the Data required. The Test
conditions are derived from the Program
Specifications Document.
➢ Design/Build Test Procedures includes
setting up procedures such as Error
Management systems and Status reporting.

➢ Build Test Environment includes


requesting/building
har
dware, software and data setups.

18 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

➢ Execute System Tests identiied in


the Design/Build Test Procedures will be
executed. All results will be documented
and Bug Report Forms illed out and
given to the Development Team as
necessary.

➢ Signoff happens when all pre-defined exit


criteria have been achieved.
Testing Strategy:

The following outlines the types of testing that will


be done for unit, integration, and system testing.
While it includes what will be tested, the
specific use cases that determine how the
testing is done will be detailed in the Test Design
Document. The test cases that will be used for
designing use cases is shown below.

19 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

Results:

20 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

Source Code:

BackgroundColor.java

package com.example.rajan.quizbee;

import android.graphics.Color;

import java.util.Random;

public class BackgroundColor {

private String[] mColors = {

"#39add1", // light blue

"#3079ab", // dark blue

"#c25975", // mauve

"#e15258", // red

"#f9845b", // orange

"#838cc7", // lavender

"#7d669e", // purple

"#53bbb4", // aqua

"#51b46d", // green

"#e0ab18", // mustard

"#637a91", // dark gray

"#f092b0", // pink

"#b7c0c7" // light gray}

};

21 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

public int getColor(){

//Randomly generate a color

String color;

Random randomGenerator = new Random();

int randomNumber = randomGenerator.nextInt(mColors.length);

color = mColors[randomNumber];

int colorAsInt;

colorAsInt = Color.parseColor(color);

return colorAsInt;

DeveloperActivity.java

package com.example.rajan.quizbee;

import android.content.Intent;

import android.support.v7.app.AppCompatActivity;

import android.os.Bundle;

import android.view.View;

import android.widget.Button;

public class DeveloperActivity extends AppCompatActivity {

22 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

Button btnRestart;

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_developer);

btnRestart = (Button) findViewById(R.id.button4);

btnRestart.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

Intent in2 = new


Intent(getApplicationContext(),MainActivity.class);

startActivity(in2);

});

23 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

MainActivity.java

package com.example.rajan.quizbee;

import android.content.Intent;

import android.support.v7.app.AppCompatActivity;

import android.os.Bundle;

import android.text.TextUtils;

import android.view.View;

import android.widget.Button;

import android.widget.EditText;

import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

Button startbutton=(Button)findViewById(R.id.button);

Button aboutbutton=(Button)findViewById(R.id.button2);

final EditText nametext=(EditText)findViewById(R.id.editName);

24 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

startbutton.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

String name=nametext.getText().toString();

Intent intent=new
Intent(getApplicationContext(),QuestionsActivity.class);

intent.putExtra("myname",name);

startActivity(intent);

});

aboutbutton.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

Intent intent=new
Intent(getApplicationContext(),DeveloperActivity.class);

startActivity(intent);

});

25 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

QuestionsActivity.java

package com.example.rajan.quizbee;

import android.content.Intent;

import android.support.v7.app.AppCompatActivity;

import android.os.Bundle;

import android.text.TextUtils;

import android.view.View;

import android.widget.Button;

import android.widget.EditText;

import android.widget.RadioButton;

import android.widget.RadioGroup;

import android.widget.RelativeLayout;

import android.widget.TextView;

import android.widget.Toast;

public class QuestionsActivity extends AppCompatActivity {

TextView tv;

Button submitbutton, quitbutton;

RadioGroup radio_g;

RadioButton rb1,rb2,rb3,rb4;

26 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

String questions[] = {

"Which method can be defined only once in a program?",

"Which of these is not a bitwise operator?",

"Which keyword is used by method to refer to the object


that invoked it?",

"Which of these keywords is used to define interfaces in


Java?",

"Which of these access specifiers can be used for an


interface?",

"Which of the following is correct way of importing an


entire package ‘pkg’?",

"What is the return type of Constructors?",

"Which of the following package stores all the standard


java classes?",

"Which of these method of class String is used to compare


two String objects for their equality?",

"An expression involving byte, int, & literal numbers is


promoted to which of these?"

};

String answers[] = {"main


method","<=","this","interface","public","import pkg.*","None of the
mentioned","java","equals()","int"};

String opt[] = {

27 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

"finalize method","main method","static method","private


method",

"&","&=","|=","<=",

"import","this","catch","abstract",

"Interface","interface","intf","Intf",

"public","protected","private","All of the mentioned",

"Import pkg.","import pkg.*","Import pkg.*","import pkg.",

"int","float","void","None of the mentioned",

"lang","java","util","java.packages",

"equals()","Equals()","isequal()","Isequal()",

"int","long","byte","float"

};

int flag=0;

public static int marks=0,correct=0,wrong=0;

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_questions);

final TextView score = (TextView)findViewById(R.id.textView4);

TextView textView=(TextView)findViewById(R.id.DispName);

Intent intent = getIntent();

28 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

String name= intent.getStringExtra("myname");

if (name.trim().equals(""))

textView.setText("Hello User");

else

textView.setText("Hello " + name);

submitbutton=(Button)findViewById(R.id.button3);

quitbutton=(Button)findViewById(R.id.buttonquit);

tv=(TextView) findViewById(R.id.tvque);

radio_g=(RadioGroup)findViewById(R.id.answersgrp);

rb1=(RadioButton)findViewById(R.id.radioButton);

rb2=(RadioButton)findViewById(R.id.radioButton2);

rb3=(RadioButton)findViewById(R.id.radioButton3);

rb4=(RadioButton)findViewById(R.id.radioButton4);

tv.setText(questions[flag]);

rb1.setText(opt[0]);

rb2.setText(opt[1]);

rb3.setText(opt[2]);

rb4.setText(opt[3]);

submitbutton.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

29 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

//int color = mBackgroundColor.getColor();

//mLayout.setBackgroundColor(color);

if(radio_g.getCheckedRadioButtonId()==-1)

Toast.makeText(getApplicationContext(), "Please select one


choice", Toast.LENGTH_SHORT).show();

return;

RadioButton uans = (RadioButton)


findViewById(radio_g.getCheckedRadioButtonId());

String ansText = uans.getText().toString();

// Toast.makeText(getApplicationContext(), ansText,
Toast.LENGTH_SHORT).show();

if(ansText.equals(answers[flag])) {

correct++;

Toast.makeText(getApplicationContext(), "Correct",
Toast.LENGTH_SHORT).show();

else {

wrong++;

Toast.makeText(getApplicationContext(), "Wrong",
Toast.LENGTH_SHORT).show();

30 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

flag++;

if (score != null)

score.setText(""+correct);

if(flag<questions.length)

tv.setText(questions[flag]);

rb1.setText(opt[flag*4]);

rb2.setText(opt[flag*4 +1]);

rb3.setText(opt[flag*4 +2]);

rb4.setText(opt[flag*4 +3]);

else

marks=correct;

Intent in = new
Intent(getApplicationContext(),ResultActivity.class);

startActivity(in);

radio_g.clearCheck();

31 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

});

quitbutton.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

Intent intent=new
Intent(getApplicationContext(),ResultActivity.class);

startActivity(intent);

});

ResultActivity.java

package com.example.rajan.quizbee;

import android.content.Intent;

import android.support.v7.app.AppCompatActivity;

import android.os.Bundle;

import android.view.View;

import android.widget.Button;

import android.widget.QuickContactBadge;

import android.widget.TextView;

32 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

import org.w3c.dom.Text;

public class ResultActivity extends AppCompatActivity {

TextView tv, tv2, tv3;

Button btnRestart;

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_result);

tv = (TextView)findViewById(R.id.tvres);

tv2 = (TextView)findViewById(R.id.tvres2);

tv3 = (TextView)findViewById(R.id.tvres3);

btnRestart = (Button) findViewById(R.id.btnRestart);

StringBuffer sb = new StringBuffer();

sb.append("Correct answers: " + QuestionsActivity.correct + "\n");

StringBuffer sb2 = new StringBuffer();

sb2.append("Wrong Answers: " + QuestionsActivity.wrong + "\n");

StringBuffer sb3 = new StringBuffer();

sb3.append("Final Score: " + QuestionsActivity.correct + "\n");

tv.setText(sb);

tv2.setText(sb2);

tv3.setText(sb3);

33 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

QuestionsActivity.correct=0;

QuestionsActivity.wrong=0;

btnRestart.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

Intent in = new
Intent(getApplicationContext(),MainActivity.class);

startActivity(in);

});

activity_developer.xml

<?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"

android:paddingBottom="@dimen/activity_vertical_margin"

34 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

android:paddingLeft="@dimen/activity_horizontal_margin"

android:paddingRight="@dimen/activity_horizontal_margin"

android:paddingTop="@dimen/activity_vertical_margin"

tools:context="com.example.rajan.quizbee.DeveloperActivity">

<TextView

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:textAppearance="?android:attr/textAppearanceLarge"

android:text="Developers"

android:id="@+id/textView2"

android:layout_marginTop="33dp"

android:textSize="40dp"

android:layout_alignParentTop="true"

android:textColor="#000000"

android:textAlignment="center"

android:layout_alignParentEnd="false"

android:layout_alignParentStart="false"

android:autoText="true"

android:layout_alignParentRight="false" />

35 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

<Button

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:text="Back"

android:id="@+id/button4"

android:layout_alignParentBottom="true"

android:layout_alignParentLeft="true"

android:layout_alignParentStart="true"

android:layout_marginBottom="31dp"

android:background="#01579B"

android:textColor="#ffffff" />

<ImageView

android:id="@+id/imageView"

android:layout_width="80dp"

android:layout_height="84dp"

android:layout_below="@+id/textView2"

android:layout_alignEnd="@+id/button4"

android:layout_alignRight="@+id/button4"

android:layout_marginTop="43dp"

android:layout_marginEnd="299dp"

36 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

android:layout_marginRight="299dp"

android:src="@drawable/vikas" />

<TextView

android:id="@+id/textView5"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_alignTop="@+id/imageView"

android:layout_alignEnd="@+id/textView7"

android:layout_alignRight="@+id/textView7"

android:layout_marginTop="12dp"

android:layout_marginEnd="23dp"

android:layout_marginRight="23dp"

android:text="@string/rajan_gupta"

android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView

android:id="@+id/textView6"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_below="@+id/textView5"

37 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

android:layout_alignEnd="@+id/textView5"

android:layout_alignRight="@+id/textView5"

android:layout_marginTop="5dp"

android:layout_marginEnd="-116dp"

android:layout_marginRight="-116dp"

android:text="@string/rajanjmu@gmail.com"

android:textAppearance="?android:attr/textAppearanceMedium" />

<TextView

android:id="@+id/textView7"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_below="@+id/imageView"

android:layout_centerHorizontal="true"

android:layout_marginTop="43dp"

android:text="@string/rajan_gupta"

android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView

android:id="@+id/textView8"

android:layout_width="wrap_content"

38 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

android:layout_height="wrap_content"

android:layout_below="@+id/textView7"

android:layout_alignStart="@+id/textView7"

android:layout_alignLeft="@+id/textView7"

android:layout_marginStart="5dp"

android:layout_marginLeft="5dp"

android:layout_marginTop="7dp"

android:text="@string/rajanjmu@gmail.com"

android:textAppearance="?android:attr/textAppearanceMedium" />

<ImageView

android:layout_width="80dp"

android:layout_height="80dp"

android:id="@+id/imageView2"

android:src="@drawable/sushant"

android:layout_alignTop="@+id/textView7"

android:layout_alignParentLeft="true"

android:layout_alignParentStart="true"

android:layout_alignParentEnd="false"

android:layout_alignParentBottom="false"

android:layout_alignParentTop="false"

39 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

android:layout_alignWithParentIfMissing="false" />

</RelativeLayout>

activity_main.xml

<?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"
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.rajan.quizbee.MainActivity"
>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/quizapp"
android:layout_marginTop="48dp"
android:textSize="60dp"
android:id="@+id/textView"
android:layout_alignParentTop="true"
android:layout_alignLeft="@+id/editName"

40 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

android:layout_alignStart="@+id/editName"
android:textColor="#F44336" />

<Button
android:layout_width="200dp"
android:layout_height="52dp"
android:text="Start"
android:id="@+id/button"
android:textSize="30dp"
android:layout_above="@+id/button2"
android:layout_alignLeft="@+id/editName"
android:layout_alignStart="@+id/editName"
android:layout_marginBottom="25dp"
android:background="#FF5722"
android:textColor="#ffffff" />

<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:ems="10"
android:id="@+id/editName"
android:textColor="#df040b"
android:hint="Enter your name"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true" />

<Button
android:layout_width="200dp"

41 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

android:layout_height="52dp"
android:text="About"
android:id="@+id/button2"
android:textSize="30dp"
android:layout_marginBottom="33dp"
android:layout_alignParentBottom="true"
android:layout_alignLeft="@+id/button"
android:layout_alignStart="@+id/button"
android:background="#01579B"
android:textColor="#ffffff" />
</RelativeLayout>

activity_questions.xml

<?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"
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.rajan.quizbee.QuestionsActivity">

<TextView
android:layout_width="200dp"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"

42 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

android:id="@+id/DispName"
android:textColor="@color/accent_material_light"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />

<RadioGroup
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/DispName"
android:layout_alignStart="@+id/DispName"
android:id="@+id/answersgrp"
android:clickable="true"
android:layout_centerVertical="true">
<!--android:layout-->
<!--android:checkedButton="@+id/radioButton"-->

<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="A"
android:id="@+id/radioButton"
android:checked="false"
/>

<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"

43 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

android:text="B"
android:id="@+id/radioButton2"
android:checked="false" />

<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="C"
android:id="@+id/radioButton3"
android:checked="false" />

<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="D"
android:id="@+id/radioButton4"
android:checked="false" />

</RadioGroup>

<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Next Question"
android:id="@+id/button3"
android:layout_marginTop="27dp"
android:layout_below="@+id/answersgrp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"

44 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

android:background="#FF5722"
android:textColor="#ffffff"/>

<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Quit"
android:id="@+id/buttonquit"
android:layout_marginTop="20dp"
android:layout_below="@+id/button3"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:background="#01579B"
android:textColor="#ffffff" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Questions"
android:id="@+id/tvque"
android:layout_marginBottom="52dp"
android:layout_above="@+id/answersgrp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />

<TextView
android:layout_width="wrap_content"
android:layout_height="24dp"

45 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

android:textAppearance="@color/abc_background_cache_hint_selector_materi
al_dark"
android:text="Your Score"
android:id="@+id/textView3"
android:textColor="#000000"
android:textSize="19dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="24dp"

android:textAppearance="@color/abc_background_cache_hint_selector_materi
al_dark"
android:id="@+id/textView4"
android:text="0"
android:textColor="#000000"
android:layout_alignParentBottom="true"
android:textAlignment="center"
android:layout_alignParentRight="true"
android:textSize="19dp" />

</RelativeLayout>

activity_result.xml

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


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

46 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
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.rajan.quizbee.ResultActivity">

<TextView
android:layout_width="wrap_content"
android:layout_height="28dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Large Text"
android:id="@+id/tvres"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="70dp"
android:layout_alignParentEnd="true"
android:layout_alignParentStart="true"
android:background="#F44336"
android:textColor="#000000"
android:textAlignment="center"
android:textSize="19dp" />

<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Restart"

47 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

android:id="@+id/btnRestart"
android:layout_alignParentBottom="true"
android:layout_marginBottom="119dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:background="#01579B"
android:textColor="#ffffff" />

<TextView
android:layout_width="wrap_content"
android:layout_height="28dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Large Text"
android:id="@+id/tvres2"
android:background="#76FF03"
android:layout_below="@+id/tvres"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="31dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:textColor="#000000"
android:textAlignment="center"
android:textSize="19dp" />

<TextView
android:layout_width="wrap_content"
android:layout_height="28dp"
android:textAppearance="?android:attr/textAppearanceLarge"

48 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

android:text="Large Text"
android:id="@+id/tvres3"
android:background="#FFEB3B"
android:layout_below="@+id/tvres2"
android:layout_marginTop="33dp"
android:layout_alignRight="@+id/tvres2"
android:layout_alignEnd="@+id/tvres2"
android:layout_alignParentEnd="true"
android:layout_alignParentStart="true"
android:textColor="#000000"
android:textAlignment="center"
android:textSize="19dp" />
</RelativeLayout>

Colors.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
</resources>

Dimens.xml
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
</resources>

49 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

Strings.xml
<resources>
<string name="app_name">QuizApp</string>
<string name="your_score">Your Score</string>
<string name="rajan_gupta">Rajan Gupta</string>
<string name="rajanjmu@gmail.com">rajanjmu@gmail.com</string>
<string name="rajan_gupta">Rajan Gupta</string>
<string name="rajanjmu@gmail.com">rajanjmu@gmail.com</string>
<string name="quizapp">QuizApp</string>
</resources>

Styles.xml
<resources>

<!-- Base application theme. -->


<style name="AppTheme"
parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>

</resources>

AndroidManifest.xml

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


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

50 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

package="com.example.rajan.quizbee">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
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>
<activity android:name=".QuestionsActivity">
<intent-filter>
<action
android:name="com.example.rajan.quizbee.QuestionsActivity" />

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


</intent-filter>
</activity>
<activity android:name=".DeveloperActivity">
<intent-filter>
<action
android:name="com.example.rajan.quizbee.DeveloperActivity" />

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

51 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

</intent-filter>
</activity>
<activity android:name=".ResultActivity"></activity>
</application>

</manifest>

Snapshots of all the web pages-

Attach all the snapshots here-

52 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

Conclusion:

Currently there are many medication reminder systems which are


operable manually. Due to increased manual work, the available
system becomes more time consuming. So in the given work, an
attempt has been made to implement fully automatic medication
reminder system. It eases the user’s task of recalling when to take
the medicine by reminding them of the particular medicine at the
correct time thereby reducing the much prevalent manual work.

References:

[1] Neil Smyth, Android Studio Development


Essentials,1 edition, Create Space Independent
Publishing Platform(July 22, 2014).

[2] Ronan Schwartz & Phil Dutson, Building


Applications with the Android SDK, 2 edition,
Addision Wesley Professional(2013).

[3] David J. Eck, Java Virtual Machine, 7 edition,


University Press of Florida(2014).

[4] Troy Drowning and John Meyer, Java Virtual

53 | P a g e
NEHA RAI MCA 4TH SEM D20MCA11023

Machine, Edition 1, O’Reilly Media (1997).

[5] E. Burnette, Hello Android, the Pragmatic


Programmers, 2 Edition, Pragmatic
Bookshelf(2009).

[6] R. Meier,Professional Android 2 Application


Development, 2 edition, John Wiley &Sons(2010).

Bibliography:

 www.stackoverlow.com

 www.w3schools.com

 www.wikipedia.org

54 | P a g e

You might also like