Information Highway Bachelor of Technolo
Information Highway Bachelor of Technolo
Information Highway Bachelor of Technolo
A PROJECT REPORT
Submitted by
BACHELOR OF TECHNOLOGY
in
INFORMATION TECHNOLOGY
BONAFIDE CERTIFICATE
SIGNATURE SIGNATURE
2
CERTIFICATE OF EVALUATION
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.
3
ABSTRACT
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
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
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
5
Table of Contents
CHAPTER INTRODUCTION 10
3.1.3 Multithreading 17
3.1.4 Swing 17
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
9. References 108
6
List of Figures
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
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
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
10
● Glassfish Web Server
● Windows XP/vista/7
● Symbian OS in Mobile
● SQL Server
● Bluetooth
● Internet connection
● 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.
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.
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.
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.
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
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.
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
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.
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
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.
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.
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.
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
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).
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.
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
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
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
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.
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
33
4.2.3 Sequence diagram
4.2.3.1 Sequence diagram for authentication
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
36
Sequence details for clients booking the vehicles and checking the details of
associated driver and vehicle as per their work id.
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
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 ,
provided by the system, hence they have to register with their vital particualrs such
question.
system work registration form with details mentioning date , source , destination,
40
5.1.4 Driver key request registration
request to the server supplying his unique driver id , vehicle unique id and
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.
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.
components and connection to the email service provider using specific hostname
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.
Extracting the captured GPS coordinates (latitude, longitude) with the help
The coordinates are supplied to the server frequently using email service.
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 ,
43
CHAPTER 5
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.
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.
Execute all lops at their boundaries and within their operational bounds
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.
48
system under consideration. All relevant project documents relating to the
system functionality and design are desirable.
49
6.3.5 Flow Graphs
Graph theory algorithms can be applied to these graph matrices to help in the
analysis necessary to produce the basis set.
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
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.
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
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.
55
CHAPTER 7
CONCLUSION
Future enhancements
56
CHAPTER 8
APPENDIX
8.1 Coding
Login page
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: 293px; left: 526px;">
<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> </p>
<p> </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"/>
<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;
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();
}
}
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.*;
EMAIL CODE
67
package c ontroller;
import javax.mail.*;
import javax.mail.internet.*;
import java.security.Security;
import java.util.*;
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;
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;
71
} finally {
out.close();
}
}
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;
@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";
}
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;
@ 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>
KEY GENERATOR
package c ontroller;
import db.dbconnection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Random;
77
public int g eneratesk2(int UID, i nt VID) {
sk2 = VID * UID * (rndnumber ^ 2 ) ;
System.out.println(sk2);
return sk2;
}
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;
@ 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();
}
}
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.
82
Figure 14. Login visitor page
83
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
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
86
Drivers Registration Page
87
Vehicle registeration Page
88
Verifying the Key Request
89
Location tracking
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
91
name , address(optional) and email address along with the message before
submitting.
Connecting to server
92
Figure 24.Connecting to server
93
Requesting key from admin
94
Figure 26. Alert for request mailed
95
Checking the server supplied session keys
96
Connecting to vehicle’s mobile through Bluetooth
97
Alert for connecting to vehicle ‘s mobile successfully through bluetooth
98
Figure 30.Reporting any problem
99
Composing mail from Mobile
100
Alert for mail send successfully
101
Figure 32. Alert for mail send successfully
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