• No results found

UIDAI Based Voting Application on ANDROID

N/A
N/A
Protected

Academic year: 2021

Share "UIDAI Based Voting Application on ANDROID"

Copied!
76
0
0

Loading.... (view fulltext now)

Full text

(1)

1

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

(2)

2

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.

(3)

3

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.

(4)

4

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.

(5)

5

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:

(6)

6

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.

(7)

7

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.

(8)

8

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.

(9)

9

(10)

10

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

(11)

11

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

(12)

12

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

.

(13)

13

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

(14)

14

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

(15)

15

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.

(16)

16

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

(17)

17

machine to be simulated. But all the networking systems they'd seen were complicated and required esoteric software specialists. So they gave up.

Robust

Java 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

(18)

18

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 Neutral

Java 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

(19)

19

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.

Interpreted

Java 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, the development process can be much more rapid and exploratory. As a part of the byte code

(20)

20

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 writing in the conventional single-threaded C and C++ style. Java has a sophisticated set of

(21)

21

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.

Dynamic

In 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.

(22)

22

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.

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

(23)

23

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.

Java Versions

(24)

24

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 Collections Framework and the networking classes. In addition, numerous small changes are made throughout. Despite the significant number of new features, version

(25)

25

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 to security constraints enforced by the framework). This same mechanism allows components to be replaced by the user.

(26)

26

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 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.

(27)

27

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.

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.

(28)

28

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/)

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.

(29)

29

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.

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.

(30)

30 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 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.

(31)

31 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.

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.

(32)

32

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.

Figure2. Data Transfer Processing Browser Bean JSP Request Respons e Browser Servlet Bean JSP Reques t Respons e Result Bean JDBC Databas e

(33)

33

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

(34)

34

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.

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.

(35)

35 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

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.

(36)

36

A JAVA2 Platform, Enterprise Edition Deployment

(37)

37

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.

(38)

38

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.

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

(39)

39

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.

(40)

40 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

(41)

41 DFD DIAGRAMS: (CONTEXT LEVEL-DFD) LEVEL 1 DFD:

Request Request Send Request

Send Response Response

User 0.0 USER REGITRATION Stored In DataBase User Mobile Process Web Application Database

(42)

42 LEVEL 2 DFD: Send Response Request Response 1. Login Process USER 1.1 SEND MOBILE 1.2 WEB APPLICATION DATABASE

(43)

43

UML DIAGRAMS

Class diagram

(44)

44 Use Case Diagram for Android

(45)

45 Use Case Diagram for Administrator

(46)

46 Use case Diagram for Voter

(47)

47 Use case diagram for Nominee

(48)

48 Sequence diagram for Admin

(49)

49 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

2 .Voter‘s maintenance module 3 Nominee maintenance modules 4. Voting module

5. Result Analysis module 6. Authentication

References

Related documents

Batch arrival Feedback Queue with Additional Multi Optional Service and Multiple Vacation*. Dr.(Mrs).K.Udaya Chandrika * ,

BI Market Overview.. that offer fast deployment times, and strong ROI compared to traditional BI solutions. Some BI vendors, such as SAS, are building BI-enabled solutions to

The high analytical specificity of the test, using sam- ples from individuals that tested positive, negative and indeterminate for HBsAg by ELISA demonstrates that qHBVRO PCR can

Nordisches Material unter dem Interglazial von Surheide spricht für eine entsprechende Einstufung auch dieses Interglazials.. [A middle Pleistocene interglacial deposit at

Using low-tax offshore operations, multinational companies headquartered in territorial countries reduce their METR and their METB more than do corporate groups headquartered in

Además, refiriéndose esta vez al trámite de reestructuración ha resaltado la Corte la importancia del principio de igualdad que conjuntamente con el principio del interés general