uidai based voting application on android

107
UIDAI based voting application on ANDROID 1. INTRODUCTION The main objective of the proposed solution is to automate the voting process and activities related to voting process through Internet and mobile (android). This solution will facilitate the voters and nominees with the different modules. This solution is very much necessary for the elections in the local bodies as well as general body. Based on the user information we will send a secured number to mobile (android), using this secured number user will vote for his preferred politician city wise. 1.1 MOTIVATION Our country is the biggest democratic nation in the world where elections play a very crucial role in electing the public representatives. But in the existing system there are lots of malpractices which take place and there is no proper mechanism to stop duplication of votes, rigging and even there are chances of vulnerable voting machines to malfunction. So, considering these things, there is a scope for an alternative which provides immense security and avoid any duplication of 1

Upload: hasan41

Post on 21-Apr-2015

148 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: UIDAI Based Voting Application on ANDROID

UIDAI based voting application on ANDROID

1. INTRODUCTION

The main objective of the proposed solution is to automate the voting process and

activities related to voting process through Internet and mobile (android). This

solution will facilitate the voters and nominees with the different modules. This

solution is very much necessary for the elections in the local bodies as well as general

body. Based on the user information we will send a secured number to mobile

(android), using this secured number user will vote for his preferred politician city

wise.

1.1 MOTIVATION

Our country is the biggest democratic nation in the world where elections play a

very crucial role in electing the public representatives. But in the existing system

there are lots of malpractices which take place and there is no proper mechanism to

stop duplication of votes, rigging and even there are chances of vulnerable voting

machines to malfunction. So, considering these things, there is a scope for an

alternative which provides immense security and avoid any duplication of poles,

rigging and even providing results as early as possible.

1.2 PROBLEM DEFINITION

The problem lies in the existing system where the entire system is a manual

process. This is not secured and there are chances of rigging in the present system of

Electronic voting and even ballot box paper voting. The vulnerable voting machines

can be compromised by taking control over them using various techniques by the

experts or specialists who can modify the voting machines and manipulate the results.

This is the defect of the existing system. To overcome this, there is a need to provide

1

Page 2: UIDAI Based Voting Application on ANDROID

an alternative and a secured way by which the elections can be held without any

duplication of votes and rigging.

1.3 OBJECTIVE OF THE PROJECT

The main objective of this project is to provide an effectual mechanism by

providing a key using which only authenticated user can vote for his constituency from

anywhere in the world as the application is developed for ANDROID mobile. The

security will not be compromised in this application and the results will be out in very

less time as there won’t be any delay in this automated process.

1.4 LIMITATIONS OF THE PROJECT

People who are illiterate can’t use this application.

Every user should have an ANDROID mobile phone which might not be possible

in our country.

Every user needs to have minimum computer knowledge without which there will

be difficulty in casting their vote.

1.5 ORGANIZATION OF DOCUMENTATION

In this project documentation we have initially put the definition and objective of

the project as well as the design of the project which is followed by the implementation

and testing phases. Finally the project has been concluded successfully and also the future

enhancements of the project were given in this documentation.

2

Page 3: UIDAI Based Voting Application on ANDROID

2. LITERATURE SURVEY

2.1 INTRODUCTION

Unique identification project was initially conceived by the Planning Commission

as an initiative that would provide identification for each resident across the country and

would be used primarily as the basis for efficient delivery of welfare services. It would

also act as a tool for effective monitoring in Election system in our country (MP, MLA,

Municipal, and Panchayath), Based on the user information he will get a password to

android mobile, using this password he can vote for the election. So the election

process become much more easier for the election commission. It is very feasible to the

user as he can vote from anywhere in the world.

2.2 EXISTING SYSTEM

Present Election System is based on the Electronic voting system or ballot voitng, for

polling initially a committee verifies the persons for authentication that is purely based on

the manual system and verifies voter identity card for authentication. Developed

countries like United States of America are already using these kinds of applications

2.3 DISADVANTAGES OF EXISTING SYSTEM

Manual system

Long process for authenticating voters

There may be chance of rigging

Voting machines are vulnerable and can be tampered.

Results will be released after a long span.

Highly unsecured process

3

Page 4: UIDAI Based Voting Application on ANDROID

2.4 PROPOSED SYSTEM

The Proposed system is an automated process; Elections will be online based and

provides security for the polling by authenticating the persons based on the UIDAI

number which is provided by the government. Based on the user information we will

send a secured number to mobile (android), using this secured number user will vote for

his preferred politician city wise.

2.5 CONCLUSION

We can overcome all the drawbacks of the existing system by using this

application on ANDROID mobile. In this application the key which is generated based on

the valid user is very secure and can be used only once. This key is said to be UIDAI key.

The results can be obtained in very less time as there won’t be any delay in counting

votes in the database.

4

Page 5: UIDAI Based Voting Application on ANDROID

3. ANALYSIS

3.1 NTRODUCTION

After analyzing the requirements of the task to be performed, the next step is to

analyze the problem and understand its context. The first activity in the phase is studying

the existing system and other is to understand the requirements and domain of the new

system. Both the activities are equally important but the first activity serves as a basis of

giving the functional specifications and then successful design of the proposed system.

Understanding the properties and requirements of a new system is more difficult and

requires creative thinking as well as understanding of existing system is also difficult.

Improper understanding of present system can lead diversion from solution.

Feasibility Report

All projects are feasible – given unlimited resources and infinite time!

Unfortunately, the development of computer-based system or product is more likely

plagued by a scarcity of resources and difficult delivery dates. It is both necessary and

prudent to evaluate the feasibility of a project at the earliest possible time. Months or

years of effort, thousands or millions of dollars, and untold professional embarrassment

can be averted if an ill-conceived system is recognized early in the definition phase.

Feasibility and risk analysis are related in many ways. If project risk is great the

feasibility of producing quality software is reduced. During product engineering,

however, we concentrate our attention on four primary areas of interest:

5

Page 6: UIDAI Based Voting Application on ANDROID

Technical Feasibility

The Android SDK includes a comprehensive set of development tools.

Requirements include Java Development Kit, the officially supported integrated

development environment (IDE) is Eclipse (3.2 or later) using the Android Development

Tools (ADT) Plug in, though developers may use any text editor to edit Java and XML

files then use command line tools to create, build and debug Android applications.

Information System is developed on android platform so that it can be deployed on any

android powered mobile phone. The application uses Google Map API. The application

should be authenticated to avail maps in the project.

ANDROID Software development kit:

The Android SDK includes a comprehensive set of development tools. These

include a debugger, libraries, a handset emulator (based on QEMU), documentation,

sample code, and tutorials. Currently supported development platforms include x86-

architecture computers running Linux (any modern desktop Linux distribution), Mac OS

X 10.4.8 or later, Windows XP or Vista. Requirements also include Java Development

Kit, Apache Ant, and Python 2.2 or later. The officially supported integrated

development environment (IDE) is Eclipse (3.2 or later) using the Android Development

Tools (ADT) Plugin, though developers may use any text editor to edit Java and XML

files then use command line tools to create, build and debug Android applications.

This application in going to be used in an Internet environment called www (World

Wide Web). So, it is necessary to use a technology that is capable of providing the

networking facility to the application. This application is also able to work on distributed

environment. Application on developed with J2EE (Java 2 Enterprise Edition platform)

Technology. One major advantage in application is platform neutral. We can deploy and

used it in any operating system.

6

Page 7: UIDAI Based Voting Application on ANDROID

GUI is developed using HTML.to capture the information from the customer.

HTML is used to display the content on the browser. It uses HTTP protocol. It is an

interpreted language. It is very easy to develop a page/document using HTML some RAD

(Rapid Application Development) tools are provided to quickly design/develop our

application. So many objects such as button, text fields, and text area etc are providing to

capture the information from the customer.

We can use this application in any OS. They can have their own security and

transactional advantages. But are the responsible for selecting suitable and secured OS,

which is suitable to our application.

The back-end Mysql and front-end application are platform independent. So we

can port this enterprise application in any environment. Both are having their individual

configuration to get better performance and backup issues.

Economical Feasibility

To decide whether a project is economically feasible, we have to consider various

factors as:

Cost benefit analysis

Long-term returns

Maintenance costs

In present system voter need to go to polling booth to vote. So he/she needs to

spend some time to complete this protocol.

If it is developed to vote through internet, He can vote from anywhere in the

world. No need to travel to polling both.

7

Page 8: UIDAI Based Voting Application on ANDROID

Operational Feasibility

In our application front end is developed using GUI. So it is very easy to the voter

to enter the necessary information. But voter has some knowledge on using web

applications before going to use our application.

Analysis Model

First of all, the feasibility study is done. Once that part is over, the requirement

analysis and project planning begins. If system exists as a whole but modification and

addition of new module is needed, analysis of present system can be used as basic model.

The design starts after the requirement analysis is complete and the coding begins after

the design is complete. Once the programming is completed, the testing is done. In this

model the sequence of activities performed in a program development project are:

1. Requirement Analysis

2. Project Planning

3. System Design

4. Detail Design

5. Coding

6. Unit Testing

7. System Integration & Testing

Here the linear ordering of these activities is critical. At the end of the phase, the

output of one phase is the input to other phase. The output of each phase should be

consistent with the overall requirement of the system. Some of the qualities of spiral

model are also incorporated like after the people concerned with the project review

completion of each of the phase the work done.

Water fall Model has been chosen because all requirements were known

before and the objective of our software development is the computerization automation

of an already existing manual working system.

8

Page 9: UIDAI Based Voting Application on ANDROID

Fig: Waterfall Model

9

Page 10: UIDAI Based Voting Application on ANDROID

3.2 SOFTWARE REQUIREMENT SPECIFICATION

The main purpose of preparing this document is to give a general insight into

the analysis and requirements of the existing system or situation and for determining

the operating characteristics of the system.

This Document plays a vital role in the Software Development Life Cycle(SDLC)

and it describes the complete requirements of the system. It is meant to be used by the

developers and will be the basic concept during the testing phase. Any changes made to

the requirements in the future will have to go through formal change approval process.

3.2.1 User requirement

The user needs a complex and a very secure key (UIDAI key) that has to be

generated in the application based on the user information such as his name, address,

email-id, education and many other fields.

The user needs an application where he can login using a secure key and vote for

the politician of his choice for his constituency. The user also wants to see the results on

the mobile in a very short span of time after the election.

3.2.2 Software requirement

Web Server : Tomcat 5.5

Server-side Technologies : Java, Java Server Pages, servlets

Client-side Technologies : HTML, CSS, JAVA SCRIPT ,AJAX

IDE : Eclipse

Database Server : My SQL

10

Page 11: UIDAI Based Voting Application on ANDROID

Operating System : Windows

SDK : Android 2.2

JAVA

Java is a programming language originally developed by James Gosling at Sun

Microsystems (which has since merged into Oracle Corporation) and released in 1995 as

a core component of Sun Microsystems' Java platform. The language derives much of its

syntax from C and C++ but has a simpler object model and fewer low-level facilities.

Java applications are typically compiled to “byte code” (class file) that can run on any

Java Virtual Machine (JVM) regardless of computer architecture. Java is a general-

purpose, concurrent, class-based, object-oriented language that is specifically designed to

have as few implementation dependencies as possible. It is intended to let application

developers "write once, run anywhere" (WORA), meaning that code that runs on one

platform does not need to be recompiled to run on another. Java is currently one of the

most popular programming languages in use, particularly for client-server web

applications, with a reported 10 million users.

The original and reference implementation Java compilers, virtual machines, and

class libraries were developed by Sun from 1995. As of May 2007, in compliance with

the specifications of the Java Community Process, Sun relicensed most of its Java

technologies under the GNU General Public License. Others have also developed

alternative implementations of these Sun technologies, such as the GNU Compiler for

Java and GNU class path.

Java is related to C++, which is a direct descendent of C. Much of the

character of Java is inherited from these two languages. From C, Java derives its

syntax. Many of Java’s object-oriented features were influenced by C++. In fact,

several of Java’s defining characteristics come from or are responses to its

predecessors. Moreover, the creation of Java was deeply rooted in the process of

11

Page 12: UIDAI Based Voting Application on ANDROID

refinement and adaptation that has been occurring in computer programming

languages for the past three decades. For these reasons, this section reviews the sequence

of events and forces that led up to Java. As you will see, each innovation in language

design was driven by the need to solve a fundamental problem that the preceding

languages could not solve. Java is no exception.

The Internet helped catapult Java to the forefront of programming, and Java, in

turn, has had a profound effect on the Internet. The reason for this is quite simple: Java

expands the universe of objects that can move about freely in cyberspace. In a network,

two very broad categories of objects are transmitted between the server and your personal

computer: passive information and dynamic, active programs. Forexample, when you

read your e-mail, you are viewing passive data. Even when you download a program, the

program’s code is still only passive data until you execute it.

However, a second type of object can be transmitted to your computer: a

dynamic,

self-executing program. Such a program is an active agent on the client computer, yet is

initiated by the server. For example, a program might be provided by the server to display

properly the data that the server is sending. As desirable as dynamic, networked programs

are, they also present serious problems in the areas of security and portability. Prior to

Java, cyberspace was effectively closed to half the entities that now live there.

Java Overview

Java is a powerful but lean object-oriented programming language. It has

generated a lot of excitement because it makes it possible to program for Internet by

creating Applets. Programs that can be embedded in web page. The context of an applet

can be an animation with sound, an interactive game or a ticker tape. With constantly

updated stock prices. Applets can be just little decorations to liven up web page, or they

can be serious applications like Word processor or Spreadsheet

.

But Java is more than a programming language for writing Applets. It is being

12

Page 13: UIDAI Based Voting Application on ANDROID

used more and more for writing standalone applications as well. It is becoming so

popular that many people believe it will become standard language for both general

purpose and Internet programming.

There are many buzzwords associated with Java, but because of its spectacular

growth in popularity, a new buzzword has appeared ubiquitous. Indeed, all indications

are that it will soon be everywhere.

Java builds on the strength of C++. It has taken the best features of C++ and discarded

the more problematic and error prone parts. To this lean core, it has added garbage

collection (automatic memory management), multithreading (the capacity for one

program to do more than one thing at a time), security capabilities. This result is that Java

is simple, elegant, and powerful and easy-to-use. Java is actually a platform consisting of

3 components:

Java Programming Language.

Java Library of Classes and Interfaces.

Java Virtual Machine

Java is portable

One of the biggest advantages Java offers is that it is portable. An application

written in Java will run on all the major platforms. Any computer with a Java-based

browser can run the applications or Applets written in the Java-Programming- Language.

A programmer no longer has to write one program to run on a Macintosh, another

program to run on a windows-machine still another to run on a UNIX machine and so on.

In other words, with Java developers write their programs only once.

The Virtual Machine is what gives Java is cross platform capabilities. Rather

being compiled into machine language, which is different for each OS’s and computer

architecture, Java code is compiled into Byte codes. With other languages, the program

code is compiled into a language that the computer can understand. The problem is that

13

Page 14: UIDAI Based Voting Application on ANDROID

other computers with different machine instruction set cannot understand that language.

Java code on the other hand is compiled into Byte-Code rather than a machine language.

These byte codes go to the JVM, which executes them directly or translates them into the

language that is understood by the machine running it.

In summary, these means that with the JDBC API extending Java, a programmer

writing Java code can access all the major RDBMS on any platform that supports the

JVM.

Java is Object – oriented

The Java programming language is OBJECT-ORIENTED, which makes

program design focus on what you are dealing with, rather than on how you are going

to do something. This makes it more useful for programming in sophisticated projects,

because one can break the things into understandable components. A big benefit is

that these components can then be reused.

Object-Oriented Languages use the paradigm of classes. In simplest term, a class

includes both the data and the functions to operate on data. You can create an instance of

a class, also called an object, which will have all the data members and functionality of

its class. Because of this, you can think of a class as being like template, with each object

being a specific instance of a particular type of class.

The class paradigm allows one to encapsulate data so that specific data values are

those using the data cannot see the function implementation. Encapsulation makes it

possible to make the changes in code without breaking other programs that use that code.

If for example, the implementation of a function is changed, the change is invisible to

any programmer who invokes that function, and does not affect his/her program, except

hopefully to improve it.

Java includes inheritance, or the ability to derive new classes from existing

classes. The derived class, is also called as Sub-Class, inherits all the data in the

14

Page 15: UIDAI Based Voting Application on ANDROID

functions of the existing class. Let us discuss about the Java buzz words.

Simple

We wanted to build a system that could be programmed easily without a lot of esoteric

training and which leveraged today's standard practice. Most programmers working

these days use C and most programmers doing object-oriented programming use C++. So

even though we found that C++ was unsuitable, we designed Java as closely to C++ as

possible in order to make the system more comprehensible. Java omits many rarely used,

poorly understood, confusing features of C++ that in our experience bring more grief

than benefit. These omitted features primarily consist of operator overloading (although

the Java language does have method overloading), multiple inheritance, and extensive

automatic coercions.

We added automatic garbage collection, thereby simplifying the task of Java

programming but making the system somewhat more complicated. A common source

of complexity in many C and C++ applications is storage management: the allocation and

freeing of memory. By virtue of having automatic garbage collection (periodic freeing of

memory not being referenced) the Java language not only makes the programming task

easier, it also dramatically cuts down on bugs.

The folks at Archimedes wanted to spend their time thinking about levers and pulleys,

but instead spent a lot of time on mundane programming tasks. Their central expertise

was teaching, not programming. One of the most complicated of these programming

tasks was figuring out where memory was being wasted across their 20K lines of code.

Another aspect of being simple is being small. One of the goals of Java is to enable the

construction of software that can run stand-alone in small machines. The Java interpreter

and standard libraries have a small footprint. A small size is important for use in

embedded systems and so Java can be easily downloaded over the net.

15

Page 16: UIDAI Based Voting Application on ANDROID

Object-Oriented

This is, unfortunately, one of the most overused buzzwords in the industry. But

object-oriented design is very powerful because it facilitates the clean definition of

interfaces and makes it possible to provide reusable "software ICs." Simply stated,

object-oriented design is a technique that focuses design on the data (objects) and on the

interfaces to it. To make an analogy with carpentry, an "object-oriented" carpenter would

be mostly concerned with the chair he was building, and secondarily with the tools used

to make it; a "non-object-oriented" carpenter would think primarily of his tools. Object-

oriented design is also the mechanism for defining how modules "plug and play."

The object-oriented facilities of Java are essentially those of C++, with extensions

from Objective C for more dynamic method resolution. The folks at Archimedes had lots

of things in their simulation, among them ropes and elastic bands. In their initial C

version of the product, they ended up with a pretty big system because they had to write

separate software for describing ropes versus elastic bands. When they rewrote their

application in an object-oriented style, they found they could define one basic object that

represented the common aspects of ropes and elastic bands, and then ropes and elastic

bands were defined as variations (subclasses) of the basic type. When it came time to add

chains, it was a snap because they could build on what had been written before, rather

than writing a whole new object simulation.

Network-Savvy

Java has an extensive library of routines for coping easily with TCP/IP protocols

like TTP and FTP. This makes creating network connections much easier than in C or

C++. Java applications can open and access objects across the net via URLs with the

same ease that programmers are used to when accessing a local file system.

The folks at Archimedes initially built their stuff for CD ROM. But they had some ideas

for interactive learning games that they wanted to try out for their next product. For

example, they wanted to allow students on different computers to cooperate in building a

16

Page 17: UIDAI Based Voting Application on ANDROID

machine to be simulated. But all the networking systems they'd seen were complicated

and required esoteric software specialists. So they gave up.

RobustJava is intended for writing programs that must be reliable in a variety of ways. Java puts a

lot of emphasis on early checking for possible problems, later dynamic (runtime) checking,

and eliminating situations that are error prone. One of the advantages of a strongly typed

language (like C++) is that it allows extensive compile-time checking so bugs can be found

early. Unfortunately, C++ inherits a number of loopholes in compile-time checking from C,

which is relatively lax (particularly method/procedure declarations). In Java, we require

declarations and do not support C-style implicit declarations.

The linker understands the type system and repeats many of the type checks done by

the compiler to guard against version mismatch problems. The single biggest difference

between Java and C/C++ is that Java has a pointer model that eliminates the possibility of

overwriting memory and corrupting data. Instead of pointer arithmetic, Java has true arrays.

This allows subscript checking to be performed. In addition, it is not possible to turn an

arbitrary integer into a pointer by casting.

The folks at Archimedes had their application basically working in C pretty quickly.

But their schedule kept slipping because of all the small bugs that kept slipping through.

They had lots of trouble with memory corruption, versions out-ofsync and interface

mismatches. What they gained because C let them pull strange tricks in their code, they paid

for in quality assurance time. They also had to reissue their software after the first release

because of all the bugs that slipped through. While Java doesn't make the QA problem go

away, it does make it significantly easier.

Very dynamic languages like Lisp, TCL and Smalltalk are often used for prototyping.

One of the reasons for their success at this is that they are very robust: you don't have to

worry about freeing or corrupting memory. Java programmers can be relatively fearless about

dealing with memory because they don't have to worry about it getting corrupted. Because

there are no pointers in Java, programs can't accidentally overwrite the end of a memory

17

Page 18: UIDAI Based Voting Application on ANDROID

buffer. Java programs also cannot gain unauthorized access to memory, which could happen

in C or C++. One reason that dynamic languages are good for prototyping is that they don't

require you to pin down decisions too early. Java uses another approach to solve this

dilemma; Java forces you to make choices explicitly because it has static typing, which the

compiler enforces. Along with these choices comes a lot of assistance: you can write method

invocations and if you get something wrong, you are informed about it at compile time. You

don't have to worry about method invocation error.

Secure

Java is intended for use in networked/distributed environments. Toward that end, a lot of

emphasis has been placed on security. Java enables the construction of virus-free, tamper-free

systems. The authentication techniques are based on public key encryption. There is a strong

interplay between "robust" and "secure." For example, the changes to the semantics of

pointers make it impossible for applications to forge access to data structures or to access

private data in objects that they do not have access to. This closes the door on most activities

of viruses.

Someone wrote an interesting "patch" to the PC version of the Archimedes system.

They posted this patch to one of the major bulletin boards. Since it was easily available and

added some interesting features to the system, lots of people downloaded it. It hadn't been

checked out by the folks at Archimedes, but it seemed to work. Until the next April 1st, when

thousands of folks discovered rude pictures popping up in their children's lessons. Needless

to say, even though they were in no way responsible for the incident, the folks at Archimedes

still had a lot of damage to control.

Architecture NeutralJava was designed to support applications on networks. In general, networks

are composed of a variety of systems with a variety of CPU and operating system

architectures. To enable a Java application to execute anywhere on the network, the

compiler generates an architecture-neutral object file format--the compiled code is executable

on many processors, given the presence of the Java runtime system. This is useful not only

for networks but also for single system software distribution. In the present personal

computer market, application writers have to produce versions of their application that are

compatible with the IBM PC and with the Apple Macintosh. With the PC market (through

18

Page 19: UIDAI Based Voting Application on ANDROID

Windows/NT) diversifying into many CPU architectures, and Apple moving off the 680x0

toward the PowerPC, production of software that runs on all platforms becomes nearly

impossible. With Java, the same version of the application runs on all platforms.

The Java compiler does this by generating bytecode instructions which have

nothing to do with a particular computer architecture. Rather, they are designed to be

both easy to interpret on any machine and easily translated into native machine code

on the fly.

Archimedes is a small company. They started out producing their software for

the PC since that was the largest market. After a while, they were a large enough

company that they could afford to do a port to the Macintosh, but it was a pretty big

effort and didn't really pay off. They couldn't afford to port to the PowerPC Macintosh

or MIPS NT machine. They couldn't "catch the new wave" as it was happening, and a

competitor jumped in...

Portable

Being architecture neutral is a big chunk of being portable, but there's more to it than

that. Unlike C and C++, there are no "implementation dependent" aspects of the

specification. The sizes of the primitive data types are specified, as is the behavior of

arithmetic on them. For example, "int" always means a signed two's complement 32 bit

integer, and "float" always means a 32-bit IEEE 754 floating point number. Making these

choices is feasible in this day and age because essentially all interesting CPUs share these

characteristics. The libraries that are a part of the system define portable interfaces. For

example, there is an abstract Window class and implementations of it for Unix, Windows

NT/95, and the Macintosh. The Java system itself is quite portable. The compiler is written in

Java and the runtime is written in ANSI C with a clean portability boundary. The portability

boundary is essentially a POSIX subset.

InterpretedJava byte codes are translated on the fly to native machine instructions (interpreted)

and not stored anywhere. And since linking is a more incremental and light weight process,

19

Page 20: UIDAI Based Voting Application on ANDROID

the development process can be much more rapid and exploratory. As a part of the byte code

stream, more compile-time information is carried over and available at runtime. This is what

the linker's type checks are based on. It also makes programs more amenable to debugging.

The programmers at Archimedes spent a lot of time waiting for programs to compile

and link. They also spent a lot of time tracking down senseless bugs because some changed

source files didn't get compiled (despite using a fancy "make" facility), which caused version

mismatches; and they had to track down procedures that were declared inconsistently in

various parts of their programs. Another couple of months lost in the schedule.

High Performance

While the performance of interpreted byte codes is usually more than adequate, there

are situations where higher performance is required. The byte codes can be translated on the

fly (at runtime) into machine code for the particular CPU the application is running on. For

those accustomed to the normal design of a compiler and dynamic loader, this is somewhat

like putting the final machine code generator in the dynamic loader.

The bytecode format was designed with generating machine codes in mind, so

the actual process of generating machine code is generally simple. Efficient code is produced:

the compiler does automatic register allocation and some optimization when it produces the

bytecodes. In interpreted code we're getting about 300,000 method calls per second on an

Sun Microsystems SPARCStation 10. The performance of bytecodes converted to machine

code is almost indistinguishable from native C or C++.

When Archimedes was starting up, they did a prototype in Smalltalk. This

impressed the investors enough that they got funded, but it didn't really help them

produce their product: in order to make their simulations fast enough and the system

small enough, it had to be rewritten in C.

Multithreaded

There are many things going on at the same time in the world around us.

Multithreading is a way of building applications with multiple threads. Unfortunately, writing

programs that deal with many things happening at once can be much more difficult than

20

Page 21: UIDAI Based Voting Application on ANDROID

writing in the conventional single-threaded C and C++ style. Java has a sophisticated set of

synchronization primitives that are based on the widely used monitor and condition variable

paradigm introduced by C.A.R.Hoare By integrating these concepts into the language (rather

than only in classes) they become much easier to use and are more robust. Much of the style

of this integration came from Xerox's Cedar/Mesa system.

Other benefits of multithreading are better interactive responsiveness and real-time

behavior. This is limited, however, by the underlying platform: stand-alone Java runtime

environments have good real-time behavior. Running on top of other systems like Unix,

Windows, the Macintosh, or Windows NT limits the real-time responsiveness to that of the

underlying system. Lots of things were going on at once in their simulations. Ropes were

being pulled, wheels were turning, levers were rocking, and input from the user was being

tracked. Because they had to write all this in a single threaded form, all the things that

happen at the same time, even though they had nothing to do with each other, had to be

manually intermixed. Using an "event loop" made things a little cleaner, but it was still a

mess. The system became fragile and hard to understand. They were pulling in data from all

over the net. But originally they were doing it one chunk at a time. This serialized network

communication was very slow. When they converted to a multithreaded style, it was trivial to

overlap all of their network communication.

DynamicIn a number of ways, Java is a more dynamic language than C or C++. It was

designed to adapt to an evolving environment. For example, one major problem with C++ in

a production environment is a side-effect of the way that code is implemented. If company A

produces a class library (a library of plug and play components) and company B buys it and

uses it in their product, then if A changes its library and distributes a new release, B will most

certainly have to recompile and redistribute their own software. In an environment where the

end user gets A and B's software independently (say A is an OS vendor and B is an

application vendor) problems can result.

For example, if A distributes an upgrade to its libraries, then all of the software from

B will break. It is possible to avoid this problem in C++, but it is extraordinarily difficult and

it effectively means not using any of the language's OO features directly.

21

Page 22: UIDAI Based Voting Application on ANDROID

Archimedes built their product using the object-oriented graphics library from

3DPC Inc. 3DPC released a new version of the graphics library which several

computer manufacturers bundled with their new machines. Customers of Archimedes

that bought these new machines discovered to their dismay that their old software no

longer worked. (In real life, backwards compatibility isn't always a high priority in the

Unix world. In the PC world, 3DPC would never have released such a library: their

ability to change their product and use C++'s object oriented features is severely

hindered because they can't expect their customers to recompile.)

Java Development Environment

To code, edit, debug and test the java programs, one needs to have a java

development environment. At the minimum this will consists of a java compiler interpreter

and applet viewer where applets can be tested. Sun’s java development kit (JDK) latest

version is 2.2 can be freely downloaded from the Internet. Java compiler is available on DOS,

Win95, WIN’NT, Solaris and MAC etc. Data flow diagram is a graphical tool used to

describe analyze the movement of data through a system manual or automated including the

processes, stores of data, and delays in the system. Data flow diagrams are the central tool

and basis for form which other components are developed. The data flow diagram is also

known a data flow graph or bubble chart.

Automatic memory management

Java uses an automatic garbage collector to manage memory in the object lifecycle.

The programmer determines when objects are created, and the Java runtime is responsible

for recovering the memory once objects are no longer in use. Once no references to an object

remain, the unreachable memory becomes eligible to be freed automatically by the garbage

collector. Something similar to a memory leak may still occur if a programmer's code holds a

reference to an object that is no longer needed, typically when objects that are no longer

needed are stored in containers that are still in use. If methods for a nonexistent object are

called, a "null pointer exception" is thrown.

22

Page 23: UIDAI Based Voting Application on ANDROID

One of the ideas behind Java's automatic memory management model is that

programmers can be spared the burden of having to perform manual memory management. In

some languages, memory for the creation of objects is implicitly allocated on the stack, or

explicitly allocated and deallocated from the heap. In the latter case the responsibility of

managing memory resides with the programmer. If the program does not deallocate an

object, a memory leak occurs. If the program attempts to access or de-allocate memory that

has already been de-allocated, the result is undefined and difficult to predict, and the program

is likely to become unstable and/or crash. This can be partially remedied by the use of smart

pointers, but these add overhead and complexity. Note that garbage collection does not

prevent "logical" memory leaks, i.e. those where the memory is still referenced but never

used. Garbage collection may happen at any time. Ideally, it will occur when a program is

idle. It is guaranteed to be triggered if there is insufficient free memory on the heap to

allocate a new object; this can cause a program to stall momentarily. Explicit memory

management is not possible in Java.

Java does not support C/C++ style pointer arithmetic, where object addresses and

unsigned integers (usually long integers) can be used interchangeably. This allows the

garbage collector to relocate referenced objects and ensures type safety and security.

As in C++ and some other object-oriented languages, variables of Java's primitive

data types are not objects. Values of primitive types are either stored directly in fields (for

objects) or on the stack (for methods) rather than on the heap, as commonly true for objects

(but see Escape analysis). This was a conscious decision by Java's designers for performance

reasons. Because of this, Java was not considered to be a pure object-oriented programming

language. However, as of Java 5.0, auto boxing enables programmers to proceed as if

primitive types were instances of their wrapper class.

Java contains multiple types of garbage collectors. By default, Hot Spot uses the

Concurrent Mark Sweep collector, also known as the CMS Garbage Collector. However,

there are also several other garbage collectors that can be used to manage the Heap. For 90%

of applications in Java, the CMS Garbage Collector is good enough.

23

Page 24: UIDAI Based Voting Application on ANDROID

Java Versions

The initial release of Java was nothing short of revolutionary, but it did not

mark the end of Java’s era of rapid innovation. Unlike most other software systems

that usually settle into a pattern of small, incremental improvements, Java continued to

evolve at an explosive pace. Soon after the release of Java 1.0, the designers of Java had

already created Java 1.1. The features added by Java 1.1 were more significant and

substantial than the increase in the minor revision number would have you think. Java 1.1

added many new library elements, redefined the way events are handled by applets, and

reconfigured many features of the 1.0 library. It also deprecated (rendered obsolete)

several features originally defined by Java 1.0. Thus, Java 1.1 both added and subtracted

attributes from its original specification.

The next major release of Java was Java 2. Java 2 was a watershed event,

Marking the beginning of the “modern age” of this rapidly evolving language! The

first release of Java 2 carried the version number 1.2. It may seem odd that the first

release of Java 2 used the 1.2 version number. The reason is that it originally referred

to the version of the Java libraries, but it was generalized to refer to the entire release,

itself. Java 2 added support for a number of new features, such as Swing and the

Collections framework, and it enhanced the Java Virtual Machine and various

programming tools.

Java 2 also contained a few deprecations. The most important affected the

Thread class in which the methods suspend( ), resume( ), and stop( ) were deprecated. The

next release of Java was Java 2, version 1.3. This version of Java was the first major upgrade

to the original Java 2 release. For the most part it added to existing functionality and

“tightened up” the development environment. In general, programs written for version 1.2

and those written for version 1.3 are source-code compatible. Although version 1.3 contained

a smaller set of changes than the preceding three major releases, it was nevertheless

important. The current release of Java is Java 2, version 1.4. This release contains several

important upgrades, enhancements, and additions. For example, it adds the new keyword

assert, chained exceptions, and a channel-based I/O subsystem. It also makes changes to the

24

Page 25: UIDAI Based Voting Application on ANDROID

Collections Framework and the networking classes. In addition, numerous small changes are

made throughout. Despite the significant number of new features, version

1.4 maintains nearly 100 percent source-code compatibility with prior versions.

ANDROID

Android is a software stack for mobile devices that includes an operating system,

middleware and key applications. The android SDK provides the tools and APIs necessary to

begin developing applications on the Android platform using the Java programming language.

Features

Application framework enabling reuse and replacement of components

Dalvik virtual machine optimized for mobile devices

Integrated browser based on the open source Web Kit engine

Optimized graphics powered by a custom 2D graphics library; 3D graphics based on the

OpenGL ES 1.0 specification (hardware acceleration optional)

SQLite for structured data storage

Media support for common audio, video, and still image formats (MPEG4, H.264, MP3, AAC,

AMR, JPG, PNG, and GIF)

GSM Telephony (hardware dependent)

Bluetooth, EDGE, 3G, and Wi-Fi (hardware dependent)

Camera, GPS, compass, and accelerometer (hardware dependent)

Rich development environment including a device emulator, tools for debugging, memory and

performance profiling, and a plug in for the Eclipse IDE

Android application

Developers have full access to the same framework APIs used by the core applications.

The application architecture is designed to simplify the reuse of components; any application can

publish its capabilities and any other application may then make use of those capabilities (subject

25

Page 26: UIDAI Based Voting Application on ANDROID

to security constraints enforced by the framework). This same mechanism allows components to

be replaced by the user.

Libraries

Android includes a set of C/C++ libraries used by various components of the Android

system. These capabilities are exposed to developers through the Android application framework.

Some of the core libraries are listed below:

System C library - a BSD-derived implementation of the standard C system library (libc), tuned

for embedded Linux-based devices

Media Libraries - based on Packet Video’s Open CORE; the libraries support playback and

recording of many popular audio and video formats, as well as static image files, including

MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG

Surface Manager - manages access to the display subsystem and seamlessly composites 2D and

3D graphic layers from multiple applications

Lib Web Core - a modern web browser engine which powers both the Android browser and an

embeddable web view

SGL - the underlying 2D graphics engine

3D libraries - an implementation based on OpenGL ES 1.0 APIs; the libraries use either

hardware 3D acceleration (where available) or the included, highly optimized 3D software

rasterizer

Free Type - bitmap and vector font rendering

SQLite - a powerful and lightweight relational database engine available to all applications

Android Runtime

Android includes a set of core libraries that provides most of the functionality available in

the core libraries of the Java programming language.

Every Android application runs in its own process, with its own instance of the Dalvik

virtual machine. Dalvik has been written so that a device can run multiple VMs efficiently. The

Dalvik VM executes files in the Dalvik Executable format which is optimized for minimal

26

Page 27: UIDAI Based Voting Application on ANDROID

memory footprint. The VM is register-based, and runs classes compiled by a Java language

compiler that have been transformed into the .dex format by the included "dx" tool.

The Dalvik VM relies on the Linux kernel for underlying functionality such as threading

and low-level memory management.

An Android code editor that helps you write valid XML for your Android manifest and

resource files.

It will even export your project into a signed APK, which can be distributed to users.

To begin developing Android applications in the Eclipse IDE with ADT, you first need to

download the Eclipse IDE and then download and install the ADT plugin.

Developing in eclipse with ADT:

The Android Development Tools (ADT) plug-in for Eclipse adds powerful extensions to the Eclipse integrated development environment. It allows you to create and debug Android applications easier and faster. If you use Eclipse, the ADT plug-in gives you an incredible boost in developing Android applications:

It gives you access to other Android development tools from inside the Eclipse IDE. For

example, ADT lets you access the many capabilities of the DDMS tool: take screenshots, manage

port-forwarding, set breakpoints, and view thread and process information directly from Eclipse.

It provides a New Project Wizard, which helps you quickly create and set up all of the

basic files you'll need for a new Android application.

It automates and simplifies the process of building your Android application.

Creating an Android project

The ADT plugin provides a New Project Wizard that you can use to quickly create a new

Android project (or a project from existing code). To create a new project:

1. Select File > New > Project.

2. Select Android > Android Project, and click Next.

3. Select the contents for the project:

Enter a Project Name. This will be the name of the folder where your project is created.

27

Page 28: UIDAI Based Voting Application on ANDROID

Under Contents, select Create new project in workspace. Select your project workspace

location.

Under Target, select an Android target to be used as the project's Build Target. The Build Target

specifies which Android platform you'd like your application built against.

Unless you know that you'll be using new APIs introduced in the latest SDK, you should select a

target with the lowest platform version possible, such as Android 1.1.

Note: You can change your the Build Target for your project at any time: Right-click the

project in the Package Explorer, select Properties, select Android and then check the

desired Project Target.

Under Properties, fill in all necessary fields.

Enter an Application name. This is the human-readable title for your application — the name that

will appear on the Android device.

Enter a Package name. This is the package namespace (following the same rules as for packages

in the Java programming language) where all your source code will reside.

Select Create Activity (optional, of course, but common) and enter a name for your main Activity

class.

Enter a Min SDK Version. This is an integer that indicates the minimum API Level required to

properly run your application. Entering this here automatically sets the minSdkVersion attribute in

the <uses-sdk> of your Android Manifest file. If you're unsure of the appropriate API Level to

use, copy the API Level listed for the Build Target you selected in the Target tab.

4. Click Finish.

Once you complete the New Project Wizard, ADT creates the following folders and files

in your new project:

src/

Includes your stub Activity Java file. All other Java files for your application go here.

<Android Version>/ (e.g., Android 1.1/)

28

Page 29: UIDAI Based Voting Application on ANDROID

Includes the android.jar file that your application will build against. This is determined by

the build target that you have chosen in the New Project Wizard.

gen/

This contains the Java files generated by ADT, such as your R.java file and interfaces

created from AIDL files.

assets/

This is empty. You can use it to store raw asset files. See Resources and Assets.

res/

A folder for your application resources, such as drawable files, layout files, string values,

etc. See Resources and Assets.

AndroidManifest.xml

The Android Manifest for your project. See The AndroidManifest.xml File.

Default. Properties

This file contains project settings, such as the build target. This files is integral to the

project, as such, it should be maintained in a Source Revision Control system. It should

never be edited manually — to edit project properties, right-click the project folder and

select "Properties".

Running your application:

Before you can run your application on the Android Emulator, you must create an

Android Virtual Device (AVD). An AVD is a configuration that specifies the Android

platform to be used on the emulator. You can read more in the Android Virtual Devices

document, but if you just want to get started, follow the simple guide below to create an

AVD.

29

Page 30: UIDAI Based Voting Application on ANDROID

If you will be running your applications only on actual device hardware, you do not need

an AVD — see Developing On a Device for information on running your applicaiton.

Internet

The Internet helped catapult Java to the forefront of programming and Java in turn has had a

profound effect on the Internet. The reason is simple: Java expands the universe of objects that

can move about freely in cyberspace. In a network, there are two broad categories of objects

transmitted between the Server and your Personal Computer: passive information and dynamic,

active programs like an object that can be transmitted to your computer, which is a dynamic, self-

executing program. Such a program would be an active agent ton the client computer, yet the

server would initiate it. As desirable as dynamic, networked programs are, they also present

serious problems in the areas of security and portability. Prior to Java cyberspace was effectively

closed to half the entities that now live there. Java addresses these concerns and doing so, has

opened the door to an exiting a new form of program.

The rise of server-side Java applications is one of the latest and most exciting trends in Java

programming. It was first hyped as a language for developing elaborate client-side web content in

the form of applets. Now, Java is coming into its own as a language ideally suited for server-side

development. Businesses in particular have been quick to recognize Java’s potential on the

server-Java is inherently suited for large client/server applications. The cross platform nature of

Java is extremely useful for organizations that have a heterogeneous collection of servers running

various flavors of the Unix of Windows operating systems. Java’s modern, object-oriented,

memory-protected design allows developers to cut development cycles and increase reliability.

In addition, Java’s built-in support for networking and enterprise API provides access to legacy

data, easing the transition from older client/server systems.

Java Servlets are a key component of server-side java development. A Servlets is a small,

plug gable extension to a server that enhances the server’s functionality. Servlets allow

developers to extend and customize and Java enabled server a web server, a mail server, an

30

Page 31: UIDAI Based Voting Application on ANDROID

application server, or any custom server with a hitherto unknown degree of portability, flexibility

and ease.

JAVA SERVER PAGE (JSP)

Java Server Pages is a simple, yet powerful technology for creating and maintaining

dynamic-content web pages. Based on the Java programming language, Java Server Pages

offers proven portability, open standards, and a mature re-usable component model.

PORTABILITY

Java Server Pages files can be run on any web server or web-enabled application

server that provides support for them. Dubbed the JSP engine, this support involves

recognition, translation and management of the Java Server Pages lifecycle and its interaction

with associated components.

The JSP engine for a particular server might be built-in or might be provided through

a 3rd –party add-on. As long as the server on which you plan to execute the Java Server Pages

supports the same specification level as that to which the file was written, no change should

be necessary as you move your files from server to server. Note, however, that instructions

for the setup and configuration of the files may differ between files.

COMPOSITION

It was mentioned earlier that the Java Server Pages architecture could include

reusable Java components. The architecture also allows for the embedding of a scripting

language directly into the Java Server Pages file. The components current supported include

Java Beans and Serves. As the default scripting language, Java Server Pages use the Java

Programming language. This means that scripting on the server side can take advantage of the

full set of capabilities that the Java programming language offers.

PROCESSING

A Java Server Pages file is essentially an HTML document with JSP scripting

or tags. It may have associated components in the form of. class, .jar, or .ser files- -or

it may not. The use of components is not required.

31

Page 32: UIDAI Based Voting Application on ANDROID

Browser

Bean

JSP

Request

Response

The Java Server Pages file has a .jsp extension to identify it to the server as a

Java Server Pages file. Before the page is served, the Java Server Pages syntax is

parsed and processed into a servlet on the server side. The servlet that is generated,

outputs real content in straight HTML for responding to the customer. Because it is

standard HTML, the dynamically generated response looks no different to the

customer browser than a static response.

ACCESS MODELS: A Java Server Pages file may be accessed in at least two

different ways: A client request comes directly into a Java Server Page.

Figure1. Access Models

In this scenario, suppose the page accessed reusable Java Bean components

that perform particular well-defined computations like accessing a database. The

result of the Bean’s computations, called result sets is stored within the Bean as

properties. The page uses such Beans to generate dynamic content and present it back

to the client. A request comes through a servlet.

32

Result Bean

JDBC

Page 33: UIDAI Based Voting Application on ANDROID

Figure2. Data Transfer Processing

The servlet generates the dynamic content. To handle the response to the client, the

servlet creates a Bean and stores the dynamic content (sometimes called the result set) in the

Bean. The servlet then invokes a Java Server Page that will present the content along with the

Bean containing the generated from the servlet.

There are two APIs to support this model of request processing using Java Server

Pages. One API facilitates passing context between the invoking servlet and the Java Server

Page. The other API lets the invoking servlet specify which Java Server Page to use.

In both of the above cases, the page could also contain any valid Java code. The Java

Server Pages architecture separation of content from presentation- -it does not mandate it.

JDBC requires that the SQL statements be passed as Strings to Java methods. For

example, our application might present a menu of database tasks from which to choose. After

a task is selected, the application presents prompts and blanks for filling information needed

to carry out the selected task. With the requested input typed in, the application then

automatically invokes the necessary commands.

In this project we have implemented three-tier model, commands are sent to a

“middle tier” of services, which then send SQL statements to the database. The database

process the SQL statements and sends the results back to the middle tier, which then sends

them to the user. JDBC is important to allow database access from a Java middle tier.

JDBC

JDBC is a Java API for executing SQL statements. (As a point of interest, JDBC

is a trademarked name and is not an acronym; nevertheless, JDBC is often thought of as

standing for "Java Database Connectivity".) It consists of a set of classes and interfaces

written in the Java programming language. JDBC provides a standard API for

33

BeanRequest

Response

Database

Page 34: UIDAI Based Voting Application on ANDROID

tool/database developers and makes it possible to write database applications using a pure

Java API.

Using JDBC, it is easy to send SQL statements to virtually any relational

database. In other words, with the JDBC API, it isn't necessary to write one program to

access a Sybase database, another program to access an Oracle database, another program

to access an Informix database, and so on. One can write a single program using the

JDBC API, and the program will be able to send SQL statements to the appropriate

database. And, with an application written in the Java programming language, one also

doesn't have to worry about writing different applications to run on different platforms.

The combination of Java and JDBC lets a programmer write it once and run it anywhere.

Java being robust, secure, easy to use, easy to understand, and automatically

downloadable on a network, is an excellent language basis for database applications.

What is needed is a way for Java applications to talk to a variety of different databases.

JDBC is the mechanism for doing this.

JDBC extends what can be done in Java. For example, with Java and the JDBC

API, it is possible to publish a web page containing an applet that uses information

obtained from a remote database. Or an enterprise can use JDBC to connect all its

employees (even if they are using a conglomeration of Windows, Macintosh, and UNIX

machines) to one or more internal databases via an intranet. With more and more

programmers using the Java programming language, the need for easy database access

from Java is continuing to grow.

MIS managers like the combination of Java and JDBC because it makes

disseminating information easy and economical. Businesses can continue to use their

installed databases and access information easily even if it is stored on different database

management systems. Development time for new applications is short. Installation and

version control are greatly simplified. A programmer can write an application or an

update once, put it on the server, and everybody has access to the latest version. And for

businesses selling information services, Java and JDBC offer a better way of getting out

information updates to external customers.

34

Page 35: UIDAI Based Voting Application on ANDROID

CONNECTION

A connection object represents a connection with a database. A connection

session includes the SQL statements that are executed and the results that are returned

over the connection. A single application can have one or more connections with a

single database, or it can have connections with many different databases.

OPENING A CONNECTION

The standard way to establish a connection with a database is to call the

method DriverManager.getConnection. This method takes a string containing a URL.

The Driver Manager class, referred to a the JDBC management layer, attempts to

locate a driver than can connect to the database represented Driver classes, and when

the method get Connection is called, it checks with each driver in the list until it finds one

that can connect uses this URL to actually establish the connection.

<Sub protocol>-usually the driver or the database connectivity mechanism, which

may be supported by one or more drivers. A prominent example of a sub protocol name is

“oracle”, which has been reserved for URLs that specify “thin”-style data source names.

<Sub name>- a way to identify the database. The sub names can vary,

depending on the sub protocol, and it can have a sub name with any internal syntax

the driver writer chooses. The point of a sub name is to give enough information to

locate the database.

SENDING STATEMENT

Once a connection is established, it is used to pass SQL statements to its

underlying database. JDBC does not put any restrictions on the kinds of SQL

statements that can be sent; this provides a great deal of flexibility, allowing the use of

database-specific statements or even non-SQL statements. It requires, however, that

the user be responsible for making sure that the underlying database can process the

SQL statements being sent and suffer the consequences if it cannot.

DRIVER MANAGER

35

Page 36: UIDAI Based Voting Application on ANDROID

The Driver Manager class is the management layer of JDBC, working between

the user and the drivers. It keeps track of the drivers that are available and handles

establishing a connection between a database and the appropriate driver. It addition,

the driver manager class attends to things like driver login time limits and the printing

of log and tracing messages. The only method in this class that a general programmer

needs to use directly is DriverManager.getConnection. As its name implies, this

method establishes a connection to a database.

A JAVA2 Platform, Enterprise Edition Deployment

36

Page 37: UIDAI Based Voting Application on ANDROID

Figure 3 Java 2 Platform

3.2.3 Hardware requirements

Processor: Pentium-II (or) Higher

Ram: 512MB (or) Higher

Cache: 512MB

Hard disk: 10GB

3.3 ALGORITHM

Take the user information

Form a key based on the user information like name, date of birth ,education , location

Give it to the user

Accept the user as a valid one by comparing the information with the official data available.

User can vote using the key generated by the random number generator.

3.4 CONCLUSION

In this phase, we understand the software requirement specifications for the

project. We arrange all the required components to develop the project in this phase

itself so that we will have a clear idea regarding the requirements before designing the

project. Thus we will proceed to the design phase followed by the implementation

phase of the project.

37

Page 38: UIDAI Based Voting Application on ANDROID

4. DESIGN

4.1 INTRODUCTION

System design is transition from a user oriented document to programmers or data

base personnel. The design is a solution, how to approach to the creation of a new

system. This is composed of several steps. It provides the understanding and procedural

details necessary for implementing the system recommended in the feasibility study.

Designing goes through logical and physical stages of development, logical design

reviews the present physical system, prepare input and output specification, details of

implementation plan and prepare a logical design walkthrough.

The database tables are designed by analyzing functions involved in the

system and format of the fields is also designed. The fields in the database tables should

define their role in the system. The unnecessary fields should be avoided because it

affects the storage areas of the system. Then in the input and output screen design, the

design should be made user friendly. The menu should be precise and compact.

SOFTWARE DESIGN

In designing the software following principles are followed:

1. Modularity and partitioning: software is designed such that, each system should consists of

hierarchy of modules and serve to partition into separate function.

2. Coupling: modules should have little dependence on other modules of a system.

3. Cohesion: modules should carry out in a single processing function.

38

Page 39: UIDAI Based Voting Application on ANDROID

4. Shared use: avoid duplication by allowing a single module be called by other that need the

function it provides.

4.2 DFD AND UML DIAGRAMS

DATA FLOW DIAGRAMS

A Data Flow Diagram (DFD) is a graphical technique that depicts information flow and

the transforms that are applied as data move from input to output.

Data flow diagram is a logical model of a system. The model does not depend on

hardware, software, and data structure or file organization. It only shows the data flow between

modules to module of the entire system. Data flow diagrams can be completed using only four

notations as follows,

Data Flow Diagrams are of two types:

Physical Data Flow Diagrams

These are implementation-dependent i.e., they show the actual devices,

departments, people, etc., involved in the system.

Logical Data Flow Diagrams

These diagrams describe the system independently of how it is actually

implemented, they show what takes places, rather than how an activity is accomplished.

Data Flow

Data move in a specific direction from an origin to destination. The data flow is a

“packet” of data.

39

Page 40: UIDAI Based Voting Application on ANDROID

Process

People, procedures or devices that produce data. The physical component is not

identified.

Source or Destination of Data

External sources or destinations of data, which may be people or organizations or

other entities.

Data Source

Here a process references the data in the system

40

Page 41: UIDAI Based Voting Application on ANDROID

DFD DIAGRAMS:

(CONTEXT LEVEL-DFD)

LEVEL 1 DFD:

Request Request Send Request

Send Response Response

41

User 0.0

USER REGITRATION

Stored In DataBase

User

Mobile

Process

Web Application

Database

Page 42: UIDAI Based Voting Application on ANDROID

LEVEL 2 DFD:

Send Response

42

1. Login Process

USER

1.1

SEND MOBILE

1.2

WEB APPLICATION DATABASE

Page 43: UIDAI Based Voting Application on ANDROID

Request

Response

UML DIAGRAMS

Class diagram

Figure 4. Class Diagram for Effectual key for uidai based voting in android.

43

1. Login Process

Page 44: UIDAI Based Voting Application on ANDROID

Use Case Diagram for Android

Figure 5 Use case Diagram for Effectual key for uidai based voting in android.

44

Page 45: UIDAI Based Voting Application on ANDROID

Use Case Diagram for Administrator

Figure6. Use case for Diagram for Administrator

45

Page 46: UIDAI Based Voting Application on ANDROID

Use case Diagram for Voter

Figure7. Use case Diagram for Voter

46

Page 47: UIDAI Based Voting Application on ANDROID

Use case diagram for Nominee

Figure8. Use case Diagram for Nominee

47

Page 48: UIDAI Based Voting Application on ANDROID

Sequence diagram for Admin

Figure 9.. Sequence Diagram for Admin

48

Page 49: UIDAI Based Voting Application on ANDROID

Sequence diagram for Voter

Figure 10. Sequence Diagram for Voter

4.3 MODULE DESIGN AND ORGANIZATION

The major modules of the project are

1. Security Module

49

Page 50: UIDAI Based Voting Application on ANDROID

2 .Voter’s maintenance module

3 Nominee maintenance modules

4. Voting module

5. Result Analysis module

6. Authentication

7. Taking uidai number

8. Getting voting information

9. Vote for politician

10. Viewing results

11. Receiving secure number from android phone

1. Security Module

This module provides the security to the voting process i.e. any unauthorized person

cannot vote. Authentication of the voter is done in this module so that the voting process

is done in appropriate manner. This module authenticates the voter identity by validating

his/her details furnished. During the voter registration against the data provided by the

election authority.

2. Voter’s maintenance module

This module maintains the voter’s details such as voter id, voter name, voter division, and

voter address.

1. Registration

2. Login

3. Change password

4. Vote

3. Nominee maintenance module

This module maintains the nominee details such as nominee id, nominee name,

nominee address and party name.

50

Page 51: UIDAI Based Voting Application on ANDROID

1. Registration

2. Login

3. Select division

4. Select party

5. Logout

4. Voting module

This module maintains the hoe many voters are voted. By voter is voting to

nominee the following criteria doing as given below.

1. Login

2. Vote

3. Enter voter id

4. Select division

5. Vote

6. Logout

5. Result Analysis module

This module maintains the result view. In the module maintained the votes by the

nominee individually and give the output who is the win particular division. This

module maintained by admin only but all the people are view the result at voting

time because of it is web based system.

6. Authentication

The process of recognize the people by government by using the persons id

that person will be the authenticated person.

7. Taking uidai number

51

Page 52: UIDAI Based Voting Application on ANDROID

In this module the authenticated person will get the unique identification

authority of India (uidai) key to the android cell. The user will take the key.

8. Getting voting information

In this module the user will get the voting information about the politicians like

which politician is participating for this area what is the symbol for that politician.

9. Vote for politician

In this module by using the uidai key the user will vote the politician.

10. Viewing results

In this module the user can able to see the previous results of the politicians.

11. receiving secure number from android phone

The secure number will get in to an android cell by using that id the user will vote

the politician on internet.

DATABASE TABLES

REGISTRATION

Field Name Data Type Constraints

Vid Int(11) NOT NULL

Name VARCHAR(20) NOT NULL

Password VARCHAR(100) NOT NULL

Table4.2.1. Registration Table

Voter List

52

Page 53: UIDAI Based Voting Application on ANDROID

Field Name Data Type Constraints

id Int(!0) NOT NULL

name VARCHAR(15) NOT NULL

password VARCHAR(15) NOT NULL

f_name VARCHAR(10) NOT NULL

DoB VARCHAR(10) NOT NULL

divid VARCHAR(10) NOT NULL

address VARCHAR(10) NOT NULL

Table4.2.2. Voter List Table

NOMINEE LIST

Field Name Data Type Constraints

n id Int(!0) NOT NULL

name VARCHAR(15) NOT NULL

Partyid Int(!0) NOT NULL

divid Int(!0) NOT NULL

Address VARCHAR(15) NOT NULL

Table4.2.3. Nominee List Table

4.4 CONCLUSION

In this way we can design the layout of the project which is to be implemented

during the construction phase. Thus we will have a clear picture of the project before

being coded. Hence any necessary enhancements can be made during this phase and

53

Page 54: UIDAI Based Voting Application on ANDROID

coding can be started

5. IMPLEMENTATION AND RESULTS

5.1 INTRODUCTION

The implementation part is the most important phase of the project. In this phase,

we code the entire project in the chosen program according to the design laid during the

previous phase. The code has to be in such a way that the user requirements are satisfied

and also not complicated for the user. The code should be efficient in all terms like space,

easy to update, etc. In this manner, we can complete the coding part of the project and

later it can be sent for testing

5.2 EXPLANATION OF KEY FUNCTIONS

Generation of KEY(UIDAI )

UUID idOne = UUID.randomUUID();String hai=idOne.toString();String u=name.substring(0,3);String u5=u.toUpperCase();String u1=hai.substring(0,7);String u4=u1.toUpperCase();String u2=hai.substring(26,32);

54

Page 55: UIDAI Based Voting Application on ANDROID

String u3=u2.toUpperCase();String key=u5+u3+u4;

5.3 METHOD OF IMPLEMENTATION

The implementation of this application is majorly concerned with the generation

of effectual key for UIDAI based voting application on ANDROID. Here as you can see

the generation of this key is done by the function randomUUID();

Initially, the user will register himself and gets the key, the admin verifies wether the user

is genuine person or not and then he accepts him as genuine voter. Now, user votes using

this UIDAI key and he can also see the results.

5.3.1 Forms

There is a registration form for the user in this project. This form is has various

fields like name, password, email-id, phone number, guardian, age, date of birth, PIN

number , address ,gender etc.Using the details filled by the user on this form the random

number gets generated. The user can vote using this number after getting verified by the

admin. So, this form is crucial as some of its fields are used for generating the key on the

“ANDROID”.

5.3.2 Output Screens

This is the user Home page for Login and Registration for new user

55

Page 56: UIDAI Based Voting Application on ANDROID

If user clicks on new user the below page will be displayed

56

Page 57: UIDAI Based Voting Application on ANDROID

57

Page 58: UIDAI Based Voting Application on ANDROID

58

Page 59: UIDAI Based Voting Application on ANDROID

After clicking on registration button the below screen displayed with udai number

59

Page 60: UIDAI Based Voting Application on ANDROID

60

Page 61: UIDAI Based Voting Application on ANDROID

Admin logins in the above page

This is the home page for Admin

61

Page 62: UIDAI Based Voting Application on ANDROID

Admin can add the Divisions here

After adding the below screen displayed

62

Page 63: UIDAI Based Voting Application on ANDROID

Here admin can view the requested users who are willing to vote and he can accept or reject.

After getting the acceptance from the admin then only user can login .

63

Page 64: UIDAI Based Voting Application on ANDROID

After the user login page the below page display for new user voting

64

Page 65: UIDAI Based Voting Application on ANDROID

After clicking on the nominee name the below details for that particular nominee is displaying

65

Page 66: UIDAI Based Voting Application on ANDROID

Then new user can vote that particular person

If the user wants to vote again it will not be possible

66

Page 67: UIDAI Based Voting Application on ANDROID

When User clicks on the results the below page will be display

67

Page 68: UIDAI Based Voting Application on ANDROID

68

Page 69: UIDAI Based Voting Application on ANDROID

5.3.3 Result Analysis

Here the generation of a secured key is an important part of this

application which is done successfully in our application. Using this key user can vote

only once and there won’t be any duplication of votes or rigging in our application.

.

5.4 CONCLUSION

In this way, we have successfully implemented our project by using ANDROID

SDK and JSP. Using this application user can vote from any part of the world and can

view the results in a very less time after the results..

69

Page 70: UIDAI Based Voting Application on ANDROID

6. TESTING AND VALIDATION

6.1. INTRODUCTION

Software testing is a critical element of software quality assurance and represents

the ultimate review of specification, design and code generation. Software testing is a

process of executing given software with an intention of finding bugs in it.It is one of the

essential steps in software development life cycle. The code developed must be error free.

The code must have structural, functional simplicity. There are several testing phase such

as Unit testing, Integration testing, Validation testing, System testing.

A strategy for software testing integrates software test case design methods into a

well-planned series of steps that result in the successful construction of software. Testing

is the set of activities that can be planned in advance and conducted systematically. The

underlying motivation of program testing is to affirm software quality with methods that

can economically and effectively apply to both strategic to both large and small-scale

systems.

The following are Testing Objectives

To ensure that during operation the system will perform as per specification.

TO make sure that system meets the user requirements during operation

To make sure that during the operation, incorrect input, processing and output

will be detected

To see that when correct inputs are fed to the system the outputs are correct

To verify that the controls incorporated in the same system as intended

Testing is a process of executing a program with the intent of finding an error

A good test case is one that has a high probability of finding an as yet

undiscovered error

The software developed has been tested successfully using the following testing

strategies and any errors that are encountered are corrected and again the part of the

program or the procedure or function is put to testing until all the errors are removed.

70

Page 71: UIDAI Based Voting Application on ANDROID

A successful test is one that uncovers an as yet undiscovered error.

Note that the result of the system testing will prove that the system is working correctly.

It will give confidence to system designer, users of the system, prevent frustration during

implementation process etc.

6.2 DESIGN OF TEST CASES & SCENARIO

The objective is to design tests that systematically uncover different classes of

errors and do so with a minimum amount of time and effort. Testing cannot show the

absence of defects, it can only show that software defects are present.

White box testing

White box testing is a testing case design method that uses the control structure of

the procedure design to derive test cases. All independents path in a module are exercised

at least once, all logical decisions are exercised at once, execute all loops at boundaries

and within their operational bounds exercise internal data structure to ensure their

validity. Here the customer is given three chances to enter a valid choice out of the given

menu. After which the control exits the current menu.

Black Box Testing

Black Box Testing attempts to find errors in following areas or categories,

incorrect or missing functions, interface error, errors in data structures, performance error

and initialization and termination error. Here all the input data must match the data type

to become a valid entry.

The following are the different tests at various levels:

Unit Testing

Unit testing is essentially for the verification of the code produced during the

coding phase and the goal is test the internal logic of the module/program. In the

Generic code project, the unit testing is done during coding phase of data entry

forms whether the functions are working properly or not. In this phase all the

drivers are tested they are rightly connected or not.

71

Page 72: UIDAI Based Voting Application on ANDROID

Interface

Number of input parameters should be equal to number of arguments.

Parameter and argument attributes must match.

Parameters passed should be in correct order.

Global variable definitions consistent across module.

If module does I/O,

File attributes should be correct.

Open/Close statements must be correct.

Format specifications should match I/O statements.

Buffer Size should match record size.

Files should be opened before use.

End of file condition should be handled.

I/O errors should be handled.

Any textual errors in output information must be checked.

Local Data Structures (common source of errors!)

Improper or inconsistent typing.

Erroneous initialization or default values.

Incorrect variable names.

Inconsistent date types.

Overflow, underflow, address exceptions.

Boundary conditions and Independent paths

Error Handling

Error description unintelligible.

Error noted does not correspond to error encountered.

Error condition handled by system run-time before error handler gets

control.

Exception condition processing incorrect.

Integration Testing

72

Page 73: UIDAI Based Voting Application on ANDROID

All the tested modules are combined into sub systems, which are then tested.

The goal is to see if the modules are properly integrated, and the emphasis being on the

testing interfaces between the modules. In the generic code integration testing is done

mainly on table creation module and insertion module. Modules integrated by moving

down the program design hierarchy. Can use depth first or breadth first top down

integration verifies major control and decision points early in design process. Top-level

structure tested most. Depth first implementation allows a complete function to be

implemented, tested and demonstrated and does depth first implementation of critical

functions early. Top down integration forced (to some extent) by some development tools

in programs with graphical user interfaces. Begin construction and testing with atomic

modules (lowest level modules).Bottom up integration testing as its name implies begins

construction and testing with atomic modules. Because modules are integrated from the

bottom up, processing required for modules subordinate to a given level is always

available and the need for stubs is

eliminated.

Validation Testing

Validation testing is aims to demonstrate that the software functions in a manner that can

be reasonably expected by the customer. This tests conformance the software to the

Software Requirements Specification. This testing concentrates on confirming that the

software is error-free in all respects. All the specified validations are verified and the

software is subjected to hard-core testing. It also aims at determining the degree of

deviation that exists in the software designed from the specification; they are listed out

and are corrected

Validation Test Criteria

A set of black box test is to demonstrate conformance with requirements. To check that

all functional requirements satisfied, all performance requirements achieved,

documentation is correct and ' human-engineered', and other requirements are met (e.g.

compatibility, error recovery, and maintainability). When validation tests fail it may be

73

Page 74: UIDAI Based Voting Application on ANDROID

too late to correct the error prior to scheduled delivery. Need to negotiate a method of

resolving deficiencies with the customer.

Configuration Review

An audit to ensure that all elements of the software configuration are properly developed

catalogued and has all the necessary detail to support maintenance.

Alpha and Beta Testing

It is difficult to anticipate how users will really use software. If there is one customer, a

series of acceptance tests are conducted (by the customer) to enable the customer to

validate all requirements. If software is being developed for use by multiple customers,

cannot use acceptance testing. An alternative is to use alpha and beta testing to uncover

errors. A customer conducts alpha testing at the developer's site. The customer uses the

software with the developer 'looking over the shoulder' and recording errors and usage

problems. Alpha testing conducted in a controlled environment. Beta testing is conducted

at one or more customer sites by end users. It is ‘live’ testing in an environment not

controlled by developer. The customer records and reports difficulties and errors at

regular intervals.

System Testing

Software is only one component of a system. Software will be incorporated with other

system components and system integration and validation test performance. This testing

concentrates on confirming that the software is error-free in all respects. All the specified

validations are verified and the software is subjected to hard-core testing. It also aims at

determining the degree of deviation that exists in the software designed from the

specification; they are listed out and are corrected.

74

Page 75: UIDAI Based Voting Application on ANDROID

6.3 VALIDATION

Validation aims to demonstrate that the software functions in a manner that can be

reasonably expected by the customer. This tests conformance the software to the software

requirements Specification. Here this project has done for developing an application by

which peope can vote in a secured manner with least vulnerability.

6.4 CONCLUSION

In this way we also completed the testing phase of the project and ensured that the

application is ready to be deployed. By doing so we have developed a very secured

voting application.

75

Page 76: UIDAI Based Voting Application on ANDROID

7. CONCLUSION

By this project, we can overcome the drawbacks of the existing system of voting in elections. This project deals with the security issues like authentication of the users and approving the valid users to login based on the key that is generated in ANDROID. Hence, we can conclude that this application will be useful in conducting the elections and calculating the results.

This application can be further enhanced in the future when more number of smart phones get introduced in the market and this application can be used throughout the world. Then, people residing in foreign countries can cast their vote and enjoy their Right to Vote from any part of the world.

76

Page 77: UIDAI Based Voting Application on ANDROID

REFERENECS

Advanced Java Programming - Dietel and Dietel

Mastering JAVA 2 - John Zukowski

Java Server Programming - Apress

Software Engineering - Roger S Pressman

Análysis & Design of InformationSystems – Senn

www.android-trainer.com.

77