Android Online Voting System Thesis
Android Online Voting System Thesis
Mr. Shivaraj V B
Assistant Professor
Department of CSE, CMRIT, Bengaluru
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.
External Viva
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.
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
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
iii
References 50
iv
List of Figures
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.
vi
Chapter 1
PREAMBLE
1
Android Based Online Voting System CHAPTER 1
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.
• 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.
• Validating the system to ensure that only legible voters are allowed to vote.
• 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.
LITERATURE SURVEY
5
Android Based Online Voting System CHAPTER 2
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.
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 .
• 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-
[Link] your own devices concept introduced.
• 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.
THEORETICAL BACKGROUND
8
Android Based Online Voting System CHAPTER 3
• 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 [Link]
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
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”.
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.
SYSTEM REQUIREMENT
SPECIFICATION
13
Android Based Online Voting System CHAPTER 4
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
• 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.
• Product Requirements
• Organizational Requirements
• User Requirements
• 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.
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.
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.
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:
• Performance and related parameters: It points out the critical system parame-
ters to accomplish the mission
• Memory: 512 MB
SYSTEM ANALYSIS
19
Android Based Online Voting System CHAPTER 5
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.
• Operational Feasibility
• Economical Feasibility
• Technical Feasibility
• Social Feasibility
SYSTEM DESIGN
22
Android Based Online Voting System CHAPTER 6
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.
• 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.
• 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.
• Less human resources required as once one phase is finished those people can
start working on to the next phase.
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.
IMPLEMENTATION
30
Android Based Online Voting System CHAPTER 7
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.
import a n d r o i d . s u p p o r t . v7 . app . A c t i o n B a r A c t i v i t y ;
import a n d r o i d . s p e e c h . t t s . TextToSpeech ;
import a n d r o i d . s u p p o r t . v7 . app . A c t i o n B a r A c t i v i t y ;
import a n d r o i d . a n n o t a t i o n . TargetApi ;
import a n d r o i d . app . A c t i v i t y ;
import a n d r o i d . app . KeyguardManager ;
import a n d r o i d . c o n t e n t .pm. PackageManager ;
import a n d r o i d . hardware . f i n g e r p r i n t . F i n g e r p r i n t M a n a g e r ;
import a n d r o i d . os . B u i l d ;
import a n d r o i d . s e c u r i t y . k e y s t o r e . KeyGenParameterSpec ;
import android . s e c u r i t y . keystore . KeyPermanentlyInvalidatedException ;
import android . s e c u r i t y . keystore . KeyProperties ;
import a n d r o i d . os . Bundle ;
import a n d r o i d . widget . TextView ;
import j a v a . i o . IOException ;
import java . s e c u r i t y . InvalidAlgorithmParameterException ;
import java . s e c u r i t y . InvalidKeyException ;
import j a v a . s e c u r i t y . KeyStore ;
import j a v a . s e c u r i t y . KeyStoreException ;
import j a v a . s e c u r i t y . NoSuchAlgorithmException ;
import j a v a . s e c u r i t y . NoSuchProviderException ;
import j a v a . s e c u r i t y . UnrecoverableKeyException ;
import java . s e c u r i t y . cert . CertificateException ;
import java . u t i l . Locale ;
import j a v a x . c r y p t o . Cipher ;
import j a v a x . c r y p t o . KeyGenerator ;
import j a v a x . c r y p t o . NoSuchPaddingException ;
import j a v a x . c r y p t o . SecretKey ;
import a n d r o i d . os . Bundle ;
import a n d r o i d . u t i l . Log ;
import a n d r o i d . view . Menu ;
import a n d r o i d . view . MenuItem ;
public c l a s s F i n g e r p r i n t A c t i v i t y extends A c t i v i t y {
private KeyStore k e y S t o r e ;
V a r i a b l e used for s t o r i n g t h e key i n t he Android K e y s t o r e c o n t a i n e r
private s t a t i c f i n a l S t r i n g KEY NAME = ” a n d r o i d H i v e ” ;
private Cipher c i p h e r ;
private TextView textView ;
@TargetApi ( 2 3 )
@Override
protected void onCreate ( Bundle s a v e d I n s t a n c e S t a t e ) {
super . onCreate ( s a v e d I n s t a n c e S t a t e ) ;
setContentView (R. l a y o u t . a c t i v i t y f i n g e r p r i n t ) ;
KeyGenerator keyGenerator ;
try {
keyGenerator = KeyGenerator . g e t I n s t a n c e (
K e y P r o p e r t i e s .KEY ALGORITHM AES, ” AndroidKeyStore ” ) ;
} catch ( Exc ep tio n e ) {
throw new RuntimeException
DEPARTMENT Of CSE , CMRIT , BENGALURU - 560037 33
Android Based Online Voting System CHAPTER 7
( ” F a i l e d t o g e t KeyGenerator i n s t a n c e ” , e ) ;
}
try {
k e y S t o r e . l o a d ( null ) ;
keyGenerator . i n i t (new
KeyGenParameterSpec . B u i l d e r (KEY NAME,
K e y P r o p e r t i e s .PURPOSE ENCRYPT |
K e y P r o p e r t i e s .PURPOSE DECRYPT)
. setBloc
kModes ( K e y P r o p e r t i e s .BLOCK MODE CBC)
. s e t U s e r A u t h e n t i c a t i o n R e q u i r e d ( true )
. setEncryptionPaddings (
k e y P r o p e r t i e s . ENCRYPTION PADDING PKCS7)
. build ( ) ) ;
keyGenerator . generateKey ( ) ;
} catch ( Exc ep tio n e ) {
throw new RuntimeException ( e ) ;
}
}
try {
k e y S t o r e . l o a d ( null ) ;
SecretKey key = ( SecretKey ) k e y S t o r e . getKey (KEY NAME,
null ) ;
c i p h e r . i n i t ( Cipher .ENCRYPT MODE, key ) ;
return true ;
} catch ( K e y P e r m a n e n t l y I n v a l i d a t e d E x c e p t i o n e ) {
DEPARTMENT Of CSE , CMRIT , BENGALURU - 560037 34
Android Based Online Voting System CHAPTER 7
return f a l s e ;
} catch ( Exc ep tio n e ) {
throw new RuntimeException ( ” F a i l e d t o i n i t Cipher ” , e ) ;
}
}
}
import a n d r o i d . s u p p o r t . v7 . app . A c t i o n B a r A c t i v i t y ;
import a n d r o i d .R. i n t e g e r ;
import a n d r o i d . app . A c t i v i t y ;
import android . content . Intent ;
import a n d r o i d . os . AsyncTask ;
import a n d r o i d . os . Bundle ;
import a n d r o i d . view . Menu ;
DEPARTMENT Of CSE , CMRIT , BENGALURU - 560037 35
Android Based Online Voting System CHAPTER 7
S t r i n g s t r 2 3 [ ] =new S t r i n g [ 1 0 0 ] ;
String s t r []= str34 . s p l i t ( ” , ” ) ;
a l=l bd . g e t U s e r ( ) ;
vname=a l . g e t ( 0 ) ;
v i d=a l . g e t ( 1 ) ;
sObje s [ ] = l i s t . toArray ( ) ;
ArrayAdapter<S t r i n g > a d a p t e r = new ArrayAdapter<S t r i n g >(this ,
a n d r o i d .R. l a y o u t . s i m p l e l i s t i t e m 1 , a n d r o i d .R. i d . t e x t 1 , s t r ) ;
l i s t V i e w . setAdapter ( adapter ) ;
l i s t V i e w . s e t O n I t e m C l i c k L i s t e n e r (new OnItemClickListener () {
@Override
public void o n I t e m C l i c k ( AdapterView<?> parent ,
View view , int p o s i t i o n , long i d ) {
int i t e m P o s i t i o n = position ;
S t r i n g itemValue = ( String ) listView .
getItemAtPosition ( position ) ;
Toast . makeText ( g e t A p p l i c a t i o n C o n t e x t ( ) ,
” P o s i t i o n : ”+i t e m P o s i t i o n+” L i s t I t e m : ” +itemValue ,
Toast .LENGTH SHORT) . show ( ) ;
new UserVote ( ) . e x e c u t e ( vname , vid , itemValue ) ;
}
});
}
}
S t r i n g s=postData ( params ) ;
return s ;
}
h t t p p o s t . s e t E n t i t y (new
UrlEncodedFormEntity ( nameValuePairs ) ) ;
HttpResponse r e s p o n s e=h t t p C l i e n t . e x e c u t e ( h t t p p o s t ) ;
HttpEntity rp = r e s p o n s e . g e t E n t i t y ( ) ;
S t r i n g t=rp . t o S t r i n g ( ) ;
o r i g r e s p o n s e T e x t=readContent ( r e s p o n s e ) ;
}
catch ( Exc ep tio n e )
{
e . printStackTrace ( ) ;
} String responseText = origresponseText .
substring (7 , origresponseText . length ( ) ) ;
return r e s p o n s e T e x t ;
}
S t r i n g readContent ( HttpResponse r e s p o n s e )
{
S t r i n g t e x t = ”” ;
InputStream i n =null ;
try {
DEPARTMENT Of CSE , CMRIT , BENGALURU - 560037 38
Android Based Online Voting System CHAPTER 7
i n = r e s p o n s e . g e t E n t i t y ( ) . getContent ( ) ;
B u f f e r e d R e a d e r r e a d e r = new
B u f f e r e d R e a d e r (new InputStreamReader ( i n ) ) ;
S t r i n g B u i l d e r sb = new S t r i n g B u i l d e r ( ) ;
S t r i n g l i n e = null ;
while ( ( l i n e = r e a d e r . r e a d L i n e ( ) ) != null ) {
sb . append ( l i n e + ”\n” ) ;
}
t e x t = sb . t o S t r i n g ( ) ;
}
catch ( I l l e g a l S t a t e E x c e p t i o n e ) {
e . printStackTrace ( ) ;
} catch ( IOException e ) {
e . printStackTrace ( ) ;
}
finally {
try {
in . close ( ) ;
} catch ( Exc ep tio n ex ) {
}
}
return t e x t ;
@Override
protected void onPostExecute ( S t r i n 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 )
{
S t r i n g msg=r e s u l t ;
try {
Toast . makeText ( UserHomeActivity . this , ” j s o n O b j e c t ”+
jsonObject , Toast .LENGTH SHORT) . show ( ) ;
s t a r t A c t i v i t y ( welcome ) ;
// TODO Auto−g e n e r a t e d c a t c h b l o c k
e . printStackTrace ( ) ;
}
}
else
{
Toast . makeText ( User Vote . this ,
” p r e s e n t no p o l l s a r e a v a i l a b l e ” ,
Toast .LENGTH SHORT) . show ( ) ;
}
}
}
}
41
Android Based Online Voting System CHAPTER 8
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:-
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.
• Guarantee that all independent paths within a module have been exercised at
least once.
• Execute all loops at their boundaries and within their operational bounds.
• Interface errors.
• Performance 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.
• The entry screen, messages and responses must not be delayed in the Android
app.
DEPARTMENT Of CSE , CMRIT , BENGALURU - 560037 43
Android Based Online Voting System CHAPTER 8
47
Android Based Online Voting System CHAPTER 9
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 [Link] 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.
[3] Skinner,c.75 of young adults want to vote by SMS in the election.89 ex-
pect text voting to be introduced [Link] 18, 2010. http://
[Link]/news/[Link]?newsid=3213010 Accessed in Febru-
ary, 2010
50