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

Android Base Voting System

This document is a thesis submitted by four students - Santosha Bhat, Vageesh K C, Vishwaradhya, and Yashwanth R K - for their Bachelor of Engineering degree. The thesis proposes developing an Android-based online voting system with fingerprint authentication. It aims to address the limitations of existing manual voting systems. The system would allow voters to cast their votes from any location via a mobile app using fingerprint authentication for secure access. The document outlines the existing problems, objectives, proposed solution, scope and provides a literature review of similar systems.

Uploaded by

Aaden
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
255 views

Android Base Voting System

This document is a thesis submitted by four students - Santosha Bhat, Vageesh K C, Vishwaradhya, and Yashwanth R K - for their Bachelor of Engineering degree. The thesis proposes developing an Android-based online voting system with fingerprint authentication. It aims to address the limitations of existing manual voting systems. The system would allow voters to cast their votes from any location via a mobile app using fingerprint authentication for secure access. The document outlines the existing problems, objectives, proposed solution, scope and provides a literature review of similar systems.

Uploaded by

Aaden
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 63

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

JNANASANGAMA, BELAGAVI - 590018

“Android Based Online Voting


System”
Thesis submitted in partial fulfillment of the curriculum prescribed for
the award of the degree of Bachelor of Engineering in
Computer Science & Engineering by

1CR14CS126 Santosha Bhat


1CR14CS154 Vageesh K C
1CR14CS162 Vishwaradhya
1CR14CS167 Yashwanth R
K

Under the Guidance of

Mr. Shivaraj V B
Assistant Professor
Department of CSE, CMRIT, Bengaluru

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING


#132, AECS LAYOUT, IT PARK ROAD, BENGALURU - 560037

2017-18
VISVESVARAYA TECHNOLOGICAL UNIVERSITY
JNANASANGAMA, BELAGAVI - 590018

Certificate
This is to certify that the project entitled “ANDROID BASED ONLINE
VOTING SYSTEM” is a bonafide work carried out by Santosha Bhat bearing
USN:1CR14CS126 , Vageesh K C bearing USN:1CR14CS154, Vishwaradhya
bearing USN:1CR14CS162 and Yashwanth R K bearing USN:1CR14CS167 in
partial fulfillment of the award of the degree of Bachelor of Engineering in Computer
Science & Engineering of Visvesvaraya Technological University, Belgaum, during the
year 2017-18. It is certified that all corrections / suggestions indicated during
reviews have been incorporated in the report. The project report has been approved
as it satisfies the academic requirements in respect of the project work prescribed
for the Bachelor of Engineering Degree.

Signature of Guide Signature of HoD Signature of Principal


Mr. Shivaraj V B Dr. Jhansi Rani P Dr. Sanjay Jain
Assistant Professor Professor & Head Principal
Department of CSE Department of CSE CMRIT,
CMRIT, Bengaluru - 37 CMRIT, Bengaluru - 37 Bengaluru - 37

External Viva

Name of the Examiners Institution Signature with Date

1.

2.
Acknowledgement

We take this opportunity to thank all of those who have generously


helped us to give a proper shape to our work and complete our BE project
successfully. A successful project is fruitful culmination efforts by many
people, some directly involved and some others indirectly, by providing
support and encouragement.

We would like to thank Dr. SANJAY JAIN , Principal , CMRIT ,


for providing excellent academic environment in the college.

We would like to express our gratitude towards Dr. JHANSI RANI


, Professor & HOD , Dept of CSE , CMRIT , who provided guidance and
gave valuable suggestions regarding the project.

We consider it a privilege and honour to express our sincere gratitude


to our Internal Guide Mr. Shivaraj V B , Asst. Professor , Department
of Computer Science & Engineering , CMRIT , for her valuable guidance
throughout the tenure of this project work.

Santosha Bhat
Vageesh K C
Vishwaradhya
Yaswanth R
K

i
Table of Contents

Table of Contents ii

List of Figures v

Abstract vi

1 PREAMBLE 1
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Existing System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Problem Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4 Objective of Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.5 Proposed System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.6 Scope of Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2 LITERATURE SURVEY 5
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2 Literature Survey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3 Review Concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.4 Survey Papers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

3 THEORETICAL BACKGROUND 8
3.1 Android Operating System . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.2 SDK and API for Fingerprint Integration . . . . . . . . . . . . . . . . . 11
3.3 Rules in Voting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

4 SYSTEM REQUIREMENT SPECIFICATION 13


4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.2 Functional Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.3 Non-Functional Requirements . . . . . . . . . . . . . . . . . . . . . . . 15
4.4 Hardware Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.5 Software Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

ii
5 SYSTEM ANALYSIS 19
5.1 Introduction.........................................................................................................20
5.2 Feasibility Study...........................................................................................20
5.3 Operational Feasibility.................................................................................20
5.4 Economic Feasibility.....................................................................................21
5.5 Technical Feasibility.....................................................................................21
5.6 Social Feasibility...........................................................................................21

6 SYSTEM DESIGN 22
6.1 Introduction.........................................................................................................23
6.2 System Development Methodology...................................................................23
6.3 Design Using UML........................................................................................25
6.4 Data Flow Diagram......................................................................................25
6.5 Class Diagram...............................................................................................26
6.6 Use Case Diagram........................................................................................27
6.7 Activity Diagram...........................................................................................28
6.8 Sequence Diagram...............................................................................................29

7 IMPLEMENTATION 30
7.1 Introduction.........................................................................................................31
7.2 Fingerprint Authentication..........................................................................31
7.3 Caste Voting.................................................................................................35
7.4 Interfacing Android Application with Server...............................................40

8 TESTING AND RESULTS 41


8.1 Introduction.........................................................................................................42
8.2 Testing Methedologies........................................................................................42
8.3 Test Case 1...................................................................................................44
8.4 Test Case 2...................................................................................................44
8.5 Test Case 3...................................................................................................44
8.6 Test Case 4...................................................................................................44
8.7 Test Case 5...................................................................................................45
8.8 Images Of The Anroid APP......................................................................45

9 CONCLUSION & FUTURE SCOPE 47


9.1 Conclusion............................................................................................................48
9.2 Future Scope.......................................................................................................48
9.3 Build a Copmlete System.............................................................................48
9.4 Research Issues...................................................................................................48
9.5 Implementation Issues........................................................................................49

iii
References 50

iv
List of Figures

6.1 Waterfall Model........................................................................................................25


6.2 Class Diagram Of System..................................................................................26
6.3 Use Case Diagram..............................................................................................27
6.4 Activity Diagram...............................................................................................28
6.5 Sequence Diagram....................................................................................................29

8.1 App Activities-1(Admin Activity)...................................................................45


8.2 App Activities-2(User Activity).........................................................................46

v
Abstract

In the traditional system there was a need to go on the voting booth


and cast a vote. People from distinct places who did not have their voting
cards cannot cast their votes. Also authentication of the user was not
good and appropriate. There was a lot of paper work which was very
time consuming. The results needed to be calculated manually which
was very time consuming process. Therefore the proposed system is
developed to remove the efforts needed in the traditional voting
process.

The proposed system has an application developed on android phone


via which the user can cast his vote from anywhere on the face of the globe.
The user registers by giving his personal details which gets stored in the
database at the server side. After the voting date is fixed the user gets
notification on the android phone via GCM (Google Cloud Messaging).
After that the user opens the application. The finger print authentication
is done and then the system will allow user to get into home screen.
Then user opens the voting form he casts his vote and then click on
submits button and then logout. On the server side we can check the
results. The GCM is which sends notification to user’s android phone. The
sqlite is the local database of the user’s phone. If his internet connection
is off then the notification and other details get stored on his local
server. When he starts his internet connection then this message are
retrieved from the GCM that is the local database of the android
phone.

vi
Chapter 1

PREAMBLE

1
Android Based Online Voting CHAPTER
1.1 Introduction
ANDROID BASED ONLINE VOTING SYSTEM is an online voting technique. In
this system people who have citizenship of India and whose age is above 18 years of
age and any sex can give his vote online without going to any physical polling sta-
tion. There is a database which is maintained in which all the names of voters with
complete information is stored.

In ANDROID BASED ONLINE VOTING SYSTEM a voter can use his voting
right online without any difficulty. He has to be registered first for him to vote.
Registration is mainly done by the system administrator for security reasons. The
system Administrator registers the voters on a special site of the system visited by
him only by simply filling a registration form to register voter. Citizens seeking
registration are expected to contact the system administrator to submit their
details. After the validity of them being citizens of India has been confirmed by the
system administrator by comparing their details submitted with those in existing
databases such as those as the Registrar of Persons, the citizen is then registered as
a voter.
After registration, the voter is assigned a secret Voter ID with which he/she can
use to log into the system and enjoy services provided by the system such as voting.
If invalid/wrong details are submitted, then the citizen is not registered to vote.

1.2 Existing System


In existing system of voting, voter go on voting booth on the day of voting. There is
no any centralized system, where we can cast our vote from remote location. There
is no proper authentication present of an individual. There is manual work involved,
so it may generate errors in the system. The Traditional approach is very time
consuming and have got manual errors.

1.3 Problem Statement


• Expensive and Time consuming: The process of collecting data and entering
this data into the database takes too much time and is expensive to conduct,
for example, time and money is spent in printing data capture forms, in
preparing registration stations together with human resources, and there after
advertising the days set for registration process including sensitizing voters on
the need for registration, as well as time spent on entering this data to the
database.

DEPARTMENT Of CSE , CMRIT , BENGALURU - 2


Android Based Online Voting CHAPTER
• Too much paper work: The process involves too much paper work and paper
storage which is difficult as papers become bulky with the population size.

• Errors during data entry: Errors are part of all human beings; it is very
unlikely for humans to be 100 percent efficient in data entry.

• Loss of registration forms: Some times, registration forms get lost after being
filled in with voters details, in most cases these are difficult to follow-up and
therefore many remain unregistered even though they are voting age nationals
and interested in exercising their right to vote.

• Short time provided to view the voter register: This is a very big problem
since not all people have free time during the given short period of time to check
and update the voter register.

• Above all, a number of voters end up being locked out from voting.

1.4 Objective of Project


The specific objectives of the project include:

• Reviewing the existing/current voting process or approach in India.

• Coming up with an automated voting system in India.

• Implementing a an automated/online voting system.

• Validating the system to ensure that only legible voters are allowed to vote.

1.5 Proposed System


This system was proposed to eliminate the trouble of people to go and vote at the
voting booth. Whenever schedule date notification is get on user android device,
user can cast their vote from anywhere and at anytime. For casting the vote
particular user should be authorized so the proposed system will done
authentication of voter. With the help of mobile finger print device.

This proposed system is based on fingerprint authorization.During registration


the proposed system will get all user details.And while user is signing in to the
application this will authorizes the user with the help of fingerprint device. In
proposed system advancement in android device is very easy and secure voting. The
proposed system provides the specification and requirements for E-Voting using an

DEPARTMENT Of CSE , CMRIT , BENGALURU - 3


Android Based Online Voting CHAPTER
Android platform.

DEPARTMENT Of CSE , CMRIT , BENGALURU - 4


Android Based Online Voting CHAPTER
1.6 Scope of Study
It is focused on studying the existing system of voting in India and to make sure
that the peoples vote is counts, for fairness in the elective positions. This is also will
produce:

• Less effort and less labor intensive, as the primary cost and focus primary on
creating, managing, and running a secure web voting portal.

• Increasing number of voters as individuals will find it easier and more convenient
to vote, especially those abroad.

DEPARTMENT Of CSE , CMRIT , BENGALURU - 5


Chapter 2

LITERATURE SURVEY

5
Android Based Online Voting CHAPTER
2.1 Introduction
Literature survey is mainly carried out in order to analyze the background of the
current project which helps to find out flaws in the existing system and guides on which
unsolved problems we can work out. So, the following topics not only illustrate the
background of the project but also uncover the problems and flaws which motivated
to propose solutions and work on this project.

2.2 Literature Survey


To make the voting process very easy and efficient wireless and web technologies
are used. The online-voting system has the possibility of secure, easy and safe way
to capture and count the votes in the election. The proposed system provides the
specification and requirements for Online-Voting using an Android platform. The
Online-voting means the voting process in election by using mobile phone. The an-
droid platform is used to develop an Online-voting application. Through a general
diagram the introduction of the system is presented. The proposed Online-voting
sys- tem will be presented with the obtained results.The proposed system also
described how the android mobile phones are efficient. The android platform is used
to develop a reliable and efficient application. Using the face-book APIs provided by
the android SDK (software development kit) the login can be done very efficiently.

2.3 Review Concept


• Efficient E-voting Android Based System: The advancement in the mo-
bile devices the wireless sensor network and web technologies that may given
rise to the new applications which will make the voting process very easy and ef-
ficient.The research project provides the specifications and requirements for the E-
Voting using an Android Platform. The E-Voting means the voting process in
election by using electronic device. E-Voting is not more secure as possible than
the paper-ballot system. Electronic failures might occur with such a system.

• Web-Based Voting System Using Fingerprint: The problem of voting


system is still critical in terms of safety and the security. The design and de-
velopment of the web based voting system using fingerprint verification in
order to provide a high performance with high security to the voting system
also the user can use the web technology to make the voting system more
practical. The proposed architecture presents the module for election system for
selecting the president in university. The Electronic voting System allows the
voters to scan
DEPARTMENT Of CSE , CMRIT , BENGALURU - 6
Android Based Online Voting CHAPTER
their fingerprint and then it will matched with an already saved image with in a
database. Web based Voting System using Fingerprint Recognition. The online
system has provided an efficient way to cast their votes, free of fraud, and
make the system more trust, economic and fast. It may have used based on
Minute based fingerprint identification and matching with high accuracy. More
number of peoples were participate in the election to vote their candidate for
choosing the majority votes. When limited number of people were register in
the sys- tem means that particular candidate only allowed for voting and the
remaining peoples may not allowed for the voting .

2.4 Survey Papers


• Title: Election voting system using mobile (m-voting)-(2013)
Context:
Biometric identification of voter by using iris pattern scanning and otp of each
individual voter for validation and authorization purpose.

• Title: Transforming voting paradigm the shift from inline through online to
mobile voting -(2014)
Context:
A model for m-voting that utilizes biometric (voice recognition), nfc (used to
store secret question and answer), mobile phone and location based technol-
ogy.bring your own devices concept introduced.

• Title: Event based application of voting system for mobile devices-(2015)


Context:
An objective was to focus on implementing mobile voting application for mea-
suring the cognitive competencies of social group, particularly in the field of
education.

• Title: Mobile based facial recognition using otp verification for voting system
-(2015)
Context:
Biometric identification of voter by using face recognition and otp of each indi-
vidual voter for validation and authorization purpose.

DEPARTMENT Of CSE , CMRIT , BENGALURU - 7


Chapter 3

THEORETICAL BACKGROUND

8
Android Based Online Voting CHAPTER
3.1 Android Operating System
Android is a mobile operating system developed by Google, based on a modified
version of the Linux kernel and other open source software and designed primarily for
touchscreen mobile devices such as smartphones and tablets. In addition, Google has
further developed Android TV for televisions, Android Auto for cars, and Wear OS
for wrist watches, each with a specialized user interface. Variants of Android are also
used on game consoles, digital cameras, PCs and other electronics.
Initially developed by Android Inc., which Google bought in 2005, Android was
unveiled in 2007, with the first commercial Android device launched in September
2008. The operating system has since gone through multiple major releases, with
the current version being 8.1 ”Oreo”, released in December 2017. The core Android
source code is known as Android Open Source Project (AOSP), and is primarily
licensed under the Apache License.
Android is also associated with a suite of proprietary software developed by Google,
including core apps for services such as Gmail and Google Search, as well as the appli-
cation store and digital distribution platform Google Play, and associated development
platform. These apps are licensed by manufacturers of Android devices certified un-
der standards imposed by Google, but AOSP has been used as the basis of competing
Android ecosystems, such as Amazon.com’s Fire OS, which utilize its own equivalents
to these Google Mobile Services.
Android has been the best-selling OS worldwide on smartphones since 2011 and
on tablets since 2013. As of May 2017, it has over two billion monthly active users,
the largest installed base of any operating system, and as of 2017, the Google Play
store features over 3.5 million apps.

• Interface Android’s default user interface is mainly based on direct manipula-


tion, using touch inputs that loosely correspond to real-world actions, like
swip- ing, tapping, pinching, and reverse pinching to manipulate on-screen
objects, along with a virtual keyboard.Game controllers and full-size physical
keyboards are supported via Bluetooth or USB.The response to user input is
designed to be immediate and provides a fluid touch interface, often using the
vibration capabilities of the device to provide haptic feedback to the user.

• Applications Applications (”apps”), which extend the functionality of devices,


are written using the Android software development kit (SDK)and, often, the
Java programming language.Java may be combined with C/C++, together with
a choice of non-default runtimes that allow better C++ support. The Go
pro- gramming language is also supported, although with a limited set of
application

DEPARTMENT Of CSE , CMRIT , BENGALURU - 9


Android Based Online Voting CHAPTER
programming interfaces (API). In May 2017, Google announced support for
Android app development in the Kotlin programming language.

• Memory Management Since Android devices are usually battery-powered,


Android is designed to manage processes to keep power consumption at a min-
imum. When an application is not in use the system suspends its operation
so that, while available for immediate use rather than closed, it does not use
battery power or CPU resources.Android manages the applications stored in
memory automatically: when memory is low, the system will begin invisibly
and automatically closing inactive processes, starting with those that have been
inactive for the longest amount of time. Lifehacker reported in 2011 that third-
party task killer applications were doing more harm than good.

• Hardware The main hardware platform for Android is ARM (the ARMv7 and
ARMv8-A architectures), with x86, MIPS and MIPS64, and x86-64 architectures
also officially supported in later versions of Android. The unofficial Android-
x86 project provided support for x86 architectures ahead of the official
support.The MIPS architecture was also supported ahead of Google’s support.
Since 2012, Android devices with Intel processors began to appear, including
phones and tablets. While gaining support for 64-bit platforms, Android was
first made to run on 64-bit x86 and then on ARM64. Since Android 5.0
”Lollipop”, 64-bit variants of all platforms are supported in addition to the
32-bit variants. Requirements for the minimum amount of RAM for devices
running Android
7.1 range from in practice 2 GB for best hardware, down to 1 GB for the most
common screen, to absolute minimum 512 MB for the lowest spec 32-bit
smart- phone. The recommendation for Android 4.4 is to have at least 512
MB of RA while for ”low RAM” devices 340 MB is the required minimum
amount that does not include memory dedicated to various hardware
components such as the baseband processor. Android 4.4 requires a 32-bit
ARMv7, MIPS or x86 architecture processor (latter two through unofficial
ports),together with an OpenGL ES 2.0 compatible graphics processing unit
(GPU).Android supports OpenGL ES 1.1, 2.0, 3.0, 3.1 and as of latest major
version, 3.2 and since An- droid 7.0 Vulkan (and version 1.1 available for some
devices). Some applications may explicitly require a certain version of the
OpenGL ES, and suitable GPU hardware is required to run such applications.

• Linux Kernel Android’s variant of the Linux kernel has further architectural
changes that are implemented by Google outside the typical Linux kernel de-
velopment cycle, such as the inclusion of components like device trees, ash-
mem, ION, and different out of memory (OOM) handling. Certain features
DEPARTMENT Of CSE , CMRIT , BENGALURU - 1
Android Based Online Voting CHAPTER
that Google contributed back to the Linux kernel, notably a power
management feature called ”wakelocks”, were initially rejected by mainline
kernel developers partly because they felt that Google did not show any intent
to maintain its own code. Google announced in April 2010 that they would hire
two employees to work with the Linux kernel community, but Greg Kroah-
Hartman, the cur- rent Linux kernel maintainer for the stable branch, said in
December 2010 that he was concerned that Google was no longer trying to get
their code changes included in mainstream Linux. Google engineer Patrick
Brady once stated in the company’s developer conference that ”Android is not
Linux”, with Com- puterworld adding that ”Let me make it simple for you,
without Linux, there is no Android”. Ars Technica wrote that ”Although
Android is built on top of the Linux kernel, the platform has very little in
common with the conventional desktop Linux stack”.

• Technical Security Feuture Android applications run in a sandbox, an iso-


lated area of the system that does not have access to the rest of the system’s
resources, unless access permissions are explicitly granted by the user when
the application is installed, however this may not be possible for pre-installed
apps. It is not possible, for example, to turn off the microphone access of the
pre- installed camera app without disabling the camera completely. This is
valid also in Android versions 7 and 8.
Since February 2012, Google has used its Google Bouncer malware scanner to
watch over and scan apps available in the Google Play store. A ”Verify Apps”
feature was introduced in November 2012, as part of the Android 4.2 ”Jelly
Bean” operating system version, to scan all apps, both from Google Play and
from third-party sources, for malicious behavior. Originally only doing so
during installation, Verify Apps received an update in 2014 to ”constantly”
scan apps, and in 2017 the feature was made visible to users through a menu
in Settings.

3.2 SDK and API for Fingerprint Integration


Top technology corporations have been focusing on building ecosystem of integrated
services, which can communicate with each other and data is seamlessly shared among
them. It requires engagement of a large community of developers to develop apps and
service and their integration with other services. Tech firms try their best to persuade
developers to build for their ecosystems, so that the more and more services could
be integrated to make the ecosystems grow. They provide training material, videos,
SDKs, APIs, tools and help for developers. The same applies on biometric software

DEPARTMENT Of CSE , CMRIT , BENGALURU - 1


Android Based Online Voting CHAPTER
solution firms. Biometric software firms want developers to use their SDK and APIs
to grow their market presence and revenue.
To integrate fingerprint hardware, developers would require fingerprint SDK that
will allow them to access fingerprint hardware features and API, which can commu-
nicate with other software or services. For example, to integrate fingerprint hardware
with an Android app, a developer needs to get the Android SDK and target API level.
API level is determined by the Android versions the app wants to have compatibil-
ity with. SDKs and APIs are often available on software/service providers website
and can be downloaded by anyone. In cloud biometrics, applications integrated with
fingerprint sensors need to communicate with remote servers on each request. This
communication is made possible by APIs. Biometrics as a Service or cloud biometrics
service providers also provide APIs that can communicate with external services and
software.
Some device hardware manufacturers like Samsung provide SDK and API for their
devices to securely integrate apps with fingerprint hardware. User can use Androids
generic API or devices manufacturers APK as required. Apple also provides iOS SDK
and Touch ID API for fingerprint authentication.

3.3 Rules in Voting


• Majority-Rule The most common way of tallying all the votes is the majority
rule, which is take the alternative that is preferred by a majority of the voters
rank it first, placing the other second. With only two alternatives, this works
perfectly. However, when there are more than two options in the vote, a very
famous Condorcet Paradox can potentially occur and cause incoherence.

• Positional Voting Positional voting is another common voting system. Being


different from building up ranked list with pairwise comparison and majority
rule votes aggregation, it produces a group ranking directly from the individual
ranking. In this type of system, each alternative receives a weight based on
its position in the preference list. For example, in a voters ranking with k
alternatives, the first-ranked alternative receives a weight of k-1, the second-
ranked alternative receives a weight of k-2, and etc. Then, the last ranked
alternative will receive a weight of zero. Aggregating all the weights assigned
to each alternative and ordering the alternatives by the aggregated weights
produce the group-ranking list.

DEPARTMENT Of CSE , CMRIT , BENGALURU - 1


Chapter 4

SYSTEM REQUIREMENT
SPECIFICATION

13
Android Based Online Voting CHAPTER
4.1 Introduction
This chapter describes about the requirements. It specifies the hardware and software
requirements that are required in order to run the application properly. The
Software Requirement Specification (SRS) is explained in detail, which includes
overview of dissertation as well as the functional and non-functional requirement of
this disserta- tion.
A SRS document describes all data, functional and behavioral requirements of the
software under production or development. SRS is a fundamental document, which
forms the foundation of the software development process. Its the complete descrip-
tion of the behavior of a system to be developed. It not only lists the requirements
of a system but also has a description of its major feature. Requirement Analysis
in system engineering and software engineering encompasses those tasks that go into
determining the need or conditions to meet for a new or altered product, taking ac-
count of the possibly conflicting requirements of the various stakeholders, such as
beneficiaries or users. Requirement Analysis is critical to the success to a develop-
ment project. Requirement must be documented, measurable, testable, related to in
identified business needs or opportunities, and defined to a level of detail sufficient for
system design.
The SRS functions as a blueprint for completing a project. The SRS is often
referred to as the ”parent” document because all subsequent project management
documents, such as design specifications, statements of work, software architecture
specification, testing and validation plans, and documentation plans, are related to it.
It is important to note that an SRS contains functional and non-functional require-
ments only.
Thus the goal of preparing the SRS document is to

• To facilitate communication between the customer, analyst, system developers,


maintainers.

• To serve as a contrast between purchaser and supplier.

• To firm foundation for the design phase.

• Support system testing facilities.

• Support project management and control.

• Controlling the evolution of the system.

DEPARTMENT Of CSE , CMRIT , BENGALURU - 1


Android Based Online Voting CHAPTER
4.2 Functional Requirements
Functional Requirement defines a function of a software system and how the system
must behave when presented with specific inputs or conditions. These may include
calculations, data manipulation and processing and other specific functionality. In
this system following are the functional requirements:-

• Input test case must not have compilation and runtime errors.

• The application must not stop working when kept running for even a long time.

• The application must function as expected for every set of test cases provided.

• The application should generate the output for given input test case and input
parameters.

• The application should generate on-demand services.

4.3 Non-Functional Requirements


Non-functional requirements are the requirements which are not directly concerned
with the specific function delivered by the system. They specify the criteria that
can be used to judge the operation of a system rather than specific behaviors. They
may relate to emergent system properties such as reliability, response time and
store occupancy. Non-functional requirements arise through the user needs,
because of budget constraints, organizational policies, the need for interoperability
with other software and hardware systems or because of external factors such as:-

• Product Requirements

• Organizational Requirements

• User Requirements

• Basic Operational Requirements

In systems engineering and requirements engineering, a non-functional requirement


is a requirement that specifies criteria that can be used to judge the operation of a
system, rather than specific behaviours. This should be contrasted with functional
requirements that define specific behaviour or functions. The plan for implementing
non-functional requirements is detailed in the system architecture. Broadly, functional
requirements define what a system is supposed to do and non- functional requirements
define how a system is supposed to be. Functional requirements are usually in the

DEPARTMENT Of CSE , CMRIT , BENGALURU - 1


Android Based Online Voting CHAPTER
form of system shall do ¡requirement¿, an individual action of part of the system,
perhaps explicitly in the sense of a mathematical function, a black box description
input, output, process and control functional model or IPO Model. In contrast, non-
functional requirements are in the form of system shall be ¡requirement¿, an overall
property of the system as a whole or of a particular aspect and not a specific function.
The systems’ overall properties commonly mark the difference between whether the
development project has succeeded or failed.

4.3.1 Product Requirements


• Portability: Since the system is designed to run using Android, the system is
portable.

• Correctness: It follows a well-defined set of procedures and rules to compute


and also rigorous testing is performed to confirm the correctness of the data.

• Ease of Use: The front end is designed in such a way that it provides an interface
which allows the user to interact in an easy manner.

• Modularity: The complete product is broken up into many modules and well-
defined interfaces are developed to explore the benefit of flexibility of the prod-
uct.

• Robustness: This software is being developed in such a way that the overall
performance is optimized and the user can expect the results within a limited
time with utmost relevancy and correctness.

whereas evolution quality involves testability, maintainability, extensibility or


scal- ability.

4.3.1.1 Organizational Requirements

Process Standards: IEEE standards are used to develop the application which is the
standard used by the most of the standard software developers all over the world.
This stage is the first step in moving from problem to the solution domain. In other
words, starting with what is needed design takes us to work how to satisfy the
needs.

4.3.1.2 User Requirements

The user requirements document (URD) or user requirements specification is a docu-


ment usually used to software engineering that specifies the requirements user expects
from software to be constructed in software project. Once the required information

DEPARTMENT Of CSE , CMRIT , BENGALURU - 1


Android Based Online Voting CHAPTER
is completely gathered it is documented in a URD, which is meant to spell out exactly

DEPARTMENT Of CSE , CMRIT , BENGALURU - 1


Android Based Online Voting CHAPTER
what the software must do and becomes part of the contractual agreement. A cus-
tomer cannot demand feature not in the URD, whilst the developer cannot claim the
product is ready if it does not meet an item of the URD. The URD can be used as a
guide to planning cost, timetables, milestones, testing etc. The explicit nature of the
URD allows customers to show it to various stakeholders to make sure all necessary
features are described. Formulating a URD requires negotiation to determine what is
technically and economically feasible. Preparing a URD is one of those skills that lies
between a science and economically feasible. Preparing a URD is one of those skills
that lies between a science and an art, requiring both software technical skills and
interpersonal skills.

4.3.1.3 Basic Operational Requirements

Operational requirement is the process of linking strategic goals and objectives to


tactic goals and objectives. It describes milestones, conditions for success and explains
how, or what portion of, a strategic plan will be put into operation during a given
operational period, in the case of, a strategic plan will be put into operation during
a given operational period, in the case of commercial application, a fiscal year or
another given budgetary term. An operational plan is the basis for, and justification
of an annual operating budget request. Therefore, a five-year strategic plan would
typically require five operational plans funded by five operating budgets.
Operational plans should establish the activities and budgets for each part of the
organization for the next 1-3 years. They link the strategic plan with the activities
the organization will deliver and the resources required to deliver them. An
operational plan draws directly from agency and program strategic plans to describe
agency and program missions and goals, program objectives, and program activities.
Like a strategic plan, an operational plan addresses four questions:

• Where are we now?

• Where do we want to be?

• How do we get there?

The customers are those that perform the eight primary functions of systems engi-
neering, with special emphasis on the operator as the key customer. Operational
requirements will define the basic need and, at a minimum, will be related to these
following points:

• Mission profile or scenario: It describes about the procedures used to accomplish


mission objective. It also finds out the effectiveness or efficiency of the system.

DEPARTMENT Of CSE , CMRIT , BENGALURU - 1


Android Based Online Voting CHAPTER
• Performance and related parameters: It points out the critical system parame-
ters to accomplish the mission

• Utilization environments: It gives a brief outline of system usage. Finds out


appropriate environments for effective system operation.

• Operational life cycle: It defines the system lifetime

4.4 Hardware Requirements


• Processor: 800MHz Intel Pentium III or equivalent

• Memory: 512 MB

• Disk space: 750 MB of free disk space


For Mobile:

• Running Device : Android.

• RAM : 512 MB minimum.

• Internal storage :1 GB.

• Internet access : Yes.

• Sensors : fingerprint device.

4.5 Software Requirements


• Operating System : Windows 10 and Ubuntu.

• Coding Language : Java.

• Tools : Eclipse and Netbeans IDE.

• Library support : SDK,JDK,NDK.

DEPARTMENT Of CSE , CMRIT , BENGALURU - 1


Chapter 5

SYSTEM ANALYSIS

19
Android Based Online Voting CHAPTER
5.1 Introduction
Design is a meaningful engineering representation of something that is to be built.
It is the most crucial phase in the developments of a system. Software design is a
process through which the requirements are translated into a representation of soft-
ware. Design is a place where design is fostered in software Engineering. Based on the
user requirements and the detailed analysis of the existing system, the new system
must be designed. This is the phase of system designing. Design is the perfect way
to accurately translate a customers requirement in the finished software product. De-
sign creates a representation or model, provides details about software data structure,
architecture, interfaces and components that are necessary to implement a system.
The logical system design arrived at as a result of systems analysis is converted into
physical system design.

5.2 Feasibility Study


The feasibility of the project is analyzed in this phase and business proposal is put
forth with a very general plan for the project and some cost estimates. During system
analysis the feasibility study of the proposed system is to be carried out. This is
to ensure that the proposed system is not a burden to the company. For feasibility
analysis, some understanding of the major requirements for the system is essential.
Three key considerations involved in the feasibility analysis are

• Operational Feasibility

• Economical Feasibility

• Technical Feasibility

• Social Feasibility

5.3 Operational Feasibility


Some national Governments in the world are looking for the change in the current E-
voting system.This needs to be developed in suc a way that the government can
abble to fund the all amount for developing, designing and maintaining the E-voting
system.And they should make sure that they can handle all interuption,faults in the
proposed voting system.

DEPARTMENT Of CSE , CMRIT , BENGALURU - 2


Android Based Online Voting CHAPTER
5.4 Economic Feasibility
This study is carried out to check the economic impact that the system will have on
the organization. The amount of fund that the company can pour into the research
and development of the system is limited. The expenditures must be justified. Thus
the developed system as well within the budget and this was achieved because most
of the technologies used are freely available. Only the customized products had to
be purchased.

5.5 Technical Feasibility


This study is carried out to check the technical feasibility, that is, the technical re-
quirements of the system. Any system developed must not have a high demand on
the available technical resources. This will lead to high demands on the available
technical resources. This will lead to high demands being placed on the client. The
developed system must have a modest requirement, as only minimal or null changes
are required for implementing this system.

5.6 Social Feasibility


The aspect of study is to check the level of acceptance of the system by the user.
This includes the process of training the user to use the system efficiently. The user
must not feel threatened by the system, instead must accept it as a necessity. The
level of acceptance by the users solely depends on the methods that are employed to
educate the user about the system and to make him familiar with it. His level of
confidence must be raised so that he is also able to make some constructive
criticism, which is welcomed, as he is the final user of the system.

DEPARTMENT Of CSE , CMRIT , BENGALURU - 2


Chapter 6

SYSTEM DESIGN

22
Android Based Online Voting CHAPTER
6.1 Introduction
Design is a meaningful engineering representation of something that is to be built.
It is the most crucial phase in the developments of a system. Software design is a
process through which the requirements are translated into a representation of soft-
ware. Design is a place where design is fostered in software Engineering. Based on the
user requirements and the detailed analysis of the existing system, the new system
must be designed. This is the phase of system designing. Design is the perfect way
to accurately translate a customers requirement in the finished software product. De-
sign creates a representation or model, provides details about software data structure,
architecture, interfaces and components that are necessary to implement a system.
The logical system design arrived at as a result of systems analysis is converted into
physical system design.

6.2 System Development Methodology


System development method is a process through which a product will get completed
or a product gets rid from any problem. Software development process is described as
a number of phases, procedures and steps that gives the complete software. It follows
series of steps which is used for product progress. The development method followed
in this project is waterfall model.

6.2.1 Model Phases


The waterfall model is a sequential software development process, in which progress
is seen as flowing steadily downwards (like a waterfall) through the phases of
Require- ment initiation, Analysis, Design, Implementation, Testing and
maintenance.

• Requirement Analysis: This phase is concerned about collection of require-


ment of the system. This process involves generating document and requirement
review.

• System Design: Keeping the requirements in mind the system specifications


are translated in to a software representation. In this phase the designer em-
phasizes on:-algorithm, data structure, software architecture etc.

• Coding: In this phase programmer starts his coding in order to give a full
sketch of product. In other words system specifications are only converted in to
machine readable compute code.

DEPARTMENT Of CSE , CMRIT , BENGALURU - 2


Android Based Online Voting CHAPTER
• Implementation: The implementation phase involves the actual coding or
programming of the software. The output of this phase is typically the library,
executables, user manuals and additional software documentation

• Testing: In this phase all programs (models) are integrated and tested to en-
sure that the complete system meets the software requirements. The testing is
concerned with verification and validation.

• Maintenance: The maintenance phase is the longest phase in which the soft-
ware is updated to fulfill the changing customer need, adapt to accommodate
change in the external environment, correct errors and oversights previously
undetected in the testing phase, enhance the efficiency of the software.

6.2.2 Reason For Choosing Waterfall Model As


Development Method
• Clear project objectives.

• Stable project requirements.

• Progress of system is measurable.

• Strict sign-off requirements.

• Helps you to be perfect.

• Logic of software development is clearly understood.

• Production of a formal specification

• Better resource allocation.

• Improves quality. The emphasis on requirements and design before writing a


single line of code ensures minimal wastage of time and effort and reduces the
risk of schedule slippage.

• Less human resources required as once one phase is finished those people can
start working on to the next phase.

DEPARTMENT Of CSE , CMRIT , BENGALURU - 2


Android Based Online Voting CHAPTER

Figure 6.1: Waterfall Model

6.3 Design Using UML


Designing UML diagram specifies, how the process within the system communicates
along with how the objects with in the process collaborate using both static as well as
dynamic UML diagrams since in this ever-changing world of Object Oriented applica-
tion development, it has been getting harder and harder to develop and manage high
quality applications in reasonable amount of time. As a result of this challenge and
the need for a universal object modeling language every one could use, the Unified
Modeling Language (UML) is the Information industries version of blue print. It is a
method for describing the systems architecture in detail. Easier to build or maintains
system, and to ensure that the system will hold up to the requirement changes.

6.4 Data Flow Diagram


A data flow diagram (DFD) is graphic representation of the ”flow” of data through an
information system. A data flow diagram can also be used for the visualization of
data processing (structured design). It is common practice for a designer to draw a
context- level DFD first which shows the interaction between the system and outside
entities. DFDs show the flow of data from external entities into the system, how the
data moves from one process to another, as well as its logical storage. There are

DEPARTMENT Of CSE , CMRIT , BENGALURU - 2


Android Based Online Voting CHAPTER
only four

DEPARTMENT Of CSE , CMRIT , BENGALURU - 2


Android Based Online Voting CHAPTER
symbols: 1. Squares representing external entities, which are sources and destinations
of information entering and leaving the system. 2. Rounded rectangles representing
processes, in other methodologies, may be called ’Activities’, ’Actions’, ’Procedures’,
’Subsystems’ etc. which take data as input, do processing to it, and output it. 3.
Arrows representing the data flows, which can either, be electronic data or physical
items. It is impossible for data to flow from data store to data store except via a
process, and external entities are not allowed to access data stores directly. 4. The
flat three-sided rectangle is representing data stores should both receive information
for storing and provide it for further processing.

6.5 Class Diagram


UML class diagram shows the static structure of the model. The class diagram is a
col- lection of static modeling elements, such as classes and their relationships,
connected as a graph to each other and to their contents. The class diagram is the
main building block of object oriented modeling. It is used both for general
conceptual modeling of the systematic of the application, and for detailed modeling
translating the models into programming code. Class diagrams can also be used for
data modeling. The classes in a class diagram represent both the main objects and or
interactions in the application and the objects to be programmed.

Figure 6.2: Class Diagram Of System

DEPARTMENT Of CSE , CMRIT , BENGALURU - 2


Android Based Online Voting CHAPTER
6.6 Use Case Diagram
A use case defines a goal-oriented set of interactions between external entities and the
system under consideration. The external entities which interact with the system are
its actors. A set of use cases describe the complete functionality of the system at a
particular level of detail and it can be graphically denoted by the use case diagram.

Figure 6.3: Use Case Diagram

DEPARTMENT Of CSE , CMRIT , BENGALURU - 2


Android Based Online Voting CHAPTER
6.7 Activity Diagram
An activity diagram shows the sequence of steps that make up a complex process. An
activity is shown as a round box containing the name of the operation. An outgoing
solid arrow attached to the end of the activity symbol indicates a transition triggered
by the completion.
Activity diagram is another important diagram in UML to describe the dynamic
aspects of the system. Activity diagram is basically a flowchart to represent the flow
from one activity to another activity. The activity can be described as an operation
of the system. The control flow is drawn from one operation to another.
Activity is a particular operation of the system. Activity diagrams are not only used
for visualizing the dynamic nature of a system, but they are also used to construct
the executable system by using forward and reverse engineering techniques. The only
missing thing in the activity diagram is the message part.

Figure 6.4: Activity Diagram

DEPARTMENT Of CSE , CMRIT , BENGALURU - 2


Android Based Online Voting CHAPTER
6.8 Sequence Diagram
Sequence diagram are an easy and intuitive way of describing the behavior of a system
by viewing the interaction between the system and the environment. A sequence
diagram shows an interaction arranged in a time sequence. A sequence diagram
has two dimensions: vertical dimension represents time, the horizontal dimension
represents the objects existence during the interaction. Basic elements:

• Vertical rectangle: Represent the object is active (method is being per-


formed).

• Vertical dashed line: Represent the life of the object.

• X: represent the life end of an object. (Being destroyed from memory)

• Horizontal line with arrows: Messages from one object to another.

Figure 6.5: Sequence Diagram

DEPARTMENT Of CSE , CMRIT , BENGALURU - 3


Chapter 7

IMPLEMENTATION

30
Android Based Online Voting CHAPTER
7.1 Introduction
The implementation phase of the project is where the detailed design is actually
transformed into working code. Aim of the phase is to translate the design into a
best possible solution in a suitable programming language. This chapter covers the
implementation aspects of the project, giving details of the programming language
and development environment used. It also gives an overview of the core modules
of the project with their step by step flow. The implementation stage requires the
following tasks:

• Careful planning.

• Investigation of system and constraints.

• Design of methods to achieve the changeover.

• Evaluation of the changeover method.

• Correct decisions regarding selection of the platform.

• Appropriate selection of the language for application development.

7.2 Fingerprint Authentication


This code shows procedure for fingerprint authentication.
package com . sample ;

import android . support . v7 . app . Acti on Bar A cti vity ;


import android . speech . t t s . TextToSpeech ;
import android . support . v7 . app . Acti on Bar A cti vity ;
import android . an n otati o n . TargetApi ;
import android . app . Ac t iv it y ;
import android . app . KeyguardManager ;
import android . content . pm. PackageManager ;
import android . hardware . f i n g e r p r i n t . Fingerprint Manager ;
import android . os . Build ;
import android . s e c u r i t y . ke ys to re . KeyGenParameterSpec ;
import android . s e c u r i t y . ke ys to re . Key Permanently Invalidated Excepti on ;
import android . s e c u r i t y . ke ys to re . Key Pro perti e s ;
import android . os . Bundle ;
import android . widget . TextView ;

DEPARTMENT Of CSE , CMRIT , BENGALURU - 3


Android Based Online Voting CHAPTER
import java . i o . IOExcepti on ;
import java . s e c u r i t y . Invalid A lg or ithm Parame te r Exce pti on ;
import java . s e c u r i t y . Invalid Key Ex cepti on ;
import java . s e c u r i t y . KeyStore ;
import java . s e c u r i t y . Key Store Excepti on ;
import java . s e c u r i t y . NoSuchAlgorithmExcepti on ;
import java . s e c u r i t y . No Such Provider Excepti on ;
import java . s e c u r i t y . Unrecoverable Key Excepti on ;
import java . s e c u r i t y . c e r t . Ce r t i f i c a t e Exc e p t i o n
; import java . u t i l . Locale ;

import javax . crypto . Cipher ;


import javax . crypto . KeyGenerator ;
import javax . crypto . NoSuchPaddingExcepti on ;
import javax . crypto . SecretKey ;

import android . os . Bundle ;


import android . u t i l . Log ;
import android . view . Menu ;
import android . view . MenuItem ;

public clas s Fin g e r p r in t Ac t i v i t y extends Ac t iv it y {


private KeyStore key Store ;
Var i abl e used for s t o r in g the key in the Android Keystore c o n ta in e r
private sta ti c f in al Strin g KEY NAME = ” android Hive ” ;
private Cipher c ip h e r ;
private TextView textView ;
@TargetApi ( 23 )
@Override
protected void on Create ( Bundle s a ve d Ins tance S tate ) {
super . on Create ( s a ve d Ins t ance S tate ) ;
setContentView (R. layout . a c t i v i t y f i n g e r p r i n t ) ;

I n i t i a l i z i n g both Android Keyguard Manager and Fin g e rp r in t Manager


KeyguardManager keyguardManager = ( KeyguardManager )
get System Service (KEYGUARD SERVICE) ;
Fingerprint Manager f i n g e r p r i n t Manage r = ( Fingerprint Manager )
get System Ser vi ce (FINGERPRINT SERVICE) ;

DEPARTMENT Of CSE , CMRIT , BENGALURU - 3


Android Based Online Voting CHAPTER

textView = ( TextView ) fi nd View ById (R. id . error Text ) ;


i f ( ! f i n g e r p r i n t M anage r . is Hardware Detected ( ) ) {
textView . set Text ( ”Your Device does not have a Fin g e rp r in t Sensor ” ) ;
} else {
i f ( ! f i n g e r p r i n t M anage r . h a s En ro l l e d Fin g e rp r in t s ( ) ) {
textView . set Text ( ” Re g i s te r at l e a s t one f i n g e r p r i n tin Se t t in g s ” ) ;
} else {
// Checks whether l ock screen s e cu r i t y i s en ab led or not
i f ( ! keyguardManager . is Keyguard Secure ( ) )
textView . set Text ( ” Lock s c re e n s e c u r i t y not enabled in Se t t in g s ” ) ;
} else {
generate Key ( ) ;
if (cipherInit ()) {
Fingerprint Manager . Crypto Object crypto Object = new
Fingerprint Manager . Crypto Object ( c ip h e r ) ;
F i n g e r p r i n t H an dler h e lp e r = new F i n g e r p r i n t H an dler ( this )
; h e lp e r . start Auth ( f i nge r pri nt Manage r , crypto Object ) ;
}
}
}
}
}

@TargetApi ( Build . VERSION CODES.M)


protected void generate Key () {
try {
key Store = KeyStore . g e t In s ta n
c e ( ” AndroidKeyStore ” ) ;
} catch ( Excepti on e ) {
e . print Stack Trace ( ) ;
}

KeyGenerator key Generator ;


try {
key Generator = KeyGenerator . g e t In s ta n c e (
Key Properti es . KEY ALGORITHM AES, ” AndroidKeyStore ” ) ;
} catch ( Excepti on e ) {
throw new Runti meExcepti on

DEPARTMENT Of CSE , CMRIT , BENGALURU - 3


Android Based Online Voting CHAPTER
( ” Faile d to get KeyGenerator in s ta n c e ” , e ) ;
}
try {
key Store . load ( null ) ;
key Generator . i n i t (new
KeyGenParameterSpec . Builder (KEY NAME,
Key Properties .PURPOSE ENCRYPT |
Key Properti es .PURPOSE DECRYPT)
. s e t Blo c
kModes ( Key P rope rti es .BLOCK MODE CBC)
. set User A u t h e n ti c ati o n R equ ired ( true )
. set Encrypti on Paddings (
ke y Pro p e r t i e s . ENCRYPTION PADDING PKCS7)
. bu ild ( ) ) ;
key Generator . generate Key ( ) ;
} catch ( Excepti on e ) {
throw new Runti meExcepti on ( e ) ;
}
}

@TargetApi ( Build . VERSION CODES.M)


public boolean c i p h e r I n i t () {
try {
c ip h e r = Cipher . g e t In s ta n c e
( Key Properties . KEY ALGORITHM AES + ”/” +
Key Prope rti es .BLOCK MODE CBC + ”/” +
Key Properti es . ENCRYPTION PADDING PKCS7 ) ;
} catch ( Excepti on e ) {
throw new Runti meExcepti on
( ” Faile d to get Cipher ” , e ) ;
}

try {
key Store . load ( null ) ;
SecretKey key = ( Secret Key ) key Store . getKey (KEY NAME,
null ) ;
c ip h e r . i n i t ( Cipher .ENCRYPT MODE, key ) ;
return true ;
} catch ( Key Permanently Invalidated Excepti on e ) {

DEPARTMENT Of CSE , CMRIT , BENGALURU - 3


Android Based Online Voting CHAPTER
return f als e ;
} catch ( Excepti on e ) {
throw new Runti meExcepti on ( ” Faile d to i n i t Cipher ” , e ) ;
}
}
}

7.3 Caste Voting


This code shows procedure for Casting vote.
package com . sample ;

import java . i o . Buff ered Reader ;


import java . i o . IOExcepti on ;
import java . i o . InputStream ;
import java . i o . InputStream Reader ;
import java . lang . r e f l e c t . Array ;
import java . u t i l . Array List ;
import java . u t i l . Lis t ;
import java . u t i l . S trin g To ke n i z e r ;

import org . apache . htt p . Htt p Enti ty ;


import org . apache . htt p . Htt pResponse ;
import org . apache . htt p . NameValuePair ;
import org . apache . htt p . c l i e n t . Htt p Client ;

import org . apache . htt p . c l i e n t . methods . Htt pPost ;


import org . apache . htt p . impl . c l i e n t . Defau lt Htt p Client ;
import org . apache . htt p . message . BasicNameValuePair ;

import android . support . v7 . app . Acti on Bar A cti vity ;


import android . R. i n t e g e r ;
import android . app . Ac t i v i ty ;
import android . co ntent . Inte nt ;
import android . os . AsyncTask ;
import android . os . Bundle ;
import android . view . Menu ;

DEPARTMENT Of CSE , CMRIT , BENGALURU - 3


Android Based Online Voting CHAPTER
import android . view . MenuItem ;
import android . view . View ;
import android . widget . AdapterView ;
import android . widget . ArrayAdapter ;
import android . widget . EditText ;
import android . widget . List View ;
import android . widget . TextView ;
import android . widget . Toast ;
import android . widget . AdapterView . On Item Click Listener ;

public class User Vote extends Ac t iv it y {


TextView t 1 ;
EditText e1 ;
LoginDataBaseAdapter lbd ;
Array List <String > a l=new Array List <String >
(); List View l i s t Vie w ;
Stri n g s t r e [ ] =new Stri n g [ 1 0 0 ] ;
public Array List <String > l i s t =new Array List <String > ();
Str in g vname , vid ;
@Override
protected void on Create ( Bundle s a ve d Ins tance Sta te ) {
super . on Create ( s a ve d Ins tance S t at e ) ;
setContentView (R. layo ut . a c t i v i t y u s e r v o t e ) ;
lbd=new LoginDataBaseAdapter ( this ) ;
lbd . open ( ) ;
t 1 =(TextView ) fi ndView ById (R. id . textView 1 ) ;
// e1=( Edit Text ) f ind View By Id (R. id . edit Text 1 ) ;
l i s t Vie w =( List View ) fi ndView ById (R. id . l i s t Vie w 1 )
; Bundle e x tra s=g e t In te n t ( ) . get Extras ( ) ;
i f ( e xtr a s != null )
{
S tr in g r e s u l t=e x tra s . g e t Str in g ( ” r e s u l t ” ) ;
// t 1 . set Text ( r e s u l t ) ;
// e1 . set Text ( r e s u l t ) ;
int s i z e =5;
int s t a r t =0;
int end=s i z e ;
S tr in g s t r 3=r e s u l t . r e p l a c e A ll ( ” \\ [ ” , ”” ) ;
Str in g s tr 3 4=s t r 3 . r e p la c e All ( ” \\ ] ” , ”” ) ;

DEPARTMENT Of CSE , CMRIT , BENGALURU - 3


Android Based Online Voting CHAPTER
Str in g s t r 2 3 [ ] =new Stri n g [ 1 0 0 ]
; Str in g s t r [ ] = s t r 3 4 . s p l i t ( ” , ” )
; a l=lbd . get User ( ) ;
vname=a l . get ( 0 )
; vid=a l . get ( 1 ) ;
sObje s [ ] = l i s t . to Array ( ) ;
ArrayAdapter<String > adapter = new ArrayAdapter<String >(this ,
android . R. l ayout . s i m p l e l i s t i t e m 1 , android . R. id . text 1 , s t r )
;

l i s t Vie w . set Adapter ( adapter ) ;


l i s t Vie w . set On Item Click L is t e n e r (new On Item Click Listener () {

@Override
public void on Item Click ( AdapterView<?> parent ,
View view , int p o s i t io n , long id ) {
int i te m Po s i t io n = position ;
Str in g item Value = ( S trin g ) l i s t Vie w .
get Item At Po siti on ( p o s i t i o n ) ;
Toast . makeText ( get A p pl ic ati o n C ont ex t ( ) ,
” Po s i t io n : ”+ite m Po s i t io n+” List Item : ” +item Value ,
Toast .LENGTH SHORT) . show ( ) ;
new UserVote ( ) . execute ( vname , vid , item Value ) ;

}
} );
}
}

public class UserVote extends AsyncTask<String ,


in te g e r , String >
{
@Override
protected St rin g doInBackground ( St rin g . . . params ) {

S trin g s=postData ( params ) ;

return s ;
}

DEPARTMENT Of CSE , CMRIT , BENGALURU - 3


Android Based Online Voting CHAPTER

DEPARTMENT Of CSE , CMRIT , BENGALURU - 3


Android Based Online Voting CHAPTER
private St rin g postData ( S trin g [ ] params ) {
// TODO Auto−generated method s tub
// Toast . makeText ( AddCandidate . t h i s ,
” user date ”+params , Toast .LENGTH LONG) . show ( ) ;
Htt p Client h tt p Clie n t=new De fa ult Htt p Cl ie nt ( ) ;
Htt pPost htt p p o st = new Htt pPost
( ” htt p : // 1 9 2 . 1 6 8 . 1 0 0 . 1 9 : 8 0 8 4 // VoteSample/ UserVote
” ) ; S trin g o r igre s po ns e Te xt=”” ;
try {
List <NameValuePair> nameValuePairs =
new Array List <NameValuePair > ();
nameValuePairs . add (new BasicNameValuePair
( ”vname” , params [ 0 ] ) ) ;
nameValuePairs . add (new BasicNameValuePair
( ” vid ” , params [ 1 ] ) ) ;
nameValuePairs . add (new BasicNameValuePair
( ” vote ” , params [ 2 ] ) ) ;

h tt ppos t . s e t En t i ty (new
UrlEncodedFormEnti ty ( nameValuePairs ) ) ;
Htt pResponse response=h tt p Clie n t . execute ( htt ppost ) ;
Htt p Enti ty rp = res p o ns e . get En ti t y ( ) ;
S tri n g t=rp . to Str in g ( ) ;
o r igre s po ns e Te xt=read Content ( r e sp on se ) ;
}
catch ( Excepti on e )
{
e . print Stack Trace ( ) ;
} Stri n g response Text = o r igre s po ns e Te
xt . s u b s t r in g ( 7 , o r igre s po ns e Te xt .
l e ngth ( ) ) ;

return response Text ;


}
Str i n g read Content ( Htt pResponse r e s po ns e )
{
Str in g te xt = ”” ;
InputStream in =null ;

DEPARTMENT Of CSE , CMRIT , BENGALURU - 3


Android Based Online Voting CHAPTER
try {

DEPARTMENT Of CSE , CMRIT , BENGALURU - 4


Android Based Online Voting CHAPTER
in = r es po ns e . get En ti ty ( ) . get Content ( ) ;
Buff ered Reader reader = new
Buff ered Reader (new InputStream Reader ( in ) ) ;
Str in g Bu i ld e r sb = new Str in g Bu i ld e r ( ) ;
Str in g l i n e = null ;
while (( l i n e = r e ad e r . read Line ( ) ) != null ) {
sb . append ( l i n e + ”\n” ) ;
}
te xt = sb . to Str in g ( ) ;

}
catch ( I l l e g a l S t a t e Exc e p t i o n e ) {
e . print Stack Trace ( ) ;

} catch ( IOExcepti on e ) {
e . print Stack Trace ( ) ;
}
f inally {
try {

in . c l o s e ( ) ;
} catch ( Excepti on ex ) {
}
}

return te xt ;
@Override
protected void on PostExecute ( S trin g r e s u l t ) {
Toast . makeText ( User Vote . this , r e s u l t
, Toast .LENGTH LONG) . show ( ) ;
i f ( r e s u l t != null )
{
St rin g msg=r e s u l t ;
try {
Toast . makeText ( UserHome Acti vity . this , ” json Ob ject ”+
json Object , Toast .LENGTH SHORT) . show ( ) ;
s t a r t A c t i v i t y ( welcome ) ;

} catch ( Excepti on e ) {

DEPARTMENT Of CSE , CMRIT , BENGALURU - 4


Android Based Online Voting CHAPTER
// TODO Auto−generated catch b l ock
e . print Stack Trace ( ) ;
}
}
else
{
Toast . makeText ( User Vote . this ,
” pre s e nt no p o l l s are a v a i l a b l e
” , Toast .LENGTH SHORT) . show ( ) ;
}
}
}
}

7.4 Interfacing Android Application with Server


As we have seen,the project must consists of two ends.One is Android application
which provides interfaces for user/voter, and other is sever side which is used to
store all related information of our system.First we need to create admin activity for
the system,where admin can login,add candidate,add voters,createpoll.And as well,we
need to store the information in server,that server is created in NETBEANS IDE.The
server will be having database management system,and all the implementaion fo stor-
ing the data are need to be done.AS well it will provide retrieving the existing data
for client.The client is nothing but application user interface.Once after this main
work is done,we will be able to implement application for user.In which the user can
register himself and login to the application after the fingerprint authentication.And
the voter will caste his vote.And result calculation implement will be done.

DEPARTMENT Of CSE , CMRIT , BENGALURU - 4


Chapter 8

TESTING AND RESULTS

41
Android Based Online Voting CHAPTER
8.1 Introduction
Testing is an important phase in the development life cycle of the product this was
the phase where the error remaining from all the phases was detected. Hence testing
performs a very critical role for quality assurance and ensuring the reliability of the
software. Once the implementation is done, a test plan should be developed and run
on a given set of test data. Each test has a different purpose, all work to verify that all
the system elements have been properly integrated and perform allocated functions.
The testing process is actually carried out to make sure that the product exactly does
the same thing what is suppose to do. Testing is the final verification and validation
activity within the organization itself. In the testing stage following goals are tried to
achieve:-

• To affirm the quality of the project.

• To find and eliminate any residual errors from previous stages.

• To validate the software as the solution to the original problem.

• To provide operational reliability of the system.

During testing the major activities are concentrated on the examination and modifi-
cation of the source code. The test cases executed for this project are listed below.
Description of the test case, steps to be followed; expected result, status and screen-
shots are explained with each of the test cases.

8.2 Testing Methedologies


There are many different types of testing methods or techniques used as part of the
software testing methodology. Some of the important types of testing are:

8.2.1 White Box Testing


White Box Testing is a testing in which in which the software tester has knowledge
of the inner workings, structure and language of the software, or at least its
purpose. It is purpose. It is used to test areas that cannot be reached from a black
box level. Using white box testing we can derive test cases that:

• Guarantee that all independent paths within a module have been exercised at
least once.

• Exercise all logical decisions on their true and false sides.

DEPARTMENT Of CSE , CMRIT , BENGALURU - 4


Android Based Online Voting CHAPTER
• Execute all loops at their boundaries and within their operational bounds.

• Execute internal data structure to assure their validity.

8.2.2 Black Box Testing


Black Box Testing is testing the software without any knowledge of the inner workings,
structure or language of the module being tested. Black box tests, as most other kinds
of tests, must be written from a definitive source document, such as specification or
requirements document, such as specification or requirements document. It is a testing
in which the software under test is treated, as a black box .you cannot see into it. The
test provides inputs and responds to outputs without considering how the software
works. It uncovers a different class of errors in the following categories:

• Incorrect or missing function.

• Interface errors.

• Performance errors.

• Initialization and termination errors.

• Errors in objects.

Advantages:

• The test is unbiased as the designer and the tester are independent of each other.

• The tester does not need knowledge of any specific programming languages.

• The test is done from the point of view of the user, not the designer.

• Test cases can be designed as soon as the specifications are complete.

8.2.3 Unit Testing


Unit testing is usually conducted as part of a combined code and unit test phase of
the software lifecycle, although it is not uncommon for coding and unit testing to be
conducted as two distinct phases. Test strategy and approach
Field testing will be performed manually and functional tests will be written in detail.
Test objectives:

• All Components must work properly.

• Proper coordinates should be sent by the Android app to the Arduino

• The entry screen, messages and responses must not be delayed in the Android
app.

DEPARTMENT Of CSE , CMRIT , BENGALURU - 4


Android Based Online Voting CHAPTER
8.3 Test Case 1
Function: void adminlogin()
Purpose: This function is used for admin to sign in.
Preconditions: the internet should be connected first.
Inputs: login Credentials
Expected Outputs: Should Open The admin home page.
Postconditions: Admin Can do Various Functions.

8.4 Test Case 2


Function: void createpoll()
Purpose: This function is used to create polls by adding candidatess and voters.
Preconditions: Should be connected to Internet and Admin need to be loggedin.
Inputs: All required information of voter and candidate will be given.
Expected Outputs: A successful message on adding candidates and voter.
Postconditions: Voters are able to register themself .

8.5 Test Case 3


Function: void voterreg()
Purpose: This function is used for voter to register themself.
Preconditions: The internet connection should be there.
Inputs: Voter need to give his own credential.
Expected Outputs: He will be registered for election .
Postconditions: Voter can login and do various functions .

8.6 Test Case 4


Function: void voterlogin()
Purpose: This function is used voter to signin to the app.
Preconditions: Internet connection shhould be there and he must have registered.
Inputs: He need to give username and password and get fingerprint authentication.
Expected Outputs: He will get into The home screen.
Postconditions: He will able to see poll information and can vote.

DEPARTMENT Of CSE , CMRIT , BENGALURU - 4


Android Based Online Voting CHAPTER
8.7 Test Case 5
Function: void castevote()
Purpose: Used to caste his vote.
Preconditions: The voter should have loggedin to the app.
Inputs: The inputs are taken when he caste his vote.
Expected Outputs: The vote is casted successfully.
Postconditions: The system will generate final
result.

8.8 Images Of The Android APP

Figure 8.1: App Activities-1(Admin Activity)

DEPARTMENT Of CSE , CMRIT , BENGALURU - 4


Android Based Online Voting CHAPTER

Figure 8.2: App Activities-2(User Activity)

DEPARTMENT Of CSE , CMRIT , BENGALURU - 4


Chapter 9

CONCLUSION & FUTURE


SCOPE

47
Android Based Online Voting CHAPTER
9.1 Conclusion
This Online Voting system will manage the Voters information by which voter can
login and use his voting rights. The system will incorporate all features of Voting
system. It provides the tools for maintaining voters vote to every party and it count
total no. of votes of every party. There is a DATABASE which is maintained by the
ELECTION COMMISION OF INDIA in which all the names of voter with complete
information is stored.In this user who is above 18 years register his/her information on
the database and when he/she want to vote he/she has to login by his id and password
and can vote to any party only single time. Voting detail store in database and the
result is displayed by calculation. By online voting system percentage of voting is
increases. It decreases the cost and time of voting process. It is very easy to use and
It is vary less time consuming. It is very easy to debug.

9.2 Future Scope


This project was the first implementation of a system of this nature. We identify
that the work done both in terms of analysing and implementing the system is by no
means complete. In this section we list the things that were either left open by this
project or were opened by the analysis performed and the lessons learned during our
interaction with the subject.

9.3 Build a Complete System


The complete system can be established with a proper significance of finger print hard-
ware device.This will bring good security for the system.Since scurity issues are the
most important part of any system,We are goin with fingerprint authentication.In
ad- dition to this system we can implement same with face authentication
algorithms.But it will be difficult to make proper face matching stratgies.

9.4 Research Issues


Analyse and implement different path tracking algorithms to test their effectiveness
under different situations.Determine what is the correct defination of pathway quality
and how to measure it.Analyse how this system can update the path to be traversed
on the go.

DEPARTMENT Of CSE , CMRIT , BENGALURU - 4


Android Based Online Voting CHAPTER
9.5 Implementation Issues
We can allow system to use seperate fingerprint hardware.Implememtation procedure
involves proper fingeprint API and hardware support.We need to have good internet
connection.SDK version to be taken so that it should support fingerprint device.

DEPARTMENT Of CSE , CMRIT , BENGALURU - 4


References

[1] L. Foresti, C. S. Regazzoni, and R. Visvanathan, Scanning the issue/technolo-


gySpecial issue on video communications, processing and understanding for
third generation surveillance systems, Proc. IEEE, vol. 89, no. 10, pp. 13551367,
Oct. 2016.

[2] S.Misra,M. Reisslein, and G. Xue, A survey ofmultimedia streaming in wireless


sensor networks, IEEE Communications Surveys and Tutorials, Fourth Quarter,
vol. 10, no. 4, pp. 1839, 2015.

[3] Skinner,c.75 of young adults want to vote by SMS in the election.89 ex-
pect text voting to be introduced soon.Pcadvisor.February 18, 2010. http://
www.pcadvisor.co.uk/news/index.cfm?newsid=3213010 Accessed in Febru-
ary, 2010

[4] About Android operating system https://en.wikipedia.org/wiki/Android_


(operating_system)

[5] About Android Studio on Wikipedia https://en.wikipedia.org/wiki/


Android_Studio

[6] About fingerprint api and integration https://www.bayometric.com/


fingerprint-sdk-api-integration-phones/

[7] About Sqlite https://www.youtube.com/watcv=cp2rL3sAFmI&list=


PLS1QulWo1RIaRdy16cOzBO5Jr6kEagA07

[8] About Using fingerprint authentication, https://www.youtube.com/watch?v=


zYA5SJgWrLk

[9] To know all tool and componets of android development, https://developers.


google.com/

50

You might also like