0% found this document useful (0 votes)
2 views104 pages

Information Highway Bachelor of Technolo

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 104

INFORMATION HIGHWAY

A PROJECT REPORT

Submitted by

ALTANAI BISHT (Reg No. 11807205002)

In partial fulfillment for the award of the degree


of

BACHELOR OF TECHNOLOGY
in
INFORMATION TECHNOLOGY

VEL TECH MULTI TECH Dr.RANGARAJAN Dr.SAKUNTHALA


ENGINEERING COLLEGE
CHENNAI - 600 062

ANNA UNIVERSITY​: CHENNAI 600 025


APRIL 2011
ANNA UNIVERSITY CHENNAI - 600 025

BONAFIDE CERTIFICATE

​Certified that this project report titled “​INFORMATION HIGHWAY​” ​is


the bonafide work of Ms. ALTANAI BISHT (Reg. No. 11807205002), ​who
carried out the project work under my supervision. Certified further, that to the best
of my knowledge the work reported here does not form part of any other project
report or dissertation on the basis of which a degree or award was conferred on an
earlier occasion of this or any other candidate.

SIGNATURE SIGNATURE

Mr.R.KARTHIKEYAN M.E., Mr.D.SURESH BABU M.E.,

ASSISTANT PROFESSOR/HOD ASSISTANT PROFESSOR

DEPT. INFORMATION TECHNOLOGY DEPT. INFORMATION TECHNOLOGY

VEL TECH MULTITECH VEL TECH MULTITECH

Dr.RANGARAJAN Dr.SAKUNTHALA Dr.RANGARAJAN Dr.SAKUNTHALA

ENGINEERING COLLEGE, ENGINEERING COLLEGE,

AVADI, CHENNAI-62. AVADI, CHENNAI-62.

2
CERTIFICATE OF EVALUATION

COLLEGE NAME : ​Vel Tech Multi Tech Dr.Rangarajan


Dr.Sakunthala Engineering College.
​BRANCH :​ Information Technology
SEMESTER : ​VIII

Name Of The Student Title Of The Project Name Of The Internal


Pursuing Project Guide
Mr.D.SURESH BABU
INFORMATION ASSISTANT
ALTANAI BISHT
HIGHWAY PROFESSOR
IT Dept

The report of the project work submitted by the above students in partial
fulfillment for the award of Degree of ​Bachelor of Technology in ​Information
Technology ​of ​Anna University ​was evaluated & confirmed to be a report of the
work done by the above students.
This project report was submitted for ​Viva Voice ​held on ___________ at
Vel Tech Multi Tech Dr.Rangarajan Dr.Sakunthala Engineering College.

INTERNAL EXAMINER EXTERNAL EXAMINER

3
ABSTRACT

To meet the requirements of an intelligent vehicle authentication,

management and monitoring system, the software integrates GPS( Global

positioning system) ,GSM( Global system for Mobile Communication) and

GIS(Global Information System) .

The authentication is carried out in between the vehicle and driver by

means of digital session keys ( major key and minor key ) which is generated in

server side application and supplied to vehicle and driver separately . Access is

granted if the driver enters right key and not granted access when the key entered is

wrong. Also on expiry of the session the driver needs to request for fresh sets of

keys from server again.

There is a custom random key generator process, to create

unpredictable key for every occasion. The real time vehicle monitoring is done by

interconnection between the GPS enabled mobile phone and server side application

via email service to transport the coordinates. Server displays them onto a map to

trace the location of the driver, hence the vehicle.

4
ACKNOWLEDGEMENT

Completion of this project has been a shared achievement for which we are
indebted to many people. We would like to thank our ​FOUNDER &
CHAIRMAN Dr. R. RANGARAJAN ​B.E. (Elec), B.E (Mech), M.S (Auto), Ph.D
and our ​VICE CHAIRMAN Dr. Mrs. SAKUNTHALA RANGARAJAN
M.B.B.S​ ​for providing us ambient learning experience at our Institution

We thank our ​PRINCIPAL Dr. K.SIDDAPPA NAIDU ​B.E., M.Sc, PhD,


MISTE. Who has served as an inspiration for us to perform to our institution name
and recognition. With this gratitude, we record indebtedness to our respected
HEAD OF THE DEPARTMENT Mr. R. KARTHIKEYAN M.E., Assistant
Professor, Information Technology Department for immense care and
encouragement towards us throughout the course of this project. With deep respect
we express gratitude to our ​INTERNAL GUIDE Mr. D. SURESH BABU ​M.E.,
for taking a keen interest in our project. A special thanks to our ​PROJECT
CO-ORDINATOR Mr. S.NEELAKANDAN ​M.E​., Assistant Professor,
Information Technology Department for his extremely valuable guidance and
support throughout the course of the project.

I express my heart-felt gratitude to our ​EXTERNAL GUIDE Mr. GIRISH


SRIVASTAVA BTech​., APPLICATION DEVELOPER, HP ​for the interest
shown by them in this project and for having extended their impartial suggestions.

5
Table of Contents

CHAPTER TITLE PAGE NUMBER

CHAPTER ​INTRODUCTION 10

CHAPTER 2​ ​SYSTEM DESCRIPTION 11

CHAPTER 3​ ​SOFTWARE DESCRIPTION 13

3.1.3 Multithreading 17

3.1.4 Swing 17

3.5.2 MYSQL DATABASE 28

CHAPTER 4​ ​SYSTEM ARCHITECTURE 30

CHAPTER 5​ ​MODULE DESCRIPTION 44

5.1 Bohem’s SPIRAL Software Development Life Cycle Model 48

5.2 Analysis 48

5.3 Design 48

5.4 Coding 49

5.5 Testing 49

CHAPTER 6​ ​TESTING 50

CHAPTER 7​ ​CONCLUSION 60

CHAPTER 8​ ​APPENDIX 61

8.1 Coding 61

8.2. Screen Shots 85

9. References 108

6
List of Figures

CHAPTER TITLE PAGE NUMBER

3.1 Architecture 19
4.1 Class Diagram 21
4.2 Activity diagram 22
4.3 Sequence Diagram 24
4.4 Use-case diagram 27
5.1 Life Cycle Model 34

7
CHAPTER 1

INTRODUCTION
1.1 About the Project

It is about time to harness computer and communication technologies to


support intelligent transportation infrastructure.

This project aims to harness computer and communication technologies to


support vehicular infrastructure control, driver – vehicle authentication and

​ he system of interconnection
significantly tracking the vehicle movement. T

between the vehicle, driver and server enables the most tedious process of
conveyance of information, management of distances /fares/services as well as
surveillance to become computerized

1.2 Literature Survey

To cope with increasing vehicle thefts and unavailability of a proper channel


of communication. This system also solves the problem of tracking and renting a
vehicle safely with as little cost as possible, involved. It connects the driver’s cell,
the vehicle based GSM/Bluetooth system and the administrator in the client
server network. It replaces the physical vehicular keys by mobile phone generated
session keys.

8
Also enabling the effective tracking of vehicle movement via GSM based
BTS (base transceiver station monitoring) and transmitting critical data through
net to vehicle via server administrator.

9
CHAPTER 2

SYSTEM DESCRIPTION

2.1 Existing System


There is hardly any computerization for transport facilities available. A lot
of money is expended on oral mobile communication and the driver uses a physical
metallic key to initiate the mechanism of the vehicle.

Limitation of existing system:

1. Driver might lose the key.


2. Key might fall into the wrong hands.
3. Difficult to replace a key.
4. Number of duplicate keys can be produced.

2.2 Proposed System


Random key generation to provide session key based authentication, via
vehicle to driver bluetooth connection. Driver to server communication by
emailing and tracking with the help of GPS coordinates extracted from phone,
communicated to server through email and displayed on google map service.
Hence intelligently managing, controlling, tracking and monitoring the vehicles
and associated users.

2.3 Software Requirements

10
● Glassfish Web Server
● Windows XP/vista/7
● Symbian OS in Mobile
● SQL Server
● Bluetooth
● Internet connection

2.4 Hardware Requirements

● Processor(P-IV)
● RAM (above 256MB)
● Keyboard
● VGA Card
● Mobile phone with driver
● Recycled mobile phone in vehicle

11
CHAPTER 3

SOFTWARE DESCRIPTION

3.1 Java
3.1.1 Introduction
Java is a high-level, third generation programming language, like C,
FORTRAN, Smalltalk, Perl, and many others. You can use Java to write computer
applications that crunch numbers, process words, play games, store data or do any
of the thousands of other things computer software can do. Compared to other
programming languages, Java is most similar to C. However although Java shares
much of C's syntax, it is not C. Knowing how to program in C or, better yet, C++,
will certainly help you to learn Java more quickly, but you don't need to know C to
learn Java. Unlike C++ Java is not a superset of C. A Java compiler won't compile
C code, and most large C programs need to be changed substantially before they
can become Java programs.

What's most special about Java in relation to other programming languages


is that it lets you write special programs called applets that can be downloaded
from the Internet and played safely within a web browser. Traditional computer
programs have far too much access to your system to be downloaded and executed
willy-nilly. Although you generally trust the maintainers of various ftp archives
and bulletin boards to do basic virus checking and not to post destructive software,
a lot still slips through the cracks. Even more dangerous software would be
promulgated if any web page you visited could run programs on your system. You

12
have no way of checking these programs for bugs or for out-and-out malicious
behavior.

Before downloading and running them. Java solves this problem by severely
restricting what an applet can do. A Java applet cannot write to your hard disk
without your permission. It cannot write to arbitrary addresses in memory and
thereby introduce a virus into your computer. It should not crash your system.

Object oriented programming is the catch phrase of computer


programming in the 1990's. Although object oriented programming has been
around in one form or another since the Simula language was invented in the
1960's, it's really begun to take hold in modern GUI environments like Windows,
Motif and the Mac. In object-oriented programs data is represented by objects.
Objects have two sections, fields (instance variables) and methods. Fields tell you
what an object is. Methods tell you what an object does. These fields and methods
are closely tied to the object's real world characteristics and behavior. When a
program is run messages are passed back and forth between objects. When an
object receives a message it responds accordingly as defined by its methods.

3.1.2 Features of java


Object oriented programming has a number of advantages including:

● Simpler, easier to read programs


● More efficient reuse of code
● Faster time to market
● More robust, error-free code

13
Java is inherently multi-threaded. A single Java program can have many
different threads executing independently and continuously. Three Java applets on
the same page can run together with each getting equal time from the CPU with
very little extra effort on the part of the programmer. This makes Java very
responsive to user input. It also helps to contribute to Java's robustness and
provides a mechanism whereby the Java environment can ensure that a malicious
applet doesn't steal all of the host's CPU cycles. fortunately multithreading is so
tightly integrated with Java, that it makes Java rather difficult to port to
architectures like Windows 3.1 or the PowerMac that don't natively support
preemptive multi-threading. There is a cost associated with multi-threading.

Multi-threading is to Java what pointer arithmetic is to C, that is, a source of


devilishly hard to find bugs. Nonetheless, in simple programs it's possible to leave
multi-threading alone and normally be OK. You do not need to explicitly allocate
or reallocate memory in Java. Memory is allocated as needed, both on the stack
and the heap, and reclaimed by the garbage collector when it is no longer needed.
There's no malloc(), free(), or destructor methods.

There are constructors and these do allocate memory on the heap, but this is
transparent to the programmer. The exact algorithm used for garbage collection
varies from one virtual machine to the next. The most common approach in
modern VMs is generational garbage collection for short-lived objects, followed by
mark and sweep for longer lived objects.

The application was developed by java because of following features.

1. Java is a graphical user interface programming language.


2. Java supports to platform independent mechanism.

14
3. Java is a general purpose and object oriented programming language.
4. The most striking features of the language are thatplatform neural
language.
5. Java can be called as a revolutionary technology because it has brought
in a fundamental shift in how we develop and use programs.
6. Java program is under the control of JVM; the JVM can contain the
program and prevent it from generating side effects outside the system. Thus
safety is included in Java language.
The internal helped catapult have to the forefront of programming. It can be
used to develop both application and applet programs. Java is mainly adopted for
two reasons.

1. Security
2. Portability
These two features are available in java because of the byte code. Byte code
is a highly optimized set of instructions to be executed by the Java run time system
called JVM..Some of the features of Java which are adopted for the network
system explore are

● Multithreading
● Socket programming
● Swing

15
3.1.3 Multithreading

Users perceive that their world is full of multiple events all happenings at
once and wants their computers to do the same. Unfortunately, writing programs
that deal with many things at once can be much more difficult than writing
conventional single threaded programs in C or C++. Thread safe in multithreading
means that a given library functions is implemented concurrent threads of
execution.

3.1.4 Swing

Swing refers to the new library of GUI controls (buttons, sliders, checkboxes
etc) that replaces the somewhat weak and inflexible AWT controls. Swing is a
rapid GUI development tool that is part of the standard Java development kit. It
was primarily developed due to the shortcomings of the Abstract Windows Toolkit.
Swing is a set of classes that provides more powerful and flexible components than
AWT. Swing components are not implemented by platform specific code. Instead
they are written in Java and therefore are platform independent. The term
lightweight is used to describe such elements. In addition, all Swing components
support assertive technologies. Swing is important to develop Java programs with a
graphical user interface (GUI). There are many components which are used for the
building of GUI in Swing. The Swing Toolkit consists of many components for the
building of GUI. These components are also helpful in providing interactivity to
Java applications.

16
Following are components which are included in Swing toolkit:

1. List controls

2. Buttons

3. Labels

4. Tree controls

5. Table controls

All AWT flexible components can be handled by the Java Swing.


Swing toolkit contains far more components than the simple component toolkit. It
is unique to any other toolkit in the way that it supports integrated
internationalization, a highly customizable text package, rich undo support etc. Not
only can this have you also created your own look and feel using Swing other than
the ones that are supported by it. The customized look and feel can be created
using Synth which is specially designed. Not to forget that Swing also contains the
basic user interface such as customizable painting, event handling, drag and drop
etc , to make the GUI even more dynamic and interactive to the end user who
works with them.

The Java Foundation Classes (JFC) which supports many more features
important to a GUI program comprises of Swing as well. The features which are
supported by Java Foundation Classes (JFC) are the ability to create a program that
can work in different languages.

3.2 NetBeans
3.2.1 Introduction

17
A Java-based development environment (IDE) and platform originally
developed by Sun. It includes user interface functions, source code editor, GUI
editor, version control as well as support for distributed applications (CORBA,
RMI, etc.) and Web applications(JSPs,servlets,etc.).
In 1999, Sun acquired NetBeans Developer from NetBeans and rebranded it as
Forte for Java Community Edition (Sun acquired Forte in 1999). In 2000, Sun
made the NetBeans IDE open source.

Traditionally, when creating editor support for a new programming


language in the IDE, a vast variety of NetBeans APIs must be implemented. By
“editor support”, we typically mean syntax coloring, code completion, and the
source navigation features provided by the IDE’s Navigator. Other examples
include code indentation and brace matching. Out of the box, the NetBeans IDE
provides this kind of support for several languages and technologies, such as Java
(of course), JSP, and HTML.

There are many NetBeans APIs that one needs to implement to provide
editor support for a programming language. This is unfortunate for two reasons.
Firstly, the domain knowledge that a language programmer typically brings to the
table is the language itself, not the versatile knowledge of the NetBeans APIs
required to provide the necessary features. Secondly, the underlying infrastructure
for editor support is the same for all languages. For example, the only difference
between the Navigator for Java and the Navigator for HTML is the actual code, not
the container. For these reasons, the language programmer should only need to
provide the ​content of the language in the form of ​tokens ​that are communicated in
regular expressions.

18
Given the tokens and an indication of where they should be used, the
NetBeans Platform should be able to figure out how to hook the tokens to the
support features. Not only would this approach simplify the process of integrating
a new language into the IDE, but it would leverage the ​current knowledge of the
language programmer – rather than requiring a steep learning curve of acquiring
new knowledge before coding can even begin.

Enter Schliemann

This, in sum, is what the new Schliemann project (​languages. netbeans.org​)


is all about.Heinrich Schliemann was a 19th century explorer who had a gift for
languages. He traveled the world while keeping a diary in the language of the
country he happened to be in. In the spirit of Schliemann, the 6.0 release of the
NetBeans Platform envisages the IDE as being Schliemannesque, able to pick up
languages very quickly and then being able to communicate in them fluently.

The project is especially pitched towards ​scripting languages, because the


Schliemann project does not provide compilation support, which is not required by
scripting languages – and because scripting languages, in particular, are
increasingly in vogue today. ​In this article, we will explore the main facets of the
Schliemann project and touch on some contrasts with the traditional NetBeans API
approach to providing the editor features it supports.

Everything in a single file!

A central contrast between the traditional API approach and the Schliemann
approach is that the latter lets you specify all editor features declaratively in one

19
single file. This file has the ​.NBS ​file extension, which stands for NetBeans
Scripting.

This template is what you are given when you use the new Generic
Languages Framework wizard, which is part of NetBeans IDE 6.0. It gives you a
single NBS file with sample content, which begins with the definition of four
tokens. These tokens are named “keyword”, “operator”, “identifier” and
“whitespace”. Within brackets, in the same line as the name of the tokens, a regular
expression is used to define them.

Right away, one can see the power of this new approach to language support
provision: a regular expression language, rather than Java, is used to define tokens.
As a result, programmers outside the Java ecosystem can integrate their
programming languages into the NetBeans IDE. Not needing to know Java, at least
for the simpler integrations of languages, is a central benefit of the Schliemann
project.

Once tokens are defined, one can already begin assigning features. For
example, this single statement would fill the Navigator with the values provided by
the “keyword” token:

Navigator :keyword

Readers who are familiar with the NetBeans Navigator API can only be
amazed at this drastic simplification! However, normally you would like more
robust support for a language and to provide grammar in addition to tokens. The
grammar that the Schliemann approach requires is also highly simplified. It is

20
comparable to JavaCC or AntLR. Ideally, one would wish that the grammar
provided by JavaCC and AntLR could be directly integrated into NetBeans IDE.
Unfortunately, however, these grammars are not tailored to usage within an IDE.
For this reason, a conversion process needs to take place, from AntLR or JavaCC
(or from a similar approach) to the Schliemann NBS format. Early experiments
have shown that both a manual and an automatic solution for this process is
feasible. However, this aspect of the Schliemann project is definitely the area
where most work needs to be done.

A unified, simple approach to integrating grammars provided by AntLR,


JavaCC, and the like, is needed in order for the Schliemann project to reach its full
potential.

In the NBS code shown before, you can see, in addition to the tokens, that
the grammar forms the basis of both the Navigator implementation and the code
folding implementation. In the case of code folding, the Block grammar definition
determines each code fold, while the Navigator is populated by values conforming
to the While Statement definition.

Finally, notice that the code also shows how brace completion and
indentation is defined, all within the same single file, and that one can fine-tune
further by specifying that white space should be skipped by the parser.

Hence, when the NBS file is associated with a MIME type, documents
corresponding to the MIME type immediately have the following features:

● Syntax coloring
● Navigator

21
● Code folding
● Brace matching
● Indentation

In similar ways, a wide range of other language-support features can be


created, including code completion, which is frequently very high up on the list of
features that language programmers want to provide support for.

3.2.2 Netbeans Platform

The ​NetBeans Platform is a reusable ​framework for simplifying the development


of Java Swing desktop applications. The NetBeans IDE bundle for Java SE
contains what is needed to start developing NetBeans plugins and NetBeans
Platform based applications; no additional SDK is required.

Applications can install modules dynamically. Any application can include


the Update Center module to allow users of the application to download
digitally-signed upgrades and new features directly into the running application.
Reinstalling an upgrade or a new release does not force users to download the
entire application again.

The platform offers reusable services common to desktop applications, allowing


developers to focus on the logic specific to their application. Among the features of
the platform are:

● User interface management (e.g. menus and toolbars)


● User settings management
● Storage management (saving and loading any kind of data)
● Window management
22
● Wizard framework (supports step-by-step dialogs)
● NetBeans Visual Library

3.2.3 Netbeans IDE

The ​NetBeans IDE is an ​open-source integrated development environment.


NetBeans IDE supports development of all Java application types (​Java SE
including JavaFX, (​Java ME​, ​web​, ​EJB and ​mobile applications) out of the box.
Among other features are an ​Ant​-based project system, Maven support,
refactorings​, ​version control (supporting ​CVS​, ​Subversion​, ​Mercurial and
Clearcase​).

Modularity​: All the functions of the IDE are provided by modules. Each
module provides a well defined function, such as support for the ​Java language​,
editing, or support for the ​CVS versioning system, and SVN. NetBeans contains all
the modules needed for Java development in a single download, allowing the user
to start working immediately. New features, such as support for other
programming languages, can be added by installing additional modules. For
instance, ​Sun Studio​, Sun Java Studio Enterprise, and ​Sun Java Studio Creator
from ​Sun Microsystems​ are all based on the NetBeans IDE.

3.3 Glassfish Server


3.3.1 Introduction
In June 2005, Sun launched the GlassFish project, an action that opened to
the Java community the development of an application server that will be
compliant with ​Java Platform, Enterprise Edition (Java EE) 5​.

23
GlassFish is an open source ​application server project led by ​Sun
Microsystems for the ​Java EE platform. The proprietary version is called ​Sun
GlassFish Enterprise Server​. GlassFish is ​free software​, ​dual-licensed under two
free software licences​: the ​Common Development and Distribution License
(CDDL) and the ​GNU General Public License​ (GPL) with the ​classpath exception​.

GlassFish is based on ​source code released by Sun and ​Oracle Corporation​'s


TopLink ​persistence system. It uses a derivative of ​Apache Tomcat as the ​servlet
container for serving Web content, with an added component called ​Grizzly which
uses ​Java NIO​ for scalability and speed.

A project. The GlassFish project is a structured environment for developing


the open source application server. The establishment of the GlassFish project is
part of a larger effort by Sun to release major portions of its code into open source
for use and improvement by the community. The GlassFish project is one of a
variety of community-based ​projects hosted on java.net​.

An open source application server. This is what the GlassFish


community is building within the GlassFish project. The open source application
server is based on the source code for Sun Java System Application Server
Platform Edition 9, donated by Sun Microsystems, and on source code for
TopLink, a Java object-to-relational persistence architecture, donated by Oracle.

3.4 JavaEE and Glassfish


GlassFish puts a free, open source, commercial-grade implementation of
Java EE 5 in the hands of the community -- and puts it there early. Think about
what benefits this might have for you. If you develop enterprise Java applications,

24
being a GlassFish community member gives you an early opportunity to develop
those applications and test them for conformance to Java EE 5. Note that
conformance to Java EE 5 cannot be assured until the ​Java EE 5 specifications are
final.

If you maintain enterprise Java applications, you can get an early start
in migrating to Java EE 5. You can also get an early look at some of the new
features in Java EE 5, such as the new Java Persistence API, the enhanced mapping
capabilities in Java Architecture for XML Binding (JAXB) 2.0, the simplified
interface for web services development in the Java API for XML Web Services
(JAX-WS ) 2.0, as well as the ease-of-development improvements in Enterprise
JavaBeans 3.0 technology. You can try out some of the new features in
applications that you deploy to the GlassFish application server.

Many developers see the GlassFish application server as the superior


solution for developing and deploying JRuby-on-Rails applications chiefly due to
the following advantages:

● You can develop in the same environment in which you deploy.


● You can deploy multiple applications in a GlassFish instance that is already
running.
● GlassFish can handle multiple requests by maintaining JRuby runtimes and
database connections in pools.
● Clustering and high availability are integrated into GlassFish v2.

25
● GlassFish leverages existing investment in the ​Java Platform, Enterprise
Edition (Java EE) while hosting JRuby-on-Rails applications in the same
environment.

3.5 MYSQL
3.5.1 FEATURES OF MYSQL

MySQL is a relational database management system (RDBMS) which has


more than 11 million installations. The program runs as a server providing
multi-user access to a number of databases. MySQL is owned and sponsored by a
single for-profit firm, the Swedish company MySQL AB, now a subsidiary of Sun
Microsystems, which holds the copyright to most of the code base. The project's
source code is available under terms of the GNU General Public License, as well
as under a variety of proprietary agreements. It is currently the most popular open
source database server in existence. On top of that, it is very commonly used in
conjunction with PHP scripts to create powerful and dynamic server-side
applications. MySQL has been criticized in the past for not supporting all the
features of other popular and more expensive DataBase Management Systems.
However, MySQL continues to improve with each release (currently version 5),
and it has become widely popular with individuals and businesses of many
different sizes.

A database is a structure that comes in two flavors: a flat database and a


relational database. A relational database is much more oriented to the human mind

26
and is often preferred over the gabble-de-gook flat databases that are just stored on
hard drives like a text file. MySQL is a relational database.

In a relational structured database there are tables that store data. The
columns define which kinds of information will be stored in the table. An
individual column must be created for each type of data you wish to store (i.e. Age,
Weight, Height).

3.5.2 MYSQL DATABASE

MySQL is a fast, easy-to-use RDBMS used for many small and big
businesses. MySQL is developed, marketed, and supported by MySQL AB, which
is a Swedish company. MySQL is becoming so popular because of many good
reasons.

● MySQL is released under an open-source license. So you have nothing to


pay to use it.
● MySQL is a very powerful program in its own right. It handles a large subset
of the functionality of the most expensive and powerful database packages.
● MySQL uses a standard form of the well-known SQL data language.
● MySQL works on many operating systems and with many languages
including PHP, PERL, C, C++, JAVA etc.
● MySQL works very quickly and works well even with large data sets.
● MySQL is very friendly to PHP, the most appreciated language for web
development.
● MySQL supports large databases, up to 50 million rows or more in a table.
The default file size limit for a table is 4GB, but you can increase this (if

27
your operating system can handle it) to a theoretical limit of 8 million
terabytes (TB).
● MySQL is customizable. The open source GPL license allows programmers
to modify the MySQL software to fit their own specific environments.

28
CHAPTER 4

SYSTEM ARCHITECTURE

4.1 Architecture for Authentication

Figure 1. architecture for authentication

The Driver participates through his mobile vehicle through the attached recycled
mobile parts and administrator through server.
Session keys( major session key and minor session key ) are issued to the driver on
request to access the vehicle which authenticates him for the entire session and
for frequent restarts within the session interval respectively. Keys expire after the
session gets over.

29
4.2 Architecture for intercommunication

Figure 2.Architecture for communication

The information that is to be exchanged between the mobile component and web
component is done via GPRS on a GSM facility provided by the mobile service
vendors. The Server side logic can map the vehicle on basis of geographical
coordinates supplied by it on the GIS system to track its location .

30
4.2 UML diagrams

4.2.1 Class diagram

31
Figure 3. Class diagram

The classes are majorly for driver , vehicle , visitor company work description and
work details with respect to key, UID ,VID, hours.

4.2.2 Activity diagram


4.2.2.1 Activity diagram for driver

Figure 4. Activity diagram for driver

Driver’s activities to request for a key, input the required particulars and receive
the key , are depicted through this diagram.

32
4.2.2.2 Activity Diagram for administrator

Figure 5. Activity Diagram for administrator

Administrators' process of accepting a request and confirming the operation by


issuing a set of keys is depicted.

33
4.2.3 Sequence diagram
4.2.3.1 Sequence diagram for authentication

Figure 6. Sequence diagram for authentication

The sequence diagram for authentication of driver to vehicle through


server.

34
4.3.2.2 Sequence diagram for communication between driver and
server, via vehicle reception

Figure 7. Sequence diagram for communication between driver and server, via
vehicle reception

35
The sequence of flow of actions for intercommunication between the driver ,
vehicle and admin

4.2.3.3 Sequence diagram for web based transportation service

Figure 8. Sequence diagram for web based transportation service

36
Sequence details for clients booking the vehicles and checking the details of
associated driver and vehicle as per their work id.

4.2.2 Use case diagram


4.2.2.1 Use case diagram for registration

Figure 9. Use case diagram for registration

This diagram depicts the registration procedure for the project. The drivers and
vehicles are registered and entered into a database along with a unique id each.

37
4.2.2.2 Use case diagram for major session key authentication

Figure 10. Use case diagram for major session key authentication

This diagram depicts the processes under major session key authentication that
grants the driver access to the vehicle for the duration of session interval which
was pre-specified in the document.

38
4.2.2.3 use case diagram for minor key authentication

Figure 11. Use case diagram for minor session key authentication

The set of processes for minor key authentication that happens when the major
session key authentication has already been carried out .

39
CHAPTER 5

MODULE DESCRIPTION

5.1 Registration Module

5.1.1 Registration for vehicles and drivers

Registers the vehicles details such as plate number, vehicle id number,

vehicle mobile number, vehicle’s email address etc in database. Similarly registers

the driver details such as unique id, date of joining, date of birth, mobile number ,

email address in the database.

5.1.2 Visitors Registration

The visitors have to make an account to be able to use the services

provided by the system, hence they have to register with their vital particualrs such

as name , address , phone, email address , username, password and security

question.

5.1.3 Work registration

To introduce a new work description it needs to be feed into the

system work registration form with details mentioning date , source , destination,

pick up time , drop down time, purpose etc .

40
5.1.4 Driver key request registration

Every time a driver wishes to access the vehicle he sends a key

request to the server supplying his unique driver id , vehicle unique id and

duration in hours for the session to remain active.

5.2 Authentication Module

5.2.1Authentication major session key

As the Driver requests session keys from the server. Server provides it
with a major session key, the same is stored into the server account.As the driver
tries to establish the communication with vehicle, through Bluetooth and pass
major key value , the driver’s supplied key value is mailed to server to check
whether both the session keys are matched ,if true then driver obtains access to
start and operate the vehicle, else if false then driver is restricted the permission to
operate the vehicle.

5.2.2Authentication minor session key

As the Driver requests a session key from the server. Server provides
it with a minor session key, the same is stored into the vehicle account. While
already logged in through the major session key, as the driver tries to establish the
communication with the vehicle , through Bluetooth and pass minor key value
both the session keys are matched ,if true then driver obtains access to start and

41
operate the vehicle, else if false then driver is restricted the permission to operate
the vehicle.

5.3 Alerts Module

5.3.1Composing the mail

Developing interactive GUI for composing the email with necessary

components and connection to the email service provider using specific hostname

and network configuration.

5.3.2 Sending email

Email is sent using the java application logic and javax.mail API to connect

to isp(internet service provider) hostname and transport the mail through its

communication server.

5.4 Vehicle Tracking Module

5.4.1Extracting coordinates GPS

Extracting the captured GPS coordinates (latitude, longitude) with the help

of java API’s in the mobile application.

5.4.2 Mailing the data to admin

The coordinates are supplied to the server frequently using email service.

5.4.3 Displaying on GIS (google map)

42
The coordinates are extracted from the email messages send by the driver

and input to the google map , which displays the location pointed by the driver ,

where the position is recorded from.

43
CHAPTER 5

SOFTWARE PROCESS MODEL

5.1 Bohem’s SPIRAL Software Development Life Cycle


Model
The Bohem’s spiral model suggests a regressive approach to
software development that begins at the system level and progresses through
analysis, design, coding, testing, and support. Figure illustrates the Bohem’s
spiral model for software engineering.

5.2 Analysis
The requirement gathering process is intensified and focused
specifically on software. To understand the nature of the program to be built, the
software engineer must understand the information domain for the software, as
well as required function, behavior, performance, and interface. Requirements
for both the system and the software are documented and reviewed with the
customer.

5.3 Design
Software design is actually a multistep process that focuses on four
distinct attributes of a program: data structure, software architecture, interface
representations, and procedural detail. The design process translates

44
requirements into a representation of the software that can be assessed for
quality before coding begins.

5.4 Coding
The design must be translated into a machine-readable form. The
code generation step performs this task. If design is preformed in a detailed
manner, code generation can be accomplished mechanistically.

5.5 Testing
The testing process focuses on the logical internals of the software,
ensuring that all statements have tested, and on the functional externals: that is,
conducting tests to uncover errors and ensure that defines input will produce
actual results that agree with required results.

45
Figure 12. Bohem’s Spiral Software Development LifecycleModel

46
CHAPTER 6

TESTING

6.1 Introduction

Because of the fallibility of its human designers and its own abstract,
complex nature, software development must be accompanied by quality
assurance activities. It is not unusual for developers to spend 40% of the total
project time on testing. For life-critical software (e.g. flight control, reactor
monitoring), testing can cost 3 to 5 times as much as all other activities
combined. The destructive nature of testing requires that the developer discard
preconceived notions of the correctness of his/her developed software.

6.2 S​oftware Testing Fundamentals

Testing objectives include Testing is a process of executing a program


with the intent of finding an error. A good test case is one that uncovers an as
yet undiscovered error.
Testing should systematically uncover different classes of errors in a
minimum amount of time and with a minimum amount of error. A secondary
benefit of testing is that it demonstrates that the software appears to be working
as started in the specifications. The data collected through testing can also
provide an indication of the software reliability and quality .But , testing cannot
show the absence f defect- it can only show that software defects age present​.

47
6.3 White Box Testing

White box testing is a test case design method that uses the control
structure of the procedural design to drive test cases.

฀ Test cases can be derived that guarantee that all independent paths within a
module have been exercised at least once.

฀ Exercise all logical decisions on their true and false sides

฀ Execute all lops at their boundaries and within their operational bounds

฀ Exercise internal data structures to ensure their validity.

Also known as glass box, structural, clear box and open box testing. A
software testing technique whereby explicit knowledge of the internal workings
of the item being tested are used to select the test data. Unlike black box testing,
white box testing uses specific knowledge of programming code to examine
outputs. The test is accurate only if the tester knows what the program is
supposed to do. He or she can then see if the program diverges from its intended
goal Whit box testing does not account for errors caused by omissions, and all
visible code must also be readable.

6.3.1 Requirement Analysis


​Understanding the requirements is key to performing whit box testing.
To this end, Applets work with the customer to get a better understanding of the

48
system under consideration. All relevant project documents relating to the
system functionality and design are desirable.

6.3.2 System Architecture


​Key to understanding any white box testing project is to understand
the overall system architecture. To this end, appalls works with client provided
documentation relating to system architecture.
Alternatively, appalls follow Rational unified Process standards,
including UML, to represent system architectures in a concise manner. The
system architecture documentation forms the basis for identification of systems,
subsystems and generation of test cases.

6.3.3 The Nature of the Software Defects


​Logic errors and incorrect assumptions are inversely proportional to
the probability that a program path will be executed. General processing tends to
be well understood while special case processing tends to be prone to errors.
We often believe that a logical path is not likely to be executed when
it may be executed on a regular basis. Our unconscious assumptions about
control flow and data lead to design errors that can be detected by path testing.

6.3.4 Basis Path Testing


This method enables the designer to drive a logical complexity
measure of a procedural design and use it as a guide for defining a basic set of
execution paths. Test cases that exercise the basis set are guaranteed to execute
every statement in the program at least once during testing.

49
6.3.5 Flow Graphs

​Flow graphs can be used to represent control flow in a program and


can help in the derivation of the basis set. Each flow graph
Node represents one or more procedural statements. The edges between nodes
represent flow of control. An edge must terminate at a node, even if the node
does not represent any useful procedural statements. A region in a flow graph is
an area bounded by edges and nodes. Each node that contains a condition is
called a predicate node. Cyclamate complexity is a metric that provides a
quantitative measure of the logical complexity of a program. It defines the
number of independent paths in the basis set and thus provides an upper bound
for the number of tests that must be performed.

6.3.6 The Basic Set

An independent path is any path through a program that introduces at


least one new set of processing statements (must move along at least new edge
in the path). The basis set is not unique. Any number of different basis sets can
be derived for a given procedural design.
Cyclamate Complexity, V (G), for a flow graph G is equal to the number
of regions in the flow graph.
฀ V(G) = E-N+2 where E is the number of edges and N is the number of nodes
฀ V (G) = P+1 where P is the number of predicate nodes.

6.3.7 Deriving Test Cases


50
1. From the design or source code, derive a flow graph.
2. Determine the cyclamate complexity of this graph.
3. Determine a basis set of linearly independent paths.
4. Prepare test cases that will force execution of each path in the basis set.

6.3.8 Automatic Basis Set Derivation


​The derivation of the flow graph and the set of basis path are amenable
to automation. A software tool to do this can be developed using a Data
structure ​called a graph matrix. A graph matrix is a square matrix whose size is
equivalent to the number of nodes in the flow graph? Each row and column
corresponds to a particular node and the matrix corresponds to the connections
(edges) between the nodes. By adding a link weight to each matrix entry, more
information about the control flow can be
Captured .In this simplest form, the link weight is 1 if an edge exists and 0 if
does not.
But other types of link weights can be represented:
฀ The probability that an edge will be executed.
฀ The processing time expended during link traversal.
฀ The memory required during link traversal, or
฀ The resources required during link traversal.

Graph theory algorithms can be applied to these graph matrices to help in the
analysis necessary to produce the basis set.

6.4 Loop Testing

51
​This white box testing focuses exclusively on the validity of loop
constructs. Four different classes of loops can be defined:
1. Simple loops
2. Nested loops
3. Concatenated loops and
4. Unstructured loops

6.4.1 Simple Loops


​The following tests should be applied to simple loops where n is the
maximum number of allowable passes through the loop.
● Skip the loop entirely,
● Only pass once through the loop,
● m passes through the loop where m < n,
● N-1, n, n+1 passes through the loop.

6.4.2 Nested Loops


​The testing of nested loops cannot simply extend the technique of
simple loops since this would result on a geometrically increasing number of
test cases. One approach for nested loops:

1. Start at the innermost loop. Set all other loops to minimum value.
2. Conduct simple loop tests for the innermost loop while holding
the outer loops at their minimums. Add tests for out –of –range
or excluded values.
3. Work outward, conducting tests for the next loop while keeping
All other outer loops at minimums and other nested loops to
52
Typical values.
4. Continue until all loops have been tested.

6.4.3 Concatenated Loop


Concatenated loops can be tested as simple loops if each loop is
independent of the others. If they are nit independent (e.g. the loop counter for
one is the loop counter for the other), then the nested approach can be used.

6.5 Black Box Testing


6.5.1 Introduction
Black box testing attempts to drive sets of inputs that will fully exercise
all the functional requirements of a system. It is not an alternative to white box
testing. This type of testing attempts to find errors in the following categories:
▪ Incorrect or missing functions,
▪ Interface errors
▪ Errors in data structure or external database access
▪ Performance errors and
▪ Initialization and termination errors.

Tests are designed to answer the following questions

▪ How is the function’s validity tested?


▪ What classes of input will make test cases?
▪ Is the system particularly sensitive to certain input values?
▪ How are the boundaries of a data class isolated?
▪ What are rates and data volume can the system tolerate?
53
▪ What effect will specific combinations of data have on system
operation?

White box testing should be performed early in the testing process, while black
box testing tends to be applied during later stages. Test cases should be designed
which,

1. Reduce the number of additional test cases that must be designed to achieve
reasonable testing, and

2. Tell us something about the presence or absence of classes of errors, rather


than an error associated only with the specific test at hand.

6.5.2 Equivalence Partitioning


​This method divides the input domain of a program into classes of data
from which test cases can be derived. Equivalence partitioning strives to define
a test case that uncovers classes of errors and thereby reduces the number of test
cases needed. It is based on an evaluation of equivalence classes for an input
condition. An equivalence class represents a set of valid or invalid states for
input conditions.
Equivalence classes may be defined according to the following guidelines:
1. If an input specifies a range, one valid and two invalid equivalence
classes are defined.
2. If an input condition requires a specific value, then one valid and two
valid equivalence classes are defined.

54
3. If an input condition specifies a member of a set, then one valid and
one invalid equivalence class are defined.
4. If an input condition is Boolean, then one valid and one invalid
equivalence class are defined.

6.5.3 Boundary Value Analysis:


This method leads to a selection of test cases that exercise boundary
values. It complements equivalence partitioning since it selects test cases at the
edges of a class. Rather than focusing on input condition solely, BVA derives
test cases from the output domain also. BVA guidelines include:
1. For input ranges bounded by a and b test cases should include values a
and b and just above just below a and b respectively.
2. If an input condition specifies a number of values, test cases should be
developed to exercise the minimum and maximum numbers and valued just
above and below these limits

6.5.4 Cause-Effect Graphing Techniques


​Cause-effect Graphing is a technique that provides a concise
representation of logical conditions and corresponding actions. There are four
steps:
1. Cause (input conditions) and effects (actions) are listed for a module and an
identifier is assigned to each.
2. A cause-effect graph is developed.
3. The graph is converted to a decision table.
4. Decision table rules are converted to test cases

55
CHAPTER 7

CONCLUSION

Successful in developing an intelligent vehicle authentication ,


management and monitoring system .It is crucial to gauge and determine the
possibilities and loopholes in emerging automotive engineering technologies
around the world so as to lead to an independent mobile node based ad-hoc
network for vehicles in future.
Alert sending from server to mobile side, report posting from mobile to
server side, booking vehicle service by customers online, viewing the driver and
vehicle details that are allotted for a particular task and real-time tracking the
position of the vehicle are salient features of the project , which have been
successfully demonstrated .

Future enhancements

To enable information exchange between the vehicle’s side and


administrator’s side about any updates or emergency alerts such as traffic
patterns , weather forecasting , news bulletin and online displayed fares for
commercial vehicles . It would also boost tourism as the customers can rent a
car for a pre-specified session .

56
CHAPTER 8
APPENDIX

8.1 Coding

Login page

<!DOCTYPE H ​ TML ​PUBLIC ​"-//W3C//DTD HTML 4.01 Transitional//EN"​>


<​html​>
<​head​>
<​title​>VISITORS LOGIN</​title​>
<​meta ​content​="text/html; charset=UTF-8" h ​ ttp-equiv​="Content-Type"​>
</​head​>
<​body ​background​="images/city.jpg"​>
<​h1​><​font c​ olor​="white"​>LOGIN FOR VISITOR</​font​></​h1​>
<​form a ​ ction​="login.do" ​method​="post" n ​ ame​="loginform"​>
<​p​>
<​h2​><​font c​ olor​="white"​>username : <​input n ​ ame​="username" ​type​="text" ​value​=""​/></​h2​><​br​>
<​h2​><​font c​ olor​="white"​>password : <​input n ​ ame​="password" ​type​="password" ​value​=""​/><​h2​><​br​>
<​input ​name​="ok" t​ ype​="submit" ​value​="ok"​/>
<​br​></​p​>
</​form​>
<​input o ​ nclick​="​window.close() ​" t​ ype​="button" v ​ alue​="quit"​/>
<​body​>
<​html​>

Index page
<​html​>
<​head​>
<​script​>
​function ​checkph​() {
​var ​phnum ​= ​document​.​register​.phoneNo.​value​;
​if ​(​phnum​.​length ​!= ​10​) {
​alert​(​"Please Enter Valid Number"​);
​document​.​register​.phoneNo.​focus​();
}
​for ​(​var ​i ​= ​0​; ​i ​< ​phnum​.​length​; ​i​++) {
​if ​(​phnum​.charat[​i​] < ​'0' ​&& ​phnum​.​ch​[​i​] > ​'9'​) {
​alert​(​"Charecters Are Not Allowed"​);
​document​.​register​.phoneNo.​focus​();
}
}
}

​function ​isValidEmailStrict​() {
​alert​(​"Checking Valid Email"​);

57
​var ​address ​= ​document​.​register​.email.​value​;
​if ​(​isValidEmail​(​address​) == ​false​) ;
​var ​domain ​= ​address​.​indexOf​(​'@'​) + ​1
​);
​if ​(domain.​indexOf​(​'.'​) == -​1​) ​return false​;
​if ​(domain.​indexOf​(​'.'​) == ​0 ​|| domain.​indexOf​(​'.'​) == domain.​length ​- ​1​) ​return false​;
​return true​;
}

​function ​isValidEmail​(address) {
​if ​(address != ​'' ​&& address.​search​) {
​if ​(address.​search​(​/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/​) != -​1​)
return true​;
​else return false​;
} ​else return true​;
}
</​script​>
<​title​>Register vehicle</​title​>
</​head​>
<​body ​leftmargin​="0" ​rightmargin​="0" ​topmargin​="0" ​ottommargin​="0" ​alink​="#666666"
​background​="images/background-main.jpg"
​bgcolor​="#ffffff" ​link​="#4e172a" ​marginheight​="0" ​marginwidth​="0" ​text​="#000000"
vlink​="#4e172a"​>
<​div ​class​="divstyle" ​id​="info" ​style​="​display​: ​none​; ​top​: ​293​px​; ​left​: ​526​px​;​"​>
<​div ​id​="imagetitle" ​class​="pstyletitle" ​align​="center"​></​div​>
<​table ​border​="0" ​cellpadding​="0" ​cellspacing​="0" ​height​="100%" ​width​="100%"​>
<​tbody​>
<​tr​>
<​td ​align​="left" ​valign​="top"​>
<​script ​language​="JavaScript" ​src​="images/header.js"​></​script​>
<​table ​border​="0" ​cellpadding​="0" ​cellspacing​="0" ​width​="100%"​>
<​tbody​>
<​tr​>
<​td​>
<​img ​src​="images/ITHEADER.jpg" ​alt​="image" ​border​="0" ​height​="80"
width​="100%"​></​td​>
</​tr​>
<​tr​>
<​td ​background​="images/split-bar.gif" ​bgcolor​="#999999" ​height​="20"​>
</​td​>
</​tr​>
</​tbody​>
</​table​>
​<!-- OUTER TABLE-->
​<​table ​border​="0" ​cellpadding​="0" ​cellspacing​="0" ​width​="100%"​>
<​tbody​>
<​tr​>
<​td ​align​="center" ​valign​="top" ​bgcolor​="black"​><​p​>​&nbsp;​</​p​>
<​p​>​&nbsp;​</​p​>
<​table​>
<​tr​>
<​td ​border​="1" ​bgcolor​="gainsboro"​>
<​h3​>
<​div ​align​="center"​><​span ​class​=subHead​><​br​>Register the vehicle </​span​>
</​div​>
58
</​h3​>
<​form ​action​="./RegisterAction" ​method​="post" ​name​="register"
​onSubmit​="​return ​validate​()​"​>
​<!--<table border="1"><tr><td></td></tr></table>-->
​<​input ​type​="hidden" ​name​="port" ​value​=" "​>
<​input ​type​="hidden" ​name​="host" ​value​=" "​><​br​>
<​table ​align​="left" ​width​=70%​>
<​th ​colspan​="6" ​bgcolor​="gray"​><​span ​class​=Title​>ACCOUNT
DETAILS</​span​>
</​th​>
<​tr​>
<​td​>
<​pre​><​span ​class​=Title​> VID</​span​></​pre​>
</​td​>
<​td ​width​="303"​><​input ​type​="text" ​name​="VID" ​value​=" " ​size​="20"​/>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;​<​span
​class​=Title​></​span​></​td​>
</​tr​>
<​th ​colspan​="6" ​bgcolor​="gray"​><​span ​class​=Title​>VEHICLE
DETAILS</​span​>
</​th​>
<​tr​>
<​td​>
<​pre​><​span ​class​=Title​> vehicle plate</​span​></​pre​>
</​td​>
<​td ​width​="276"​><​input ​type​="text" ​name​="vplate" ​value​=""​></​td​>
</​tr​>
<​tr​>
<​td ​width​="139"​>
<​pre​><​span ​class​=Title​> vehicle mobile number</​span​></​pre​>
</​td​>
<​td ​width​="276"​><​input ​type​="text" ​name​="vmobnumber" ​value​=""
​size​="20" ​onbLur​="​checkph​()​"​/></​td​>
</​tr​>
<​tr​>
<​td ​width​="139"​>
<​pre​><​span ​class​=Title​> vehicle email address</​span​></​pre​>
</​td​>
<​td ​width​="276"​><​input ​type​="text" ​name​="vmobnumber" ​value​=""
​size​="20" ​onBlur​="​isValidEmail​()​"​/></​td​>
</​tr​>
<​th ​colspan​="6" ​bgcolor​="gray"​><​span
​class​=Title​>VEHICLE CONFIGURATIONS</​span​></​th​>
<​tr​></​tr​>
<​tr​></​tr​>
<​tr​>
<​td​>
<​pre​><​span ​class​=Title​>Browse Pphoto</​span​></​pre​>
</​td​>
</​tr​>
</​table​>
</​form​>
</​td​>
</​tr​>
59
</​table​>
</​td​>
</​tr​>
</​tbody​>
</​table​>
</​td​>
</​tr​>
</​tbody​>
</​table​>
</​div​>
</​body​>
</​html​>

Web config
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>work_allocated</servlet-name>
<servlet-class>view.work_allocated</servlet-class>
</servlet>
<servlet>
<servlet-name>work_pending</servlet-name>
<servlet-class>view.work_pending</servlet-class>
</servlet>
<servlet>
<servlet-name>work_confirmed</servlet-name>
<servlet-class>view.work_confirmed</servlet-class>
</servlet>
<servlet>
<servlet-name>login</servlet-name>
<servlet-class>controller.login</servlet-class>
</servlet>
<servlet>
<servlet-name>registration_visitor</servlet-name>
<servlet-class>controller.registration_visitor</servlet-class>
</servlet>
<servlet>
<servlet-name>registeredpage_visitor</servlet-name>
<servlet-class>view.registeredpage_visitor</servlet-class>
</servlet>
<servlet>
<servlet-name>checkstate</servlet-name>
<servlet-class>view.checkstate</servlet-class>

60
</servlet>
<servlet>
<servlet-name>activestate</servlet-name>
<servlet-class>view.activestate</servlet-class>
</servlet>
<servlet>
<servlet-name>info_driver</servlet-name>
<servlet-class>view.info_driver</servlet-class>
</servlet>
<servlet>
<servlet-name>info_vehicle</servlet-name>
<servlet-class>view.info_vehicle</servlet-class>
</servlet>
<servlet>
<servletname>all_company</servlet-name>
<servlet-class>view.all_company</servlet-class>
</servlet>
<servlet>
<servlet-name>all_visitor</servlet-name>
<servlet-class>view.all_visitor</servlet-class>
</servlet>
<servlet>
<servlet-name>registration_work</servlet-name>
<servlet-class>controller.registration_work</servlet-class>
</servlet>
<servlet>
<servlet-name>registration_company</servlet-name>
<servlet-class>controller.registration_company</servlet-class>
</servlet>
<servlet>
<servlet-name>all_vehicles</servlet-name>
<servlet-class>view.all_vehicles</servlet-class>
</servlet>
<servlet>
<servlet-name>all_drivers</servlet-name>
<servletclass>view.all_drivers</servlet-class>
</servlet>
<servlet>
<servlet-name>sendalert</servlet-name>
<servlet-class>view.sendalert</servlet-class>
</servlet>
<servlet>
<servlet-name>SendMailServlet</servlet-name>
<servlet-class>controller.SendMailServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>compose_mail</servlet-name>
</servlet-mapping>
<servlet-mapping>
<servlet-name>registration_visitor</servlet-name>
<url-pattern>/registration_visitor.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>registeredpage_visitor</servlet-name>
<url-pattern>/registeredpage_visitor.view</url-pattern>
61
</servlet-mapping>
<servlet-mapping>
<servlet-name>checkstate</servlet-name>
<url-pattern>/checkstate.view</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>activestate</servlet-name>
<url-pattern>/activestate.view</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>info_driver</servlet-name>
<url-pattern>/info_driver.view</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>info_vehicle</servlet-name>
<url-pattern>/info_vehicle.view</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>all_company</servlet-name>
<url-pattern>/all_company.view</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>all_visitor</servlet-name>
<url-pattern>/all_visitor.view</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>registration_work</servlet-name>
<url-pattern>/registration_work.do</url-pattern>
</servlet-mapping>
</web-app>

VEHICLE MIDLET
import ​bluetooth.BluetoothStateException;

import ​javax.​bluetooth.*;
import ​javax.​microedition.io.Connector;
import ​javax.​microedition.io.StreamConnection;
import ​java.io.IOException​;
import ​java.io.InputStream​;
import ​java.io.OutputStream​;

public class C ​ lientServer ​implements ​Listener {


​/**
* Creates a new instance of ClientServer
*/
​UUID R ​ FCOMM_UUID ​= n ​ ew ​UUID(​0x0003​);
​private final ​String m​ _ServerUrl ​= "​ btspp://localhost:" ​+ R​ FCOMM_UUID +​ ​";name=rfcommtest;authorize=true"​;
​private S​ treamConnection ​m_StrmConn =​ ​null​;
​private L​ ocalDevice ​m_LclDevice ​= n ​ ull​;
​private I​ nputStream ​m_Input =​ n ​ ull​;
​private O ​ utputStream ​m_Output =​ ​null​;
​private S​ treamNotifier ​m_StrmNotf =​ ​null​;
​public boolean m ​ _bIsServer ​= f​ alse​, ​m_bServerFound =​ ​false​, ​m_bInitServer ​= f​ alse​, ​m_bInitClient =​ ​false​;
62
​private static S​ tring m​ _strUrl​;
​private final ​String S​ EVER_RESPONSE =​ ​"run"​, ​CLIENT_RESPONSE =​ ​"ready"​;
​private D
​ iscoveryAgent ​m_DscrAgent ​= n ​ ull​;

​public ​ClientServer​(b ​ oolean i​ sServer) {


​ _bIsServer ​= isServer;
m
i​ f ​(​m_bIsServer​) {
InitServer();
} ​else {​
InitClient();
}
}

​private void I​ nitServer​() {


​m_strUrl ​= ​"btspp://localhost:" +​ R ​ FCOMM_UUID +​ ​";name=rfcommtest;authorize=true"​;
​try ​{
m ​ _LclDevice =​ LocalDevice.getLocalDevice();
​m_LclDevice​.setDiscoverable(Discover.GIAC);
m ​ _StrmNotf =​ Connector.open(​m_strUrl​);
​m_StrmConn =​ ​m_StrmNotf​.acceptAndOpen();
​m_bInitServer =​ ​true​;
​m_Output ​= Conn.openOutputStream();
m​ _Input =​ ​m_StrmConn​.openInputStream();
} ​catch (​ BluetoothStateException e) {
​System​.e​ rr​.println(​"BluetoothStateException: " ​+ e.getMessage());
} ​catch (​ ​IOException e​ x) {
ex.printStackTrace();
} ​catch (​ ​Exception e​ ) {
​System​.e​ rr​.println(​"Exception: "​);
}
}

​private void I​ nitClient​() {


SearchAvailDevices();
}

​ ublic void ​SearchAvailDevices​() {


p
​try ​{
​ _LclDevice =​ LocalDevice.getLocalDevice();
m
​m_DscrAgent =​ getDiscoveryAgent();
​m_DscrAgent​.startInquiry(DiscoveryAgent.GIAC, t​ his​)
} c​ atch (​ BluetoothStateException ex) {
​ ut​.println(​"Problem in searching the blue tooth devices"​);
​System​.o
ex.printStackTrace();
}
}

​public void ​SendMessages​(​String v​ _strData) {


​if ​((​m_bInitClient​) || (​m_bInitServer​)) {
​try {​
​m_Output​.write(v_strData.length());
​m_Output​.write(v_strData.getBytes());
} ​catch ​(​IOException e​ x) {
ex.printStackTrace();
}
63
}
}

​public ​String R ​ ecieveMessages​() {


​byte​[] data = n ​ ull​;
​try ​{
i​ nt ​length = ​m_Input​.read();
data = n ​ ew byte​[length];
length = 0 ​ ;​
​while ​(length != data.​length​) {
​int ​ch ​= read(data, length, data.​length ​- length);
​if (​ ​ch =​ = -​1​) {
​throw new I​ OException(​"Can't read data"​)
length += c​ h​;
}
}
} ​catch (​ ​IOException e​ ) {
​System​.e​ rr​.println(e);
}
r​ eturn new S​ tring(data);
}

​public void ​inquiryCompleted​(i​ nt ​discType) {


​ ut​.println(​"InquiryCompleted"​);
​System​.o
}

​public void ​serviceSearchCompleted​(i​ nt ​transID, i​ nt ​respCode) {


​if ​(​m_bServerFound​) {
t​ ry {​
​m_StrmConn ​= (StreamConnection) Connector.open(​m_strUrl​);
​m_Output =​ OutputStream();
​m_Input ​= m ​ _StrmConn​.openInputStream();
​m_Output​.w(​CLIENT_RESPONSE​.length());
​m_Output​.write(​CLIENT_RESPONSE​.getBytes());
​System​.​out.​ println(​"serviceSearchCompleted"​)
} ​catch ​(​IOException e​ x) {
ex.printStackTrace();
}
}
}

​void ​CloseAll​() {
​try ​{
i​ f ​(m
​ _Output !​ = ​null​) m​ _Output​.close();
​if ​(m ​ _Input ​!= n
​ ull​) m
​ _Input​.close();
} ​catch (​ ​IOException e​ x) {
ex.printStackTrace();
}
}

​public void ​servicesDiscovered​(i​ nt ​transID, i​ nt​[] ServiceRecord records) {


​for ​(​int i​ = 0
​ ​; i < records.length; i++) {
m​ _strUrl ​= records[i].getConnectionURL(Service, f​ alse​);
​System​.o ​ ut​.println(​m_strUrl​);
​ _strUrl​.startsWith(​"btspp"​)) {
​if ​(m
64
​m_bServerFound =​ ​true​;
​m_bInitClient ​= t​ rue​;
​break​;
}
}
}

​ ublic void ​deviceDiscovered​(RemoteDevice btDevice, DeviceClass cod) {


p
t​ ry ​{
/​ / Get Device Info
​System​.o​ ut​.println(​"Device Discovered"​);
​System​.o ​ ut​.println(​"Major Device Class: " ​+ cod.getMajorDeviceClass() + ​" Minor Device Class: " +​
cod.getMinorDeviceClass());
S​ ystem​.o ​ ut​.println(​"Bluetooth Address: " ​+ btDevice.getBluetoothAddress());
​System​.o ​ ut​.println(​"Bluetooth Friendly Name: " ​+ btDevice.getFriendlyName(​true​));
/​ / Search for Services
​UUID[] u ​ uidSet ​= n ​ ew ​UUID[​1]​ ;
​uuidSet​[0 ​ ​] = R
​ FCOMM_UUID​;
​int ​searchID =​ (​null​, u ​ uidSet​, ​btDevice​, ​this​)
} ​catch (​ ​Exception e​ ) {
​System​.o ​ ut​.println(​"Device Discovered Err"​);
}
}
}

DRIVER MIDLET

import ​javax.​microedition.midlet.*;
import ​javax.​microedition.lcdui.*;

import ​netbeans.microedition.lcdui.WaitScreen;
import ​netbeans.microedition.util.SimpleCancel;

import ​java.io.​*;
import ​javax.​microedition.io.*;
import ​java.lang.​*;
import ​java.util.​*;

public class a​ sk_key_midlet ​extends M ​ IDlet i​ mplements ​CommandListener {


​private boolean m ​ idletPaused ​= f​ alse​;
​private S​ tringItem ​mMsgItem​, m​ KeyItem​, ​msuccessitem​;

​public ​Display g​ etDisplay​() {


r​ eturn ​Display.getDisplay(​this​);
}

​public void ​exitMIDlet​() {


switchDisplayable(​null​, ​null​);
destroyApp(​true​);
notifyDestroyed();
}
65
​public void ​startApp​() {
i​ f ​(​midletPaused​) {
resumeMIDlet();
} e​ lse {​
initialize();
startMIDlet();
}
​midletPaused =​ ​false
}​

​public void ​pauseApp​() {


​midletPaused =​ ​true​;
}

​public void ​destroyApp​(​boolean u


​ nconditional) {
}

​private void c​ onnect​(i​ nt ​UID, ​String d ​ name) {


​InputStream in ​= ​null​;
​StringBuffer sb ​= n ​ ew ​StringBuffer();
​int c​ h​;
​try ​{
S​ tring url2 ​= Property(​"ask_key_midlet.URL"​);
​String url =​ ​"http://127.0.0.1:8/it/login.view"​;
HttpConnection ​hc ​= Connector.open(​url​);
​hc​.setRequestProperty(​"User-t"​, ​"Profile/MIDP-1.0, Configuration/CLDC-1.0"​);
h ​ c​.setRequestProperty(​"Content-"​, ​"en-US"​);
h ​ c​.setRequestMethod(HttpConnection.POST);
​DataOutputStream os ​= (​DataOutputStream​) h ​ c​.openDataOutputStream();
​os​.writeUTF(​"" ​+ UID);
o ​ s​.writeUTF(dname.trim());
​os​.close();
​os​.flush();
​os​.openDataInputStream();
​int ​contentLength =​ (​int​) h ​ c​.getLength();
​byte​[] r​ aw ​= n ​ ew byte​[c​ ontentLength​];
​int ​length =​ ​in​.read(​raw​);
S​ tring s =​ (​raw​, 0 ​ ​, ​length​)​mKeyItem​.setText(​s)​ ; ​catch​(​IOException ​ioe){
m ​ KeyItem​.setText(ioe.toString());
}
}
​private void ​send ( i​ nt ​UID​, ​int ​VID​, ​int ​hours)
{
​try {​
​String url2 =​ (​"ask_key_midlet.URL"​);
​String url ​= "​ http://127.0.0.1:8092/s.view"​;
HttpConnection ​hc ​= cector.open(​url​);
​hc​.setRequestProperty(​"User-Agent"​, ​"Profile/MIDP-1.0, Configuration/CLDC-1.0"​);
h ​ c​.setRequestProperty(​"Content-Language"​, "​ en-US"​);
​hc​.setRequestMethod(HttpConnection.POST);
DataStream o ​ s ​= ​hc​.openOutputStream();
​os​.write(​UID​);
​os​.write(​VID​);
​os​.write(​hours​);
66
​os​.close();
o​ s​.flush();
} ​catch ​(​IOException i​ oe) {
​ MsgItem​.setText(ioe.toString());
m
}
/​ / mDisplay.setCurrent(successform);
​}
}
}

EMAIL CODE

67
package c​ ontroller​;

import ​javax.​mail.*;
import ​javax.​mail.internet.*;
import ​java.security.Security​;
import ​java.util.​*;

public class ​send_mail_keys_driver ​{


i​ nt ​WID​, s​ k1​, s​ k2​;
​String ​from = ​ ​"xyz@gmail.com"​;
S ​ tring ​d_password = ​ ​"xxx"​;
S ​ tring ​d_host ​= ​"smtp.gmail.com"​;
S ​ tring ​d_port ​= ​"587"​;
S ​ tring ​receipent ​= "​ abc@gmail.com"​;
S ​ tring ​m_subject ​= "​ KEY"​;
S ​ tring ​m_text ​= ​"not permitted"​;

​ ublic s​ end_mail_keys_driver​(​int W
p ​ ID, ​int s​ k1, ​int s​ k2, S
​ tring ​receipent) {
WID = ​this​.​WID​;
sk1 = ​this​.​sk1​;
sk2 = ​this​.​sk2​;
receipent = ​this​.​receipent​;
m​ _text = ​ f(sk1) + ​String​.​valueOf(​ sk2);
S ​ ystem​.​setProperty​(​"javax.net.debug"​, ​"ssl"​);
P ​ roperties props ​= ​new P ​ roperties();
p ​ rops​.put(​"mail.smtp.user"​, ​from​);
p ​ rops​.put(​"mail.smtp.host"​, d ​ _host​);
p ​ rops​.put(​"mail.smtp.port"​, ​d_port​);
p ​ rops​.put(​"mail.smtp.starttls.enable"​, ​"true"​);
p ​ rops​.put(​"mail.smtp.auth"​, ​"true"​);
p ​ rops​.put(​"mail.smtp.debug"​, "​ true"​);
p ​ rops​.put(​"mail.smtp.socketFactory.port"​, ​d_port​);
​props​.put(​"mail.smtp.socketFactory.class"​, ​"javax.net.ssl.SSLSocketFactory"​);
p ​ rops​.put(​"mail.smtp.socketFactory.fallback"​, ​"false"​);
t​ ry ​{
S ​ MTPAuthenticator auth ​= ​new a ​ thenticator();
Session ​session ​= Session.getInstance(​props​);
​session​.setDebug(​true​);
MimeMessage m ​ sg ​= ​new M ​ imeMessage(​session​);
​msg​.setText(​m_text​);
​msg​.setSubject(​m_subject​);
​msg​.setFrom(​new I​ nternetAddress(​from​));
​msg​.addRecipient(Message.RecipientType.TO, n ​ ew ​InternetAddress(receipent));
Transport.send(​msg​);
} ​catch ​(T ​ hrowable ​mex) {
mex.printStackTrace();
}
}

​ rivate class S
p ​ MTPAuthenticator e
​ xtends ​javax.​mail.Authenticator {
​public ​PasswordAuthentication ​getPasswordAuthentication​() {
​return new P​ asswordAuthentication(​from​, d
​ _password​);
}
}
}
68
BLUETOOTH CODE

​ iew​;
package v

import ​com.​mysql.jdbc.Connection;
import ​com.​mysql.jdbc.PreparedStatement;
import ​com.​mysql.jdbc.ResultSet;

import ​java.io.IOException​;
import ​java.io.PrintWriter​;
import ​java.sql.SQLException​;
import ​java.util.logging.Level​;
import ​java.util.logging.Logger​;
import ​javax.annotation.​Resource​;
import ​javax.servlet.ServletException​;
import ​javax.servlet.http.HttpServlet​;
import ​javax.servlet.http.HttpServletRequest​;
import ​javax.servlet.http.HttpServletResponse​;
import ​java.io.​*;
import ​java.net.​*;
import ​java.sql.DriverManager​;
import ​java.util.​*;
import ​javax.servlet.​*;
import ​javax.servlet.http.​*;
import ​javax.sql.DataSource​;

public class ​all_drivers ​extends H


​ ttpServlet ​{
@​ Resource​(name = ​"informationhighway"​)
​ rivate ​DataSource i​ nformationhighway​;
p

​ rotected void ​processRequest​(​HttpServletRequest r​ equest, ​HttpServletResponse r​ esponse) ​throws


p
ServletException​, ​IOException​, ​SQLException {​
response.setContentType(​"text/html;charset=UTF-8"​);
​ rintWriter out =
P ​ response.getWriter();
​String result​;
t​ ry ​{
o ​ ut​.println(​"<body bgcolor='tan'>"​);
​out​.print(​"list of all drivers" + ​ ​"<br>"​);
​out​.print(​"UID | dfirstname | dlastname | ddob | dhouseno | dstreet | "
​+ ​"dinno | dmobnumber | demail | dgender | dlanhuage |ddoj" ​+ ​"<br>"​);
​out​.println(​"---------------------------------------------------------------------" ​+ ​"<br>"​);
​result = ​ get_work_info();
​out​.print(​result​);
​out​.print(​" <a
href='http://localhost:8092/informationhighway_server/homepageadmin.html'>HOME</a>"​);
​out​.print(​"</body>"​);
} ​catch ​(E ​ xception ​e) {
e.printStackTrace();
} ​finally ​{

69
​out​.close();
}
}

@​ Override
​protected void ​doGet​(​HttpServletRequest r​ equest, H ​ ttpServletResponse ​response)
​throws S ​ ervletException​, ​IOException {​
​try ​{
processRequest(request, response);
} c​ atch ​(S
​ QLException ​ex) {
​Logger​.​getLogger(​ work_allocated.​class​.getName()).log(​Level​.​SEVERE​, n
​ ull​, ex);
}
}

@​ Override
​protected void ​doPost​(H ​ ttpServletRequest r​ equest, ​HttpServletResponse ​response)
​throws S ​ ervletException​, ​IOException {​
​try ​{
processRequest(request, response);
} c​ atch ​(S
​ QLException ​ex) {
​Logger​.​getLogger(​ work_allocated.​class​.getName()).log(​Level​.​SEVERE​, n
​ ull​, ex);
}
}

@​ Override
​public S ​ tring ​getServletInfo​() {
r​ eturn "​ Short description"​;
}

​ ublic S
p ​ tring ​get_work_info​() t​ hrows ​ClassNotFoundException​, ​InstantiationException​,
IllegalAccessException ​{
S ​ tringBuffer workstmt = ​ ​new ​StringBuffer();
S ​ tring qry = ​ ​null​;
​try ​{
C ​ lass​.​forName​("​ com.mysql.jdbc.Driver"​).newInstance();
​java.sql.Connection conn ​=
DriverManager​.​getConnection​("​ jdbc:mysql://localhost/informationhighway?" ​+
"user=root&password=altanai22"​);
​DriverManager​.​registerDriver​(n ​ ew ​org.​gjt.mm.mysql.Driver());
​java.sql.PreparedStatement pstmt ​= ​conn​.prepareStatement(​"select
UID,dfirstname,dlastname,dhouseno,dstreet,dpinno,dmobnumber,demail,dgender,dlanguage from
driver"​);
​java.sql.ResultSet rs ​= p ​ stmt​.executeQuery();
​while (​ r​ s​.next()) {
S​ ystem​.​out​.println(​"reached inside while block"​);
​ tringBuffer append ​= w
S ​ orkstmt​.append(​rs​.getInt(​"UID"​) + ​"|" +
​ ​rs​.getString(​"dfirstname"​) + ​"|"
+ ​rs​.getString(​"dlastname"​) + ​"|" ​+ ​rs​.getString(​"dhouseno"​) + ​"|" ​+ ​rs​.getString(​"dstreet"​) + "​ |" ​+
rs​.getInt(​"dpinno"​) + "​ |" ​+ ​rs​.getInt(​"dmobnumber"​) + "​ |" ​+ ​rs​.getString(​"demail"​) + ​"|" ​+
rs​.getString(​"dgender"​) + ​rs​.getString(​"dlanguage"​) + ​"<br>"​);
}
} ​catch ​(S ​ QLException ​ex) {
ex.printStackTrace();
}
r​ eturn w ​ orkstmt​.toString();
}
70
}

REGISTRATION :

package c​ ontroller​;

import ​javax.servlet.RequestDispatcher​;
import ​javax.servlet.ServletException​;
import ​javax.servlet.http.HttpServlet​;
import ​javax.servlet.http.HttpServletRequest​;
import ​javax.servlet.http.HttpServletResponse​;
import ​java.io.IOException​;
import ​java.io.PrintWriter​;
import ​java.sql.SQLException​;
import ​java.util.LinkedList​;
import ​java.util.logging.Level​;
import ​java.util.logging.Logger​;

//import db.list_vehicles;

public class r​ egistration_driver ​extends ​HttpServlet ​{


​protected void p​ rocessRequest​(​HttpServletRequest ​request, ​HttpServletResponse ​response) t​ hrows
ServletException​, I​ OException​, S ​ QLException ​{
response.setContentType(​"text/html;charset=UTF-8"​);
​ rintWriter out ​= response.getWriter();
P
t​ ry {​
​LinkedList d​ l = ​new L ​ inkedList();
​int ​UID = ​ ​Integer​.​parseInt(​ request.getParameter(​"UID"​));
​String dfirstname = ​ request.getParameter(​"dfirstname"​);
​ tring dlastname =
S ​ request.getParameter(​"dlastname"​);
​String ddob = ​ request.getParameter(​"ddob"​);
​String dhouseno = ​ request.getParameter(​"dhouseno"​);
​String dstreet = ​ request.getParameter(​"dstreet"​);
​int ​dpinno = ​ ​Integer​.​parseInt​(request.getParameter(​"dpinno"​));
​int ​dmobnumber = ​ ​Integer​.​parseInt​(request.getParameter(​"dmobnumber"​));
S​ tring demail = ​ request.getParameter(​"demail"​);
​String dgender = ​ request.getParameter(​"dgender"​);
​String dlanguage = ​ request.getParameter(​"dlanguage"​);
​String ddoj = ​ request.getParameter(​"ddoj"​);
​list_drivers d ​= n​ ew ​list_drivers(​UID​, d​ firstname​, d​ lastname​, d​ dob​, d​ houseno​,
​dstreet​, d​ pinno​, d​ mobnumber​, d​ email​, d​ gender​, d​ language​, d​ doj​);
dl = (​LinkedList​) d​ ​.call_driver_info();
request.setAttribute(​"driverinfo"​, dl);
​if (​ dl != n​ ull​) {
​RequestDispatcher rd = ​ request.getRequestDispatcher(​"registeredpage_driver.view"​);
​rd​.forward(request, response);
}

71
} ​finally {​
​out​.close();
}
}

p​ rotected void d​ oGet​(​HttpServletRequest r​ equest, H ​ ttpServletResponse ​response)


t​ hrows S
​ ervletException​, I​ OException ​{
​try {​
processRequest(request, response);
} ​catch ​(​SQLException e​ x) {
​Logger​.​getLogger​(​registration_driver​.​class​.getName()).log(​Level​.​SEVERE​, n​ ull​, ex);
}
}

​protected void d​ oPost​(​HttpServletRequest ​request, H ​ ttpServletResponse ​response)


t​ hrows S
​ ervletException​, I​ OException ​{
​try {​
processRequest(request, response);
} ​catch ​(​SQLException e​ x) {
​Logger​.​getLogger​(​registration_driver​.​class​.getName()).log(​Level​.​SEVERE​, n​ ull​, ex);
}
}

​public ​String g​ etServletInfo​() {


​return ​"Short description"​;
}
}

DISPLAY DETAILS
package view;

import com.mysql.jdbc.Connection;
import com.mysql.jdbc.PreparedStatement;
import com.mysql.jdbc.ResultSet;

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.Resource;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.*;
import java.sql.DriverManager;
import java.util.*;
import javax.servlet.*;
72
import javax.servlet.http.*;
import javax.sql.DataSource;

public class all_drivers extends HttpServlet {


@Resource(name = "informationhighway")
private DataSource informationhighway;

protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws


ServletException, IOException, SQLException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
String result;
try {
out.println("<body bgcolor='tan'>");
out.print("list of all drivers" + "<br>");
out.print("UID | dfirstname | dlastname | ddob | dhouseno | dstreet | "
+ "dinno | dmobnumber | demail | dgender | dlanhuage |ddoj" + "<br>");
out.println("---------------------------------------------------------------------" + "<br>");
result = get_work_info();
out.print(result);
out.print(" <a
href='http://localhost:8092/informationhighway_server/homepageadmin.html'>HOME</a>");
out.print("</body>");
} catch (Exception e) {
e.printStackTrace();
} finally {
out.close();
}
}

@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
try {
processRequest(request, response);
} catch (SQLException ex) {
Logger.getLogger(work_allocated.class.getName()).log(Level.SEVERE, null, ex);
}
}

@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
try {
processRequest(request, response);
} catch (SQLException ex) {
Logger.getLogger(work_allocated.class.getName()).log(Level.SEVERE, null, ex);
}
}
73
@Override
public String getServletInfo() {
return "Short description";
}

public String get_work_info() throws ClassNotFoundException, InstantiationException,


IllegalAccessException {
StringBuffer workstmt = new StringBuffer();
String qry = null;
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
java.sql.Connection conn =
DriverManager.getConnection("jdbc:mysql://localhost/informationhighway?" +
"user=root&password=altanai22");
DriverManager.registerDriver(new org.gjt.mm.mysql.Driver());
java.sql.PreparedStatement pstmt = conn.prepareStatement("select
UID,dfirstname,dlastname,dhouseno,dstreet,dpinno,dmobnumber,demail,dgender,dlanguage from
driver");
java.sql.ResultSet rs = pstmt.executeQuery();
while (rs.next()) {
System.out.println("reached inside while block");
StringBuffer append = workstmt.append(rs.getInt("UID") + "|" + rs.getString("dfirstname") + "|"
+ rs.getString("dlastname") + "|" + rs.getString("dhouseno") + "|" + rs.getString("dstreet") + "|" +
rs.getInt("dpinno") + "|" + rs.getInt("dmobnumber") + "|" + rs.getString("demail") + "|" +
rs.getString("dgender") + rs.getString("dlanguage") + "<br>");
}
} catch (SQLException ex) {
ex.printStackTrace();
}
return workstmt.toString();
}
}

SESSION SERVLET
package v​ iew​;

import ​controller.​keygenerator;
import ​controller.send_mail_keys_driver​;
import ​db.dbconnection;

import ​javax.servlet.ServletException​;
import ​javax.servlet.http.HttpServlet​;
import ​javax.servlet.http.HttpServletRequest​;
import ​javax.servlet.http.HttpServletResponse​;
import ​java.io.IOException​;
import ​java.io.PrintWriter​;
import ​java.sql.SQLException​;
74
import ​java.util.logging.Level​;
import ​java.util.logging.Logger​;

public class s​ essionsending ​extends ​HttpServlet ​{


p​ rotected void p​ rocessRequest​(​HttpServletRequest ​request, ​HttpServletResponse ​response) t​ hrows
ServletException​, I​ OException​, C ​ lassNotFoundException​, I​ nstantiationException​, I​ llegalAccessException {​
response.setContentType(​"text/html;charset=UTF-8"​);
P​ rintWriter out ​= response.getWriter();
o​ ut​.print(​"<body bgcolor='tan'>"​);
​try {​
​out​.print(​"Session particulars ... <br><br>"​);
i​ nt ​WID = ​ ​Integer​.​parseInt(​ request.getParameter(​"WID"​));
i​ nt ​UID = ​ ​Integer​.​parseInt(​ request.getParameter(​"UID"​));
​int ​VID = ​ ​Integer​.​parseInt(​ request.getParameter(​"VID"​));
​int ​hours = ​ I​ nteger​.​parseInt​(request.getParameter(​"hours"​));
​int ​currtime = ​ I​ nteger​.​parseInt​(request.getParameter(​"currtime"​));
​out​.println(​"WID : " ​+ W ​ ID + ​ ​"<br><br>"​);
​out​.println(​"UID : " ​+ U ​ ID ​+ "​ <br><br>"​);
​out​.println(​"VID : " ​+ V ​ ID ​+ "​ <br><br>"​);
​out​.println(​"hours:" + ​ ​hours + ​ "​ <br><br>"​);
keygenerator k​ g = ​ ​new ​keygenerator(​WID​, U ​ ID​, V​ ID​, h​ ours​, c​ urrtime​);
S ​ tring demail = ​ ​kg​.extractdemail(​WID​);
​String vemail = ​ ​kg​.extractvemail(​WID​);
​out​.println(​"<br><br>driver email address : " + ​ ​demail​);
o​ ut​.println(​"<br><br>driver email address : " + ​ ​vemail​);
o​ ut​.println(​"keys generated :<br><br>"​);
​int ​sk1 = ​ ​kg​.generatesk1(​VID​, U ​ ID​, h​ ours​, c​ urrtime​);
​int ​sk2 = ​ ​kg​.generatesk2(​UID​, V ​ ID​);
​out​.println(​"sk1 : " + ​ ​sk1​);
​out​.println(​"sk2 : " + ​ ​sk2​);
​out​.println(​"<br><br>sending the mail "​);
​send_mail_keys_driver sm = ​ send_mail_keys_driver(​WID​, s​ k1​, s​ k2​, d​ email​);
s​ end_mail_keys_driver sm2 = ​ send_mail_keys_driver(​WID​, 0​ ,​ s​ k2​, v​ email​);
o​ ut​.print(​"<br><br><a
href='http://localhost:8092/informationhighway_server/homepageadmin.html'>HOME</a>"​);
} f​ inally {​
​out​.close();
}
o​ ut​.print(​"</body>"​);
}

@​ Override
​protected void d​ oGet​(​HttpServletRequest r​ equest, H ​ ttpServletResponse ​response)
t​ hrows S
​ ervletException​, I​ OException ​{
​try {​
processRequest(request, response);
} ​catch ​(​ClassNotFoundException ​ex) {
​Logger​.​getLogger​(​sessionsending​.c​ lass​.getName()).log(​Level​.​SEVERE​, n​ ull​, ex);
} ​catch ​(​InstantiationException e​ x) {
​Logger​.​getLogger​(​sessionsending​.c​ lass​.getName()).log(​Level​.​SEVERE​, n​ ull​, ex);
} ​catch ​(​IllegalAccessException e​ x) {
​Logger​.​getLogger​(​sessionsending​.c​ lass​.getName()).log(​Level​.​SEVERE​, n​ ull​, ex);
}
}

75
​@Override
​protected void d​ oPost​(​HttpServletRequest ​request, H ​ ttpServletResponse ​response)
t​ hrows S
​ ervletException​, I​ OException ​{
​try {​
processRequest(request, response);
} ​catch ​(​ClassNotFoundException ​ex) {
​Logger​.​getLogger​(​sessionsending​.c​ lass​.getName()).log(​Level​.​SEVERE​, n​ ull​, ex);
} ​catch ​(​InstantiationException e​ x) {
​Logger​.​getLogger​(​sessionsending​.c​ lass​.getName()).log(​Level​.​SEVERE​, n​ ull​, ex);
} ​catch ​(​IllegalAccessException e​ x) {
​Logger​.​getLogger​(​sessionsending​.c​ lass​.getName()).log(​Level​.​SEVERE​, n​ ull​, ex);
}
}

​@Override
​public ​String g​ etServletInfo​() {
​return ​"Short description"​;
}​// </editor-fold>

​public ​String ​get_demailaddress​(i​ nt ​UID) t​ hrows ​ClassNotFoundException​, ​InstantiationException​,


IllegalAccessException​, S ​ QLException {​
​StringBuffer workstmt = ​ n​ ew ​StringBuffer();
​String qry ​= n​ ull​;
t​ ry {​
​Class​.​forName(​ ​"com.mysql.jdbc.Driver"​).newInstance();
// java.sql.Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/informationhighway?" +
"user=root&password=altanai22");
// DriverManager.registerDriver(new org.gjt.mm.mysql.Driver() );
​dbconnection d​ b ​= ​new d​ bconnection();
​java.sql.Connection conn = ​ d​ b​.getConnection();
​java.sql.PreparedStatement pstmt = ​ ​conn​.prepareStatement(​"select demail from driver where UID=?)"​);
/​ /java.sql.PreparedStatement pstmt= conn.prepareStatement("select * from info_driver");
​pstmt​.setInt(​1,​ UID);
​java.sql.ResultSet rs = ​ ​pstmt​.executeQuery();
​while (​ ​rs​.next()) {
​StringBuffer append = ​ w​ orkstmt​.append(​rs​.getInt(​"UID"​) + ​"|" +
​ ​rs​.getString(​"dfirstname"​) + "​ |" +

rs​.getInt(​"dmobnumber"​) + "​ <br>"​);
}
} ​catch ​(​SQLException e​ x) {
​System​.​out​.println(​"driver_info querry not executed"​);
ex.printStackTrace();
}
​return ​workstmt​.toString();
}

​public ​String ​get_vemailaddress​(i​ nt ​VID) t​ hrows ​ClassNotFoundException​, ​InstantiationException​,


IllegalAccessException​, S ​ QLException {​
​StringBuffer workstmt = ​ n​ ew ​StringBuffer();
​String qry ​= n​ ull​;
t​ ry {​
​Class​.​forName(​ ​"com.mysql.jdbc.Driver"​).newInstance();
/​ / java.sql.Connection conn =
DriverManager.getConnection("jdbc:mysql://localhost/informationhighway?" +
"user=root&password=altanai22");
// DriverManager.registerDriver(new org.gjt.mm.mysql.Driver() );
76
​dbconnection d​ b ​= ​new d​ bconnection();
​java.sql.Connection conn = ​ d​ b​.getConnection();
​java.sql.PreparedStatement pstmt = ​ ​conn​.prepareStatement(​"select demail from driver where UID=?)"​);
/​ /java.sql.PreparedStatement pstmt= conn.prepareStatement("select * from info_driver");
​pstmt​.setInt(​1,​ VID);
​java.sql.ResultSet rs = ​ ​pstmt​.executeQuery();
​while (​ ​rs​.next()) {
​StringBuffer append = ​ w​ orkstmt​.append(​rs​.getInt(​"UID"​) + ​"|" +
​ ​rs​.getString(​"dfirstname"​) + "​ |" +

rs​.getInt(​"dmobnumber"​) + "​ <br>"​);
}
} ​catch ​(​SQLException e​ x) {
​System​.​out​.println(​"driver_info querry not executed"​);
ex.printStackTrace();
}
​return ​workstmt​.toString();
}
}

KEY GENERATOR
package c​ ontroller​;

import ​db.dbconnection;

import ​java.sql.DriverManager​;
import ​java.sql.SQLException​;
import ​java.util.Random​;

public class k​ eygenerator ​{


​int W ​ ID​, U ​ ID​, V
​ ID​, c​ urrtime​, e​ lasptime​, h​ ours​, r​ ndnumber​;
​int s​ k1​, s​ k2​;
​String ​demail​, v​ email​;

p​ ublic ​keygenerator​(i​ nt ​WID, i​ nt ​UID, i​ nt ​VID, i​ nt ​hours, ​int ​currtime) {


​this​.​WID = ​ WID;
​this​.​UID = ​ UID;
​this​.​VID = ​ VID;
​this​.​hours = ​ hours;
t​ his​.​currtime ​= currtime;

​ andom rndgenerator ​= n​ ew ​Random();


R
​for ​(​int i​ = ​1;​ i <= 2​ ;​ ++i) {
​rndnumber = ​ ​rndgenerator​.nextInt(​100​);
}
}

​public int g​ eneratesk1​(​int ​VID, i​ nt ​UID, i​ nt ​hours, ​int c​ urrtime) {


s​ k1 ​= VID * UID * hours * currtime;
s​ k1 ​= s​ k1 *​ r​ ndnumber​;
​System​.​out​.println(​rndnumber​);
​System​.​out​.println(​sk1​);
​return ​sk1​;
}

77
​public int g​ eneratesk2​(​int ​UID, i​ nt ​VID) {
​sk2 ​= VID * UID * (​rndnumber ​^ 2​ )​ ;
​System​.​out​.println(​sk2​);
​return ​sk2​;
}

p​ ublic ​String ​extractdemail​(​int ​WID) t​ hrows C ​ lassNotFoundException​, I​ nstantiationException​,


IllegalAccessException {​
​String qry ​= n​ ull​;
t​ ry {​
​Class​.​forName(​ ​"com.mysql.jdbc.Driver"​).newInstance();
​java.sql.Connection conn ​= ​DriverManager​.​getConnection(​ ​"jdbc:mysql://localhost/informationhighway?" ​+
"user=root&password=altanai22"​);
​DriverManager​.​registerDriver(​ ​new o​ rg.​gjt.mm.mysql.Driver());
j​ ava.sql.PreparedStatement pstmt ​= c​ onn​.prepareStatement(​"select demail from driver where UID=(Select
UID from work_pending where WID=?)"​);
​pstmt​.setInt(​1,​ WID);
​java.sql.ResultSet rs = ​ ​pstmt​.executeQuery();
​demail = ​ ​rs​.getString(​"demail"​);
} ​catch ​(​SQLException e​ x) {
ex.printStackTrace();
}
​return ​demail​;
}

​public ​String ​extractvemail​(​int ​WID) t​ hrows C ​ lassNotFoundException​, I​ nstantiationException​,


IllegalAccessException {​
​String qry ​= n​ ull​;
t​ ry {​
​Class​.​forName(​ ​"com.mysql.jdbc.Driver"​).newInstance();
​java.sql.Connection conn ​= ​DriverManager​.​getConnection(​ ​"jdbc:mysql://localhost/informationhighway?" ​+
"user=root&password=altanai22"​);
​DriverManager​.​registerDriver(​ ​new o​ rg.​gjt.mm.mysql.Driver());
j​ ava.sql.PreparedStatement pstmt ​= c​ onn​.prepareStatement(​"select vemail from vehicle where VID=(Select
VID from work_pending where WID=?)"​);
​pstmt​.setInt(​1,​ WID);
​java.sql.ResultSet rs = ​ ​pstmt​.executeQuery();
​vemail = ​ ​rs​.getString(​"vemail"​);
} ​catch ​(​SQLException e​ x) {
ex.printStackTrace();
}
​return ​demail​;
}

​public int e​ xtractUID​(i​ nt ​WID) t​ hrows ​ClassNotFoundException​, I​ nstantiationException​, ​IllegalAccessException


{
​String qry ​= n​ ull​;
t​ ry {​
​Class​.​forName(​ ​"com.mysql.jdbc.Driver"​).newInstance();
​java.sql.Connection conn ​= ​DriverManager​.​getConnection(​ ​"jdbc:mysql://localhost/informationhighway?" ​+
"user=root&password=altanai22"​);
​DriverManager​.​registerDriver(​ ​new o​ rg.​gjt.mm.mysql.Driver());
j​ ava.sql.PreparedStatement pstmt = ​ ​conn​.prepareStatement(​"select UID from work_pending from WID=?"​);
p​ stmt​.setInt(​1,​ WID);
​java.sql.ResultSet rs = ​ ​pstmt​.executeQuery();
78
​UID ​= r​ s​.getInt(​"UID"​);
} ​catch ​(​SQLException e​ x) {
ex.printStackTrace();
}
​return ​UID​;
}

​public int e​ xtractVID​(i​ nt ​WID) t​ hrows ​ClassNotFoundException​, I​ nstantiationException​, ​IllegalAccessException


{
​String qry ​= n​ ull​;
t​ ry {​
​Class​.​forName(​ ​"com.mysql.jdbc.Driver"​).newInstance();
​java.sql.Connection conn ​= ​DriverManager​.​getConnection(​ ​"jdbc:mysql://localhost/informationhighway?" ​+
"user=root&password=altanai22"​);
​DriverManager​.​registerDriver(​ ​new o​ rg.​gjt.mm.mysql.Driver());
j​ ava.sql.PreparedStatement pstmt ​= c​ onn​.prepareStatement(​"select VID from work_pending where WID=
?"​);
p​ stmt​.setInt(​1,​ WID);
​java.sql.ResultSet rs = ​ ​pstmt​.executeQuery();
​VID ​= r​ s​.getInt(​"VID"​);
} ​catch ​(​SQLException e​ x) {
ex.printStackTrace();
}
​return ​VID​;
}

​public void m ​ ain​(​String​[] args) t​ hrows S ​ QLException​, C​ lassNotFoundException​, ​InstantiationException​,


IllegalAccessException {​
​String qry ​= n​ ull​;
C ​ lass​.​forName(​ ​"com.mysql.jdbc.Driver"​).newInstance();
dbconnection d​ b ​= ​new d​ bconnection();
​java.sql.Connection conn = ​ d​ b​.getConnection();
​java.sql.PreparedStatement pstmt = ​ ​conn​.prepareStatement(​"inser into work_confirmed values(?,?,?,?,?,?,?)"​);
​pstmt​.setInt(​1,​ W ​ ID​);
​pstmt​.setInt(​2,​ U ​ ID​);
p​ stmt​.setInt(​3,​ V ​ ID​);
p​ stmt​.setInt(​4,​ s​ k1​);
​pstmt​.setInt(​5,​ s​ k2​);
​pstmt​.setInt(​6,​ h​ ours​);
​java.sql.ResultSet rs = ​ ​pstmt​.executeQuery();
​java.sql.PreparedStatement pstmt2 = ​ ​conn​.prepareStatement(​"delete from work_pending where WID=?"​);
​pstmt2​.setInt(​1,​ W ​ ID​);
​java.sql.ResultSet rs2 = ​ ​pstmt​.executeQuery();
}
}

WORK DETAILS

​ iew​;
package v

import ​javax.annotation.​Resource​;
79
import ​javax.servlet.ServletException​;
import ​javax.servlet.http.HttpServlet​;
import ​javax.servlet.http.HttpServletRequest​;
import ​javax.servlet.http.HttpServletResponse​;
import ​javax.sql.DataSource​;
import ​java.io.IOException​;
import ​java.io.PrintWriter​;
import ​java.sql.DriverManager​;
import ​java.sql.SQLException​;
import ​java.util.logging.Level​;
import ​java.util.logging.Logger​;

public class ​work_confirmed ​extends H ​ ttpServlet {​


​ Resource​(name = ​"informationhighway"​)
@
p​ rivate ​DataSource i​ nformationhighway​;

​ rotected void ​processRequest​(​HttpServletRequest r​ equest, ​HttpServletResponse r​ esponse) ​throws


p
ServletException​, ​IOException​, ​SQLException {​
response.setContentType(​"text/html;charset=UTF-8"​);
​ rintWriter out =
P ​ response.getWriter();
​String result​;
t​ ry ​{
o ​ ut​.println(​"<body bgcolor='tan'>"​);
​out​.print(​"list of confirmed work" + ​ ​"<br>"​);
o​ ut​.println(​"UID" + ​ "​ | " ​+ ​"VID" + ​ ​" | " + ​ ​"sk1" + ​ ​" | " + ​ ​"sk2" ​+ ​" | " +
​ ​"hours" ​+ "​ | " ​+
"startstamp" + ​ ​"<br>"​);
o ​ ut​.println(​"-----------------------------------------------------------------------" +
​ ​"<br>"​);
​result = ​ get_work_info();
​out​.print(​result​);
​out​.print(​" <a
href='http://localhost:8092/informationhighway_server/homepageadmin.html'>GO TO HOME</a>" ​+
"<br><br>"​);
​out​.print(​" <a
href='http://localhost:8092/informationhighway_server/registrationpage_work.html'>ADD NEW
WORK DESCRIPTION</a>"​);
​out​.println(​"</body>"​);
} ​catch ​(E ​ xception ​e) {
e.printStackTrace();
} ​finally ​{
o​ ut​.close();
}
}

@​ Override
​protected void ​doGet​(​HttpServletRequest r​ equest, H ​ ttpServletResponse ​response)
​throws S ​ ervletException​, ​IOException {​
​try ​{
processRequest(request, response);
} c​ atch ​(S
​ QLException ​ex) {
​Logger​.​getLogger(​ w
​ ork_allocated​.​class​.getName()).log(​Level​.​SEVERE​, n
​ ull​, ex);
}
}

@​ Override
​protected void ​doPost​(H
​ ttpServletRequest r​ equest, ​HttpServletResponse ​response)
80
​throws S ​ ervletException​, ​IOException {​
​try ​{
processRequest(request, response);
} c​ atch ​(S
​ QLException ​ex) {
​Logger​.​getLogger(​ w
​ ork_allocated​.​class​.getName()).log(​Level​.​SEVERE​, n
​ ull​, ex);
}
}

@​ Override
​public S ​ tring ​getServletInfo​() {
r​ eturn "​ Short description"​;
}

​ ublic S
p ​ tring ​get_work_info​() t​ hrows ​ClassNotFoundException​, ​InstantiationException​,
IllegalAccessException ​{
t​ ry ​{
C ​ lass​.​forName​("​ com.mysql.jdbc.Driver"​).newInstance();
​java.sql.Connection conn ​=
DriverManager​.​getConnection​("​ jdbc:mysql://localhost/informationhighway?" ​+
"user=root&password=altanai22"​);
​DriverManager​.​registerDriver​(n ​ ew ​org.​gjt.mm.mysql.Driver());
​java.sql.PreparedStatement pstmt ​= ​conn​.prepareStatement(​"select ​*​ from work_confirmed"​);
j​ ava.sql.ResultSet rs ​= p ​ stmt​.executeQuery();
​while (​ r​ s​.next()) {
​ tringBuffer append ​= workstmt.append(​rs​.getInt(​"UID"​) + ​" | " ​+ r​ s​.getInt(​"VID"​) + ​" | " ​+
S
rs​.getInt(​"sk1"​) + ​" | " ​+ ​rs​.getInt(​"sk2"​) + ​" | "
​ ​rs​.getInt(​"hours"​) + ​" | " ​+ r​ s​.getTimestamp(​"startstamp"​) + "​ <br>"​);
+
}
} ​catch ​(S ​ QLException ​ex) {
ex.printStackTrace();
}
r​ eturn w ​ orkstmt.toString();
}
}

8.2. Screen Shots

Home Page

81
Figure 13 :Homepage

The first page displayed when the application is run. User chooses his
mode of login from either admin login or visitor login. If the visitor does not
have an account yet ,he chooses the sign up option to create an account . To
submit feedback he chooses the Feedback option.

Login Visitor page

82
Figure 14. Login visitor page

Supply username and password to login . access is granted if the


particulars matches with the one stored in the database leading to next page,
otherwise error message is displayed as login failed , check username or
pasword. Three tries are given.

83
Visitors Menu Page

Figure 15. Visitors menu page.

The menu options are – hire a vehicle, check work status, check driver
information, check vehicle information and map the vehicle to locate its
whereabouts.

84
Visitors vehicle hire page

Figure 16. Visitors vehicle hire page

Form to fill up work description such as pick up ime , drop down time ,
source ,destination , date , purpose , the address,contact number and email
address of the person booking the vehicle etc. Also the user must already have
an account to avail the service..

85
Admin Menu page

Figure 17. Admin Menu page

The option includes- check details of vehicle , driver , visitors and


company , checking details of work that is pending, confirmed, allocated or
active ,sending a report to driver urgently, mapping the vehicle , issuing keys
etc.

86
Drivers Registration Page

Figure 18. Drivers Registration page

Form to fill up particulars of driver such as name ,age , phone number ,


email , address along with house number , street name , city and pinno , also his
date of joining , language spoken is registered with a unique id called UID. The
fields are validated for correctness before storing them in the database.

87
Vehicle registeration Page

Figure 19. Vehicle registration page

Form to fill up particulars of vehicle such as type ,model , mobile


number , email that is allotted to it. Also the date of purchase is registered with a
unique id called VID. The fields are validated for correctness before storing
them in database.

88
Verifying the Key Request

Figure 20. Verifying the key request

Here the administrator specifies the work id , driver id , vehicle id to


allocate a set of session keys for them, session starting from the current time
onwards and expiring after the hours duration value in hours fields is met.

89
Location tracking

Figure 21. Location tracking page

The position of vehicle at a given time can be mapped with the help of
GPS coordinates sent by the vehicle and traced over GIS.

90
Feedback

Figure 22. Feedback

Feedback Form is an effective means of extracting the users view ,


appreciation, criticism and scope for improvement. The user supplies his/her

91
name , address(optional) and email address along with the message before
submitting.

Mobile Menu for driver’s application

Figure 23.Menu for driver screen

Connecting to server
92
Figure 24.Connecting to server

93
Requesting key from admin

Figure 25.Requesting key from admin

Alert for request mailed

94
Figure 26. Alert for request mailed

95
Checking the server supplied session keys

Figure 27.Checking the server supplied session key

96
Connecting to vehicle’s mobile through Bluetooth

Figure 28.Connecting to vehicles mobile through bluetooth

97
Alert for connecting to vehicle ‘s mobile successfully through bluetooth

Figure 29. Alert for connecting to vehicles mobile successfully

Reporting any problems

98
Figure 30.Reporting any problem

99
Composing mail from Mobile

Figure 31.Composing mail from Mobile

100
Alert for mail send successfully

101
Figure 32. Alert for mail send successfully

Mobile Menu on vehicle

Figure 33.Mobile menu on vehicle

102
Extracting key from Driver and Sending to server for authentication

Figure 34.Extracting key from driver and sending to server for authentication

103
9. References
[1] Cascading Style Sheet, http://www.w3.org/Style/CSS, 2005.
[2] Deitel-Internet and world wide web how to program
[3] Pen Cheng, Shuang Liu- Intelligent Vehicle Monitoring System Based on GPS,
GSM and GIS- 2010 WASE International Conference on Information Engineering
[4] Robin Chase-The Grid, Our Cars and the Net: One Idea to Link Them All
[5] Sensay system-Next Generation Wireless Vehicle Detection
[6] Vehicular computing – Wikipedia, the free encyclopaedia.
[7] Wolfgang Bott -MOST150: Concept of multimedia networking in vehicles.
[8] B. G. Nagaraja, R. Rayappa, M. Mahesh, C. M. Patil and T. C. Manjunath,
"Design & Development of a GSM Based Vehicle Theft Control System," 2009
International Conference on Advanced Computer Control, Singapore, 2009, pp.
148-152, doi: 10.1109/ICACC.2009.154.
[9] Yougui Liu and Baoxing Bai, "Research on GPRS vehicle location network
service system," 2010 International Conference on Computer, Mechatronics,
Control and Electronic Engineering, Changchun, 2010, pp. 401-404, doi:
10.1109/CMCE.2010.5610118.
[10 L. Robert, N. Pissinou and S. Makki, "Third generation wireless network: the
integration of GSM and Mobile IP," 2000 IEEE Wireless Communications and
Networking Conference. Conference Record (Cat. No.00TH8540), Chicago, IL,
2000, pp. 1291-1296 vol.3, doi: 10.1109/WCNC.2000.904818.

104

You might also like