Anda di halaman 1dari 57

Smartphone Local Ticketing Application

Submitted in partial requirementsof the degree of

Bachelor of Engineering
by
Bhakti Anekar(Roll No.:05)
Neelay Upadhyaya(Roll No.:76)
Yash Sanghavi(Roll No.:59)

under the guidance of


Supervisor:
Prof.Kailas Devadkar

Information Technology

Sardar Patel Institute of Technology


2013-2014

Project Report Approval for B. E.


This project report entitled Smartphone Local Ticketing Application by
Bhakti anekar, Neelay Upadhyaya, Yash Sanghavi is approved for the degree
of Bachelor of Engineering in Information Technology

Examiners
1. ---------------------------------------2. -----------------------------------------

Supervisors
1. ----------------------------------------2. -----------------------------------------

Chairman

--------------------------------------------Date:
Place:

Declaration
We declare that this written submission represents our ideas in our own
words and where others' ideas or words have been included, we have adequately
cited and referenced the original sources. We also declare that we have adhered
to all principles of academic honesty and integrity and have not misrepresented
or fabricated or falsified any idea/data/fact/source in our submission. We
understand that any violation of the above will be cause for disciplinary action
by the Institute and can also evoke penal action from the sources which have
thus not been properly cited or from whom proper permission has not been
taken when needed.

----------------------------------(Bhakti Anekar-05)

----------------------------------

(Neelay Upadhyaya-76)

---------------------------------(Yash Sanghavi-59)

Abstract
One of the biggest challenges in the current ticketing facility is QUEUE in buying our suburban
railway tickets. E-ticket facility was introduced where users browse through a government website
and book their long journey railway tickets which can be printed out after confirmation to show
it to the checker when needed and also a new technology called M-ticketing (Mobile Ticketing)
was introduced where customers messaged to the web portal through mobile phones after which
a complete web page download to the mobile phone where users can do the same booking process
as it was in the e-ticketing facility. In foreign countries Oyster cards Octopus card has become
mandatory during travel. In this fast growing world of technology we still stand in the queue or
buy with smart cards or coupons our suburban tickets, which is more frustrating at times to stand
in the queue or if we forget our cards.This application Smartphone Ticketing Application(STA)
ticketing is mainly to buy the suburban tickets which is the most challenging when compared to
booking the long journey tickets through M-ticket which fails with suburban(local travel) tickets.
Our STA ticket can be bought with just a smart phone application, where you can carry your
suburban railway tickets in your smart phone. It uses the smart phones GPS facility to validate
and delete your ticket automatically after a specific interval of time once the user reaches the
destination. Users ticket information is stored in a distributed database for security purpose
which is missing in the present suburban system. Also the ticket checker is provided with a
checker application to search for the users ticket with the ticket number in distributed database
for checking purposes.

Contents
List of Figures

iii

Glossary

iv

1 Introduction
1.1 Problem Definition . . . . . . . .
1.2 Scope . . . . . . . . . . . . . . .
1.3 Existing System . . . . . . . . . .
1.4 Proposed System . . . . . . . . .
1.5 Assumptions and Constraints . .
1.5.1 Assumptions . . . . . . . .
1.5.2 Constraints . . . . . . . .
1.6 System Requirements . . . . . . .
1.6.1 Software . . . . . . . . . .
1.6.2 Hardware . . . . . . . . .
1.6.3 Web Server Requirements

.
.
.
.
.
.
.
.
.
.
.

1
1
1
2
2
2
2
2
3
3
3
3

2 Literature Review
2.1 Selecting Android as a Development Platform . . . . . . . . . . . . . . . . . . . . .
2.2 Analyzing the Railways Website . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.3 IEEE paper on Android Suburban Railway Ticketing with GPS as Ticket Checker .

4
4
4
5

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

3 Methodology
3.1 Analysis . . . . . . . . . . . . . . . . . . . . .
3.1.1 Use Case Diagram . . . . . . . . . . .
3.1.2 Activity Diagram for passenger . . . .
3.1.3 Activity Diagram for ticket checker . .
3.1.4 Sequence Diagram . . . . . . . . . . .
3.1.5 Collaboration Diagram . . . . . . . . .
3.1.6 StateChart Diagram for passenger . . .
3.1.7 StateChart Diagram for Ticket checker
3.1.8 Class Diagram . . . . . . . . . . . . . .
3.2 Design . . . . . . . . . . . . . . . . . . . . . .

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

6
6
6
8
9
10
11
12
13
14
15

3.3

3.2.1 Block Diagram . . . . . . .


3.2.2 Architecture Diagram . . . .
Implementation . . . . . . . . . . .
3.3.1 Technology used . . . . . .
3.3.2 Work Breakdown Structure
3.3.3 Method Description . . . . .

4 Results
4.1 Sample Code for key scenarios
4.1.1 User Functions . . . .
4.1.2 Tracker Fragment . . .
4.1.3 QRcode Fragment . . .
4.1.4 Booked History Log . .
4.1.5 Insert into log . . . . .
4.2 Test cases . . . . . . . . . . .
4.3 Results Snapshots . . . . . . .

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.

15
16
16
16
18
19

.
.
.
.
.
.
.
.

20
20
20
21
25
26
27
29
30

5 Conclusion and Future Work

36

Appendix - Algorithms

37

References

38

Acknowledgements

49

ii

List of Figures
2.1

Comparison of Operating System . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3.1
3.2
3.3
3.4
3.5
3.6
3.7
3.8
3.9
3.10
3.11

Use Case Diagram . . . . . . . . . . .


Activity Diagram for passengers . . . .
Activity Diagram for Ticket checker . .
Sequence Diagram . . . . . . . . . . .
Collaboration Diagram . . . . . . . . .
StateChart Diagram for passenger . . .
StateChart Diagram for Tickte checker
Class Diagram . . . . . . . . . . . . . .
Block Diagram . . . . . . . . . . . . .
Architecture Diagram . . . . . . . . . .
Work Breakdown Structure . . . . . .

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

6
8
9
10
11
12
13
14
15
16
18

4.1
4.2
4.3
4.4
4.5
4.6
4.7
4.8
4.9
4.10
4.11
4.12

Test Cases . . . . .
Registration . . . .
User Login . . . . .
User Profile . . . .
Edit Profile . . . .
Menu . . . . . . . .
Application Popup
Book Ticket . . . .
Book Ticket . . . .
Passenger Details .
Journey Tracker . .
QR image . . . . .

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

29
30
31
31
32
32
33
33
34
34
35
35

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

iii

Abbreviations
STA Smartphone Ticketing Application.
QR QUick Response.
MB Megabyte.
GPS Global Positioning System.
SDK Software Development Kit.
GHz Gigahertz.
ms milliseconds.

iv

Chapter 1
Introduction
1.1

Problem Definition

One of the biggest challenges in the current ticketing facility is the WAITING QUEUE in buying
our suburban railway tickets. With Mumbai being highly populated city, the queues are really long
as local trains are the most common mode for transport. It is very time consuming. Alternatives
such as Coupons and Smart Cards are still not effective. With this application we will be able to
overcome many of its limitations and will be able to make it more efficient.
Smart-phone Ticketing Application(STA) is mainly to buy the suburban ticket.Our Smartphone ticket can be bought with just a smart phone.It uses the smart phones GPS facility to
validate ticket automatically with ease. This application is developed specially for smartphone
users since studies say that almost 50makes use of Smartphones and also almost 80

1.2

Scope

This Smart-phone Local Ticketing application is build for Android platform. This application
Smart-phone Ticketing Application(STA) ticketing is mainly to buy the suburban tickets which
is the most challenging when compared to booking the long journey tickets through M-ticket
which fails with suburban(local travel) tickets. It allows the passenger to buy local train ticket
for Mumbai Suburbs which includes Central, Western and Harbor Railways using the application
on their smart-phone. The GPS facility in the Smart-phone acts as a ticket checker. It uses the
smart phones GPS facility to validate and delete your ticket automatically after a specific interval
of time once the user reaches the destination. Users ticket information is stored in a distributed
database for security purpose which is missing in the present suburban system. Also the ticket
checker is provided with a checker application to search for the users ticket with the ticket number
in distributed database for checking purposes.The application is developed for Android platform
as the number of Android users is more compared to Blackberry and iOS users.The user can book
tickets for Western and Central Railways.He can buy a maximum of four tickets at one time.The
GPS facility in the phone acts as a journey tracker.The application allows the passengers to buy
First class or Second class tickets according to convenience.The QR image of the ticket is generated
which consists of user information and ticket information.The ticket checker can scan the QR image
and can check the ticket through it.The GPS facility acts as a ticket checker and invalidates a ticket

after crossing particular destination.

1.3

Existing System

E-ticket facility is currently available only for the long journey railway tickets. The current website
such as irctc.com is widely used for booking long journey tickets in India. But there is no such
facility for booking tickets for Mumbai local trains. A new technology called M-ticketing (Mobile
Ticketing) In foreign countries Oyster cards Octopus card has become mandatory during travel.
And facilities like Coupons and Smart Cards are available currently. We suffer if we forget our
travel cards and we then stand in the Queue for our local suburban tickets.

1.4

Proposed System

Smartphone Ticketing Application(STA) is mainly to buy the suburban tickets. Our Smartphone
ticket with just using a smartphone. The user will have to create an account through this application. Using this account, when the user enters in the circumference of a nearby railway station ,
a pop-up notification will be received. Only after then the user is able to book the railway ticket.
The Smartphone Ticketing Application uses the phones GPS facility to validate the ticket and
track the journey. At the time of booking GPS checks the source station name and then validates
the ticket. Also it keeps a track of the journey. If the user crosses the destination station the ticket
is automatically deleted. When the ticket is booked , the time of booking is recorded and timer
will be started. Using the GPS , after an hour if the journey is not started the ticket will deleted
and of no use. Also the user cannot book the railway ticket if the fare of the ticket is more than
the balance available in the phone. This Application will be used to overcome the limitations of
long queues and less time consuming.

1.5
1.5.1

Assumptions and Constraints


Assumptions

The user should have an Android smartphone with an active data plan.
The balance in the users account should not be less than the ticket fare.
The battery of the phone must be more than 20
The GPS system is turned on.

1.5.2

Constraints

It should take less than 2 second for local transactions.


The network transactions should happen within 3 seconds.
The application should be capable of providing transaction for 24 hrs per day.

1.6
1.6.1

System Requirements
Software

Operating System : Android


Language : minimum ANDROID SDK 2.3
Back End : MySQL

1.6.2

Hardware

Processor : 800 GHz


RAM : 512 MB

1.6.3

Web Server Requirements

A web server with approx 100 GB of available disk space.


A web server that supports PHP, such as Apache or Internet Information Server
PHP 4.1.0 or higher
Database Support:MySql 5.0 or higher if using PHP MySQL client API 5.0 or higher

Chapter 2
Literature Review
2.1

Selecting Android as a Development Platform

Mobile operating systems have clearly amassed a fat chunk of the smartphone market, plus a lot of
users down the line, with tech giants like Google and Apple at the top of the food chain. Research
firm IDCs top operating systems based on worldwide smartphone unit sales and market share in
the third quarter of 2012.

Figure 2.1: Comparison of Operating System

2.2

Analyzing the Railways Website

Surveying the basic railway-based sites like www.mttnow.com, www.irctc.co.in the following conclusion was derived. The user had the ability of booking tickets through the internet but the user
could not book tickets through their mobile phones directly. Also there was no facility to book
local suburban railway tickets through any websites .So the understanding from the survey is that
even though the internet is a medium through which people can book their railway tickets but due
to lack of facility to book local railway tickets and also booking tickets using smart-phone there
is a need to develop a smart-phone application to book railway tickets and also use GPS as ticket
checker.

2.3

IEEE paper on Android Suburban Railway Ticketing


with GPS as Ticket Checker

The study of this paper as reference helped analyze how a smartphone can be used to book local
railway tickets.Understanding from the survey is that even though the internet is a medium through
which people can book their railway tickets but due to lack of facility to book local railway tickets
and also booking tickets using smartphone there is a need to develop a smartphone application to
book railway tickets and also use GPS as ticket checker.
GENERATING QR CODE:
Once the php code generates the ticket number and time of buy the details saved in the MySQL
database are sent to Google Chart API engine in order to generate the QR code. here all the
personal and ticket information are converted into QR codes and sent back to the user mobile as
HTTP response and saved in the application memory.
GPS TICKET VALIDATION:
GPS plays the role of the checker, where when the user buys the ticket, the source geopoints,
destination geopoints,ticket type, expiry time date are stored in a mobile SQLite database. This
service checks the users current location in accordance with the destination geopoints, after which
the ticket type is checked and accordingly the ticket is deleted if two is single or updated if type
is return.[8]

Chapter 3
Methodology
3.1
3.1.1

Analysis
Use Case Diagram

Figure 3.1: Use Case Diagram

UseCase Id: 1 Name: Register Actor: Passenger Goals: To enable the user to register successfully with proper authentication process Precondition: User must have launched application Post
condition: User can see the homepage and the option to edit his profile

UseCase Id: 2 Name: Login Actor: Passenger Goals: To enable the user to login successfully
with proper authentication process Precondition: User must have launched application Post condition: User can see the homepage and the option to edit his profile
UseCase Id: 3 Name: Buy Ticket Actor: Passenger Goals: To enable user to get ticket based
on the source and destination asked Precondition: The balance must be greater than fare.
Use Case Id: 4 Name: Recharge Actor: Passenger Goals:Get the fare for the location given
Precondition: User must have launched application

3.1.2

Activity Diagram for passenger

Figure 3.2: Activity Diagram for passengers

Figure 3.2 refers to Activity Diagram for Passenger. The Passenger registers and logs into the
account. Then he can book a ticket only if he has sufficient balance.

3.1.3

Activity Diagram for ticket checker

Figure 3.3: Activity Diagram for Ticket checker

Figure 3.3 refers to Activity Diagram for Ticket Checker. The Ticket Checker logs in and
validates the ticket. If ticket is invalid he issues fine.

3.1.4

Sequence Diagram

Figure 3.4: Sequence Diagram

Figure 3.4 represents the sequence diagram. It shows the flow of activities of the Passenger,
starting from registering to booking a ticket.

10

3.1.5

Collaboration Diagram

Figure 3.5: Collaboration Diagram

Figure 3.5 shows the collaboration diagram. It represents the interaction between the entities.

11

3.1.6

StateChart Diagram for passenger

Figure 3.6: StateChart Diagram for passenger

Figure 3.6 refers to State Chart Diagram for the Passenger. It shows the different states of the
Passenger.

12

3.1.7

StateChart Diagram for Ticket checker

Figure 3.7: StateChart Diagram for Tickte checker

Figure 3.7 refers to State Chart Diagram for the Ticket Checker. It shows the different states
of the Ticket Checker.

13

3.1.8

Class Diagram

Figure 3.8: Class Diagram

Figure 3.8 refers to Class Diagram for the entire system showing interaction between different
classes.

14

3.2
3.2.1

Design
Block Diagram

Figure 3.9: Block Diagram

Technology Mapping for each block referring to Figure 3.9 is as follows:


1.Login User: Android XML
2.Get Current Location: GPS
3.Select Destination: JSON, PHP
4.Get Fare: JSON, PHP
5.Database: MySQL
6.QR image: QR generator API

15

3.2.2

Architecture Diagram

Figure 3.10: Architecture Diagram


Figure 3.10 refers to 3-tier Archictecture Diagram. 1st tier is the client side which makes use of
users smartphone. The backend is implemented in the 3rd tier and the middle tier is the business
tier which is implemented using PHP.

3.3

Implementation

3.3.1

Technology used

Technologies used are: The various technologies used:


1. JAVA
Java is a set of several computer software products and specifications from Sun Microsystems
(which has since merged with Oracle Corporation), that together provide a system for developing
application software and deploying it in a cross-platform computing environment. Java is used in
a wide variety of computing platforms from embedded devices and mobile phones on the low end,
to enterprise servers and supercomputers on the high end.[4]
2. Android
Android is a Linux-based operating system designed primarily for touch screen mobile devices
such as smart-phones and tablet computers, developed by Google in conjunction with the Open
Handset Alliance. While Android is designed primarily for smart-phones and tablets, the open and
customizable nature of the operating system allows it to be used on other electronics, including
laptops and net-books, smart-books, e-book readers, and smart TVs (Google TV). Applications

16

are usually developed in the Java language using the Android Software Development Kit, but other
development tools are available, including a Native Development Kit for applications. Applications
can be acquired by end-users either through an app store such as Google Play or the Amazon Appstore, or by downloading and installing the applications APK file from a third-party site.[4][6]
3. JSON(JavaScript Object Notation)
JSON or JavaScript Object Notation is a text-based open standard designed for human-readable
data interchange. It is derived from the JavaScript scripting language for representing simple
data structures and associative arrays, called objects. Despite its relationship to JavaScript, it is
language-independent, with parsers available for many languages. The JSON format is often used
for serializing and transmitting structured data over a network connection. It is used primarily to
transmit data between a server and web application, serving as an alternative to XML.
4. PHP
PHP is a server-side scripting language designed for web development but also used as a generalpurpose programming language. PHP is now installed on more than 244 million websites and 2.1
million web servers. Originally created by Rasmus Lerdorf in 1995, the reference implementation
of PHP is now produced by The PHP Group. While PHP originally stood for Personal Home Page,
it now stands for PHP: Hypertext Preprocessor, a recursive acronym.PHP code is interpreted by
a web server with a PHP processor module, which generates the resulting web page.
5. MySQL
The MySQL development project has made its source code available under the terms of the GNU
General Public License, as well as under a variety of proprietary agreements. MySQL was owned
and sponsored by a single for-profit firm, the Swedish company MySQL AB, now owned by Oracle
Corporation. MySQL is a popular choice of database for use in web applications, and is a central
component of the widely used LAMP open source web application software stack (and other AMP
stacks). LAMP is an acronym for Linux, Apache, MySQL, Perl/PHP/Python. Free-softwareopen source projects that require a full-featured database management system often use MySQL.

17

3.3.2

Work Breakdown Structure

Figure 3.11: Work Breakdown Structure

Figure 3.11 represents the Work Breakdwon Structure. It shows how the project is divided into
deliveriables and milestones.

18

3.3.3

Method Description

1.Register User:
User has to register before using the application. The user credentials are verified and account is
set up.
2.Login User:
User has to login before using the application. The user credentials are verified and then the user
is allowed to use the application.
3. Get Current Location:
The application uses GPS to track the current location , based on that the source of the ticket is
detected.[2]
4. Select Destination:
The user has to enter the destination to buy ticket and also to get fare.
6.Get fare:
The user can view the fare of ticket by entering the source and destination.
7.Book Ticket:
The user has to specify the destination thereby he can book the ticket. Also he has to have
sufficient balance in account.
8. Add into transaction log:
The record of the ticket is added to the database known as the transaction log.
9. Generate QR image of the ticket:
The QR image of the ticket is generated using Google QR generator API.[7]
10.Verify Ticket:
The QR image is scanned and the ticket is verified accordingly.
11.Journey Tracker:
Using the phones GPS the current location is updated at every instant, thereby tracking the entire
journey.[2]

19

Chapter 4
Results
4.1
4.1.1

Sample Code for key scenarios


User Functions

public JSONObject loginUser(String email, String password)


{
// Building Parameters
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("tag", login_tag));
params.add(new BasicNameValuePair("email", email));
params.add(new BasicNameValuePair("password", password));
JSONObject json = jsonParser.getJSONFromUrl(loginURL, params);
// return json
// Log.e("JSON", json.toString());
return json;
}
public JSONObject insertIntoLog(String email,String Source,String
Destination,Integer pass,Integer fare,String time)
{
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
nameValuePairs.add(new BasicNameValuePair("Source",Source));
nameValuePairs.add(new BasicNameValuePair("Destination", Destination));
nameValuePairs.add(new BasicNameValuePair("pass",pass.toString()));
nameValuePairs.add(new BasicNameValuePair("fare",String.valueOf(fare)));
nameValuePairs.add(new BasicNameValuePair("Time",time));
nameValuePairs.add(new BasicNameValuePair("email", email));
JSONObject json = jsonParser.getJSONFromUrl(updateLog, nameValuePairs);
return json;
}
public JSONObject registerUser(String Fname,String Lname, String email,Integer
age, Character gender, String password)
{

20

// Building Parameters
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("tag", register_tag));
params.add(new BasicNameValuePair("Fname", Fname));
params.add(new BasicNameValuePair("Lname", Lname));
params.add(new BasicNameValuePair("email", email));
params.add(new BasicNameValuePair("Age", age.toString()));
params.add(new BasicNameValuePair("Gender", gender.toString()));
params.add(new BasicNameValuePair("password", password));
// getting JSON Object
JSONObject json = jsonParser.getJSONFromUrl(registerURL, params);
// return json
return json;
}
public JSONObject updateUser(String Fname,String Lname,Integer age, Character
gender,String email)
{
// Building Parameters
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("tag", update_tag));
params.add(new BasicNameValuePair("Fname", Fname));
params.add(new BasicNameValuePair("Lname", Lname));
params.add(new BasicNameValuePair("Age", age.toString()));
params.add(new BasicNameValuePair("Gender", gender.toString()));
params.add(new BasicNameValuePair("email", email));
// getting JSON Object
JSONObject json = jsonParser.getJSONFromUrl(updateURL, params);
// return json
return json;
}

4.1.2

Tracker Fragment

private void initializeMap()


{
MarkerOptions marker;
gpsTracker = new GPSTracker(getActivity().getApplicationContext());
Log.e("daf", String.valueOf(gpsTracker.canGetLocation()));
if (gpsTracker.canGetLocation())
{
String stringLatitude = String.valueOf(gpsTracker.latitude);
String stringLongitude = String.valueOf(gpsTracker.longitude);

21

String country = gpsTracker.getCountryName(getActivity()


.getApplicationContext());
String city = gpsTracker.getLocality(getActivity()
.getApplicationContext());
String postalCode = gpsTracker.getPostalCode(getActivity()
.getApplicationContext());
String addressLine = gpsTracker.getAddressLine(getActivity()
.getApplicationContext());
} else
{ // cant get location // GPS or Network is not enabled //
gpsTracker.showSettingsAlert();
}
if (googleMap == null)
{
googleMap = ((SupportMapFragment) getFragmentManager()
.findFragmentById(R.id.map)).getMap();
// check if map is created successfully or not
if (googleMap == null)
{
Toast.makeText(getActivity().getApplicationContext(),
"Sorry! unable to create maps",
Toast.LENGTH_SHORT)
.show();
}
double source_latitude =
getActivity().getIntent().getDoubleExtra(
"lat_source", 0.00);
double source_longitude =
getActivity().getIntent().getDoubleExtra(
"lng_source", 0.00);
double dest_latitude = getActivity().getIntent().getDoubleExtra(
"lat_dest", 0.00);
double dest_longitude = getActivity().getIntent().getDoubleExtra(
"lng_dest", 0.00);
int source_code = getActivity().getIntent().getIntExtra(
"code_source", 0);
int dest_code =
getActivity().getIntent().getIntExtra("code_dest",
0);

22

Log.e("fc", String.valueOf(source_code));
Log.e("feffc", String.valueOf(dest_code));
marker = new MarkerOptions().position(
new LatLng(source_latitude,
source_longitude)).title(
"Source ");
marker.icon(BitmapDescriptorFactory
.defaultMarker(BitmapDescriptorFactory.HUE_YELLOW));
googleMap.addMarker(marker);
marker = new MarkerOptions().position(
new LatLng(dest_latitude, dest_longitude)).title(
"Destination ");
marker.icon(BitmapDescriptorFactory
.defaultMarker(BitmapDescriptorFactory.HUE_RED));
googleMap.addMarker(marker);
direction = (source_code < dest_code) ? "down" : "up";
Stations[] stations = Stations.values();
PolylineOptions polylines = new PolylineOptions();
polylines.width(2.5f);
polylines.color(Color.MAGENTA);
polylines.add(new LatLng(source_latitude, source_longitude));
CameraPosition cameraPosition = new CameraPosition.Builder()
.target(new LatLng(source_latitude,
source_longitude))
.zoom(12).build();
googleMap.animateCamera(CameraUpdateFactory
.newCameraPosition(cameraPosition));
Log.e("dire", direction);
if (direction.equals("down"))
{
for (int i = 0; i < stations.length; i++)
{
if (!(stations[i].getLatitude() == source_latitude))
{
} else
{
if ((stations[i + 1].getLatitude() == dest_latitude))
break;
else
{
marker = new MarkerOptions().position(new LatLng(
stations[i + 1].getLatitude(),
stations[i + 1].getLongitude()));
// ROSE color icon
marker.icon(BitmapDescriptorFactory\\
.defaultMarker(BitmapDescriptorFactory.HUE_AZURE));

23

// adding marker
googleMap.addMarker(marker);
polylines.add(new LatLng(stations[i + 1]
.getLatitude(), stations[i + 1]
.getLongitude()));
source_latitude = stations[i +
1].getLatitude();
}
}
}
polylines.add(new LatLng(dest_latitude, dest_longitude));
googleMap.addPolyline(polylines);
} else
{
for (int j = stations.length - 1; j > 0; j--)
{
if (!(stations[j].getLatitude() ==
source_latitude))
{
} else
{
if ((stations[j - 1].getLatitude() ==
dest_latitude))
break;
else
{
marker = new MarkerOptions().position(new LatLng(
stations[j - 1].getLatitude(),
stations[j - 1].getLongitude()));
// ROSE color icon
marker.icon(BitmapDescriptorFactory\\
.defaultMarker(BitmapDescriptorFactory.HUE_AZURE));
// adding marker
googleMap.addMarker(marker);
polylines.add(new LatLng(stations[j - 1]
.getLatitude(), stations[j - 1]
.getLongitude()));
source_latitude = stations[j 1].getLatitude();
}
}
}
polylines.add(new LatLng(dest_latitude, dest_longitude));

24

googleMap.addPolyline(polylines);
}
marker.position(new LatLng(gpsTracker.latitude,
gpsTracker.longitude));
marker.icon(BitmapDescriptorFactory
.fromResource(R.drawable.ft_icon_gps));
googleMap.addMarker(marker);
}
}
}

4.1.3

QRcode Fragment
public void onClick(View v)
{
switch(v.getId())
{
case R.id.button1:
shareImage();
break;
}
}
private void shareImage()
{
Intent share = new Intent(Intent.ACTION_SEND);
// If you want to share a png image only, you can do:
// setType("image/png"); OR for jpeg: setType("image/jpeg");
share.setType("image/*");
// Make sure you put example png image named myImage.png in your
// directory
String imagePath = Environment.getExternalStorageDirectory()
+ "/ticket.png";
File imageFileToShare = new File(imagePath);
Uri uri = Uri.fromFile(imageFileToShare);
share.putExtra(Intent.EXTRA_STREAM, uri);
startActivity(Intent.createChooser(share, "Share Image!"));
}

25

4.1.4

Booked History Log


public BookedHistoryLog(String logID,String Source,String Destination, int
pass,String pass1,String pass2,String pass3,int fare ,String Time)
{
this.logID = logID;
this.Source = Source;
this.Destination = Destination;
this.pass = pass;
this.pass1 = pass1;
this.pass2 = pass2;
this.pass3 = pass3;
this.fare = fare;
this.Time = Time;
//this.Email = Email;
}
public BookedHistoryLog(String logID,String Source,String Destination, int
pass,String trainclass,int fare)
{
this.logID = logID;
this.Source = Source;
this.Destination = Destination;
this.pass = pass;
this.trainclass = trainclass;
this.fare = fare;
//this.Email = Email;
}
public String getID()
{
return this.logID;
}
public void setID(String id)
{
this.logID = id;
}
void setSource(String Fname)
{
this.Source = Fname;
}
void setDestination(String Lname)
{
this.Destination = Lname;
}
public String getSource()

26

{
return Source;
}
public String getDestination()
{
return Destination;
}
public String getTime()
{
return Time;
}
public void setTime(String time)
{
this.Time = time;
}
void setPass(int no)
{
this.pass = no;
}
public int getPass()
{
return pass;
}
void setFare(int amount)
{
this.fare = amount;
}
public int getFare()
{
return fare;
}
public String getTrainClass()
{
// TODO Auto-generated method stub
return trainclass;
}

4.1.5

Insert into log

// Generate Guid
function NewGuid() {
$s = strtoupper(md5(uniqid(rand(),true)));
$guidText =
substr($s,0,3) . - .
substr($s,3,3) . - .
substr($s,6,3). - .

27

substr($s,9,3). - .
substr($s,12,3);
return $guidText;
}
// End Generate Guid
$Guid = NewGuid();

$userId = mysql_query("SELECT uid FROM users WHERE email = $email") or


die(mysql_error());
if($userId)
{
$user_id = mysql_fetch_assoc($userId);
}
$userId = $user_id[uid];
$currenttime = time();
$settoexpire = time()*3600*2;
$result = mysql_query("INSERT INTO
booked_history_log(User_Id,Log_id,Source,Destination,total_pass,fare,class,pass1,pass1_
2 HOUR),0)") or die(mysql_error());
if(isset($result))
{
echo $Guid;
}

28

4.2

Test cases

Figure 4.1: Test Cases

29

4.3

Results Snapshots

Figure 4.2: Registration


Figure 4.2 refers to the registration page for the new user. The user has to fill the required
details to make his own account.

30

Figure 4.3: User Login


Figure 4.3 refers to the Login page. The valid users logs into his account using the username and
password.

Figure 4.4: User Profile


Figure 4.4 shows the profile of the user. The user can edit his profile and check his balance.

31

Figure 4.5: Edit Profile


Figure 4.5 refers to the edit profile page where the user can edit his personal details and update
it.

Figure 4.6: Menu


Figure 4.6 shows the Ticket Menu where the user has the options to book a ticket, to recharge, to
view its profile or to check his booking history.

32

Figure 4.7: Application Popup


Figure 4.7 refers to the pop up screen which appears when the user enters in the circumference of
the nearby railway station.

Figure 4.8: Book Ticket


Figure 4.8 refers to Book ticket. The source station is directly received using GPS. The other
details are entered by the user and ticket is confirmed.

33

Figure 4.9: Book Ticket


Figure 4.9 shows the details of the passenger if more than 1 ticket is being booked. The passenger
name and fare of the journey is displayed.

Figure 4.10: Passenger Details


Figure 4.10 refers to Passenger details if more than 1 passengers ticket is booked. The passenger
details including his name and destination station is entered.

34

Figure 4.11: Journey Tracker


Figure 4.11 shows the Journey Tracker of the passengers journey. The journey is tracked using
passengers source and destination station.

Figure 4.12: QR image


Figure 4.12 refers to the QR image which is created after the ticket is booked. The QR image
consists of the transaction ID, passenger details and if the destinatihon is passed the ticket is
invalid and QR image is deleted.

35

Chapter 5
Conclusion and Future Work
The existing system has many limitations. With the use of powerful technologies, bottlenecks
have been identified. The proposed system uses highly integrated technologies which provide high
security and authorization. It uses the smart phone?s ?GPS? facility to validate and delete your
ticket automatically after a specific interval of time once the user reaches the destination. Users
ticket information is stored in a distributed database for security purpose which is missing in the
present suburban system. Also the ticket checker is provided with a checker application to search
for the users ticket with the ticket number in distributed database for checking purposes.
The application is currently limited to central and western railways and does not support
journey via changing train at different stations. The application has future scope for adding this
facility. Return ticket and Pass facility can be implemented in the future.

36

Appendix
Android:Android is a Linux-based operating system designed primarily for touch screen mobile devices such as smart phones and tablet computers. Initially developed by Android,
Inc., which Google backed financially and later bought in 2005,Android was unveiled in 2007
along with the founding of the Open Handset Alliance: a consortium of hardware, software,
and telecommunication companies devoted to advancing open standards for mobile devices.
Android SDK: The Android SDK provides you the API libraries and developer tools necessary to build, test, and debug apps for Android.
ADT:Android Development Tools (ADT) is a plugin for the Eclipse IDE that is designed to
give you a powerful, integrated environment in which to build Android applications.
Eclipse:In computer programming, Eclipse is a multi-language software development environment comprising a base workspace and an extensible plug-insystem for customizing the
environment. It is written mostly in Java. It can be used to develop applications in Java
and, by Means of various plug-ins, other programming languages including Ada, C, C++,
COBOL, Fortran, Haskell, Perl, PHP, Python, etc

37

References
[1] Wei - Meng Lee (2011) Beginning Android Application Development - Wiley Publishing
Inc.

[2] LocationManagerAndroid Developers: http://developer.android.com/reference/android/location/Loca


[3] LayoutsAndroid Developers:
layout.html

http://developer.android.com/guide/topics/ui/declaring-

[4] Code On Cloud: Android, MySQL, PHP JSON tutorial.


[5] T. Kojm. Clamav. In www.clamav.net, 2004.
[6] Jeff Java Jeff Friesens (2010) Learn Java for Android Development - Apress Publications.
[7] en.wikipedia.org/wiki/QRimage
[8] 2012 IEEE International Conference on Advanced Communication Control and Computing
Technologies (ICACCCT)Android Suburban Railway Ticketing with GPS as Ticket Checker

38

2012 IEEE International Conference on Advanced Communication Control and Computing Technologies (ICACCCT)

Android Suburban Railway Ticketing with GPS


as Ticket Checker
I
2
Karthick. S ,Velmurugan. A
Department of Information Technology
Shri Andal Alagar College of Engineering

email: karthicksiva59@grnail.com velfriends28@grnail.com

Abstract

One of the biggest challenges in the current ticketing

phones "GPS"

facility to validate and delete your ticket

facility is "QUEUE" in buy ing our suburban railway tickets. In this

automatically after a specific interval of time once the user

fast growing world of technology we still stand in the queue or buy


with oyster & octopus cards for our suburban tickets, which is
more frustrating at times to stand in the queue or if we forget our

cloud database for security purpose which is missing in the

cards. This paper Android Suburban Railway (ASR) ticketing is


mainly to buy the suburban tickets which is the most challenging
when compared to booking the long journey tickets through 'M
ticket' which fails with suburban(local travel) tickets. Our ASR

reaches the destination. User's ticket information is stored in a


present suburban system. Also the ticket checker is provided
with a checker application to search for the user's ticket with
the ticket number in the cloud database for checking purposes.
II. THE GROWING IMPORTANCE OF ANDROID

ticket can be bought with just a smart phone application, where you
can carry your suburban railway tickets in your smart phone as a
QR (Quick Response) code. It uses the smart phones "GPS" facility

MOBILE

to validate and delete your ticket automatically after a specific


interval of time once the user reaches the destination. User's ticket

Android is a software stack for mobile devices that includes an

information is stored in a CLOUD database for security purpose

The Android SDK provides the tools and APIs necessary to

which is missing in the present suburban system. Also the ticket


checker is provided with a checker application to search for the
user's ticket with the ticket number in the cloud database for
checking purposes.

operating

system,

middleware

and

key

applications.

begin developing applications on the Android platform using


the Java programm ing language. It is a Linux-based operating
system for mobile devices such as Smartphone's and tablet
computers. It is developed by the Open Handset Alliance led by
Google.

Keywords- Android; SQLite; Cloud Database; ASR; QR code;

Android
I.

has

large

community

of

developers

writing

applications ("apps") that extend the functionality

INTRODUCTION

of the

devices. Developers write primarily in a customized version of

In the past few years there were more advancement in the

Java. Apps can be downloaded from third-party sites or through

field of technology. Considering railway department, e-ticket

online stores such as Android Market, the app store run by

facility

was

introduced

where

users

browse

through

Google. As of October 2011 there were more than 400,000

governmental website and book their long journey railway

apps available for Android, and the estimated number of

tickets which can be printed out after confirmation to show it to

applications downloaded from the Android Market as of

the checker when needed. After which months before a new

December 2011 exceeded lO billion.

technology

called

M-ticketing

(Mobile

Ticketing)

was

introduced where customers messaged to the web portal through

FEATURES:

mobile phones after which a complete web page download to the


mobile phone where users can do the same booking process as it

was in the e-ticketing facility. Also in foreign countries the use


of Oyster cards & Octopus card has become mandatory during

where e-ticketing; m-ticketing was unable lay their foot prints.


Android Suburban Railway (ASR) ticketing is mainly to
buy the suburban tickets which are the most challenging. Our
ASR ticket can be bought with just a smart phone application,
where you can carry your suburban railway tickets in your
smart phone as a QR (Quick Response) code. It uses the smart

ISBN No. 978-1- 4673-20 48-1112/$31.002012 IEEE

framework enabling

reuse

and

replacement of components.

travel. But we suffer if we forget our travel cards and we stand


in the Queue for our local suburban tickets, which is a place

Application

Dalvik virtual machine optimized

for mobile

devices

Integrated

browser

based

on

the

open

source Web Kit engine.

Optimized graphics
graphics

library;

penGL

ES

powered by a custom 2D

3D

1.0

graphics

based

specification

on

the

(hardware

acceleration optional).

63

2012 IEEE Intemational Conference on Advanced Communication Control and Computing Technologies (ICACCCT)

SQLite

a white background. The information encoded can be made up

for structured data storage

of

Media support

four

standardized

kinds

B1uetooth, EDGE, 3G, and Wi-Fi (hardware

Camera,
GPS,
compass,
and
accelerometer (hardware dependent)
Rich development environment including a

Numeric onl)

Eclipse IDE

is an ACID -compliant embedded Relational Database


implements

most

of

small C programm ing library.


the SQL

standard, using

dynamically and weakly typed SQL syntax that does not


guarantee the domain integrity. In contrast to other database
management systems, SQLite is not a separate process that is
accessed from the client application, but an integral part of it.
SQLite read operations can be multitasked, though writes can
only be performed sequentially.
The source code for SQLite is in the public domain. SQLite is a
popular choice for local/client storage on web browsers. It has
many bindings to programming languages. It is arguably the
most widely deployed database engine, as it is used today by
several widespread browsers, operating systems, and embedded
systems,among others.
B.
ANDROID CLOUD TO DE VICE MESSAGING
FRAMEWORK
Android Cloud to Device Messaging (C2DM) is a service that
helps developers sends data from servers to their applications
on Android devices. The service provides a simple,lightweight
mechanism that servers can use to tell mobile applications to
contact the server directly, to fetch updated application or user
data. The C2DM service handles all aspects of queuing of
messages and delivery to the target application running on the
target device.
C.

QR CODE
A QR code

Max. 7,089 characters (0,1,2,3, 4,5,6,


9)

Binary/byte

Max. 2,953 characters (8-bit bytes)

Kanji/Kana

Max. 1,817 characters

(version

SQLlTE

SQLite

40-L symbols

. Max. 4,296 characters (0-9,A-Z [upper


phanumen
AI
01 * ,+, -,., /,..)
onI
y ] ,space, $,/0,

and performance profiling, and a plug-in for the

Management contained in a

or input character set),version

The maximum storage capacities occur for

device emulator, tools for debugging, memory

Sqlite

(mode,

error correction level (L[ow] , M[edium], Q[uality], H[igh]).

dependent)

A.

(numeric,

(1,...,40,indicating the overall dimensions of the symbol), and

(hardware dependent)

data

The amount of data that can be stored in the QR code symbol


depends on the data type

GSM Telephony

of

virtually any kind of data.

still image formats (MPEG 4,H.264,MP3, AAC,


AMR,JPG, PNG, GIF)

("modes")

alphanumeric, byte/binary,Kanji), or by supported extensions

for common audio, video, and

40, error correction level L), and are as follows

(where characterrefers

to

individual

values

of

the

input

mode/data type,as indicated):

Encryption
Although encrypted QR codes are not very common,there
are a few implementations. An Android app,for example,
manages encryption and decryption of QR codes using DES
Algorithm (56 bits). Japanese immigration use encrypted QR
codes when placing visas in passports.

Error correction
Codeword's

are 8-bits long

and

use

the Reed-Solomon

Error Correction algorithm with four error correction levels.


The higher the error correction level, the less storage capacity.
The following table lists the approximate error correction
capability at each of the four levels:

Level L

7% of codeword's can be restored.

Level M

15% of codeword's can be restored.

Level Q
Level H

25% of codeword's can be restored.


30% of codeword's can be restored.

Due to the design of Reed-Solomon codes and the use of 8-bit


codeword's, an individual code block cannot be more than 255
codeword's in length. Since the larger QR symbols contain much
more data than that, it is necessary to break the message up into

(abbreviated from

Quick Response code)

is a type of matrix-barcode (or two-dimensional code) first


designed for the automotive industry. More recently, the
system has become popular outside of the industry due to its
fast readability and comparatively large storage capacity. The

multiple blocks. The largest possible block size is never used,


though. The QR specification defmes the block sizes so that no
more than 15 errors can be corrected within each block. This
limits the complexity of certain steps in the decoding algorithm.
The code blocks are then interleaved together, making it less

code consists of black modules arranged in a square pattern on

64

2012 IEEE International Conference on Advanced Communication Control and Computing Technologies (ICACCCT)
likely that localized damage to a QR symbol will overwhelm the
capacity of any single block.
Thanks to error correction, it is possible to create artistic

6.) CHECKING QR CODE WITH QR READER:


In this module the checker will have QR Code reader and scan
the QR code with the application in order to validate QR code

QR codes that still scan correctly, but contain intentional errors to

and verifY the journey details, especially the time and date of the

make them more readable or attractive to the human eye, as well

ticket.

as to incorporate colors, logos and other features into the QR

7.) CHECKING WITH DATABASE:

code block.

If suppose the user's display is being damaged and not able to


III. SYSTEM DESIGN

scan the QR code due to other reasons like battery failure, we


have Another failsafe option to check the ticket by searching the

A.

EXPLANATION
1.) Personal Information Gathering:

ticket database with the user's ticket number for validation


purposes.

The work here starts during the fIrst time installation of our
application . It gathers the basic customer information like fIrst
name, last name, date of birth, city , state etc., and it will be
stored into user mobile's, SQLite database. So every time when

B.

ARCHITECTURE DESCRIPTION

The structure of system divided into two components (fIg 1.1):

The customer application which resides personal information

the user buys the ticket this customer information is also sent to

gathering, buying ticket, pin code validation, generating QR

the database for security purpose and used also in the QR

code, GPS ticket validation and stored into cloud database.

generation.

The checker application is to validate the ticket by entering


the ticket number of the user and searching in the cloud

2.) TICKET BUYING:

database to check whether the user has bought the ticket.

The user selects source, destination, class, no. of Adult and child
tickets, ticket type like return or single etc. then the user browse

IV. CONCLUSION

through the menu option to choose either credit buy option or


token buy which simplifIes the buy process by remembering the
credit card details. Once the user chooses any of these options the
application moves on to the pin code validation module.

In this paper we have presented a mobile ticket


application developed for Android 1.5 using Java, SQLite,
MySQL, and PHP on the server side which can change the
way people buy their tickets in future. This kind of ticketing

3.) PIN CODE VALIDATION:

application can be applied to any kind of transport system.

Once the customer hits the buy button a PHP code in the railway

Our android app is one of its kinds and fmds huge application

server validates the pin number and passwords,if it is successful

to buy sub-urban railway tickets through android mobile. Also

it saves both the journey details and customer info in the server's

our app saves a huge work for our ticket checkers by GPS

MySQL database. After which ticket number and time of buying

validation of tickets and also moving from manual ticket

is generated by the PHP code and the balance credit value is

checking process to digital ticket checking process by just

displayed.

scanning with his own android mobile to validate the ticket.


Hence a huge problem of issuing local train tickets has been

4.) GENERATING QR CODE:

solved with our new application.

Once the php code generates the ticket number and time of buy
the details saved in the MySQL database are sent to Google Chart

Knowing at what time trains will be available will also ease

API engine in order to generate the QR code. here all the personal

the user to allot his time accordingly to reach the station, so in

and ticket information are converted into QR codes and sent back

our project we will be using GPS here to fmd the location of

to the user mobile as HTTP response and saved in the application

the user and nearby train station to display the train arrival

memory.

timings. Still more advance modifIcation can be a Dynamic


display of Train locations by fItting GPS devices in trains to

5.) GPS TICKET VALIDATION:

show its location in the Google map display which is available

In this module (fIg 1.0) the GPS plays the role of the checker,

in our application. Also as a station level security we can have

where when the user buys the ticket, the source geopoints,

Hardware devices to validate the QR codes before the user

destination geopoints,ticket type,expiry time & date are stored in

enters or leaves the station, where the user can have access

a mobile SQLite database. This service checks the user's current

towards platform after being validated by the hardware device.

location in accordance with the destination geopoints,after which


the ticket type is checked and accordingly the ticket is deleted if
two is single or updated if type is return.

65

2012 IEEE International Conference on Advanced Communication Control and Computing Technologies (ICACCCT)
V. TABLE OF FIGURES

ANOROID SUR_URBAN RAILWAY TICKET RUYING PROCESS Wlnl GPS AS TICKET CIIECKER
GI'STICh:ET VAUI)ATI01\ AH.CIIITECTURE I>IAGKAM

"
'icket'H'"

II:;' ::::'
f:i, ;::: ,
A.NI)IlOII)'S

"
e
t:: :,::::
then.,.,

N,,:'.'lt'OIlK
IA)(A'I'ION
l'UOVmEIl

n"";nan..,,
----1 <hMI: ;:e'o

.;.-

_____________

(Once Ticket
buyed

t:.!12:;

source-I!ropomts
dCSt;nalion-eopo;n..
ticket type

&

,,,pirytimc: ..,edin SQLi..,)

ANDROID SUB-URBAN RAn.WA Y TICKET BUYING PROCESS WITH DATABASE IN CLOUD


ARCHITECTURE DIAGRAM

REFERENCES
Damon Oehlman and Sebastien Blanc (20II)" Pro Android Web
"-Apress
Publications.
[2] Dave Smith and Jeff Friesen's (2011)" Android Recipes A
Problem Solution Approach"- Apress Publications.
[3] Jeff" JavaJeff" Friesen's (2010) "LearnJavafor Android
Development"
Apress Publications.
[4] Lauren Darcey and Shane Conder (2010)" Sams Teach Yourself
Android Application Development"
Sams Publications.
[5] Mark Murphy's (2011)" Beginning Android 3" - Apress Publications.
[6] Reto Meier (2009)" Professional Android Application Development"
Wiley Publishing Inc.
[7] Satya Komatineni (2009) " Pro Android"
Apress Publications.
[8] Shawn Van Every's (2009) "Pro Android Media developing
[I]

Apps developfor Android using HTML5,CSS3 &JavaScript

Graphics, Music , Video and Rich Media Appsfor Smartphones and


Tablets"-

Apress Publications.
Wallace Jackson's (2011) "Android Appsfor Absolute Beginners"
Apress Publications.
[10] Wei - Meng Lee (20II)" Beginning Android Application
[9]

Development"

Wiley Publishing Inc.

66

Smart-phone Local Ticketing Application


Author 1: Bhakti Anekar
Department: IT
Organization: Sardar Patel Institute of Technology
Email id: bhakt04@gmail.com

Author 3: Yash Sanghavi


Department: IT
Organization: Sardar Patel Institute of Technology
Email id: sanghaviyash08@gmail.com

Author 2: Neelay Upadhyaya


Department: IT
Organization: Sardar Patel Institute of Technology
Email id: neelay2992@gmail.com

Mentor: Prof Kailas Devadkar


Department: IT
Organization: Sardar Patel Institute of Technology
Email id :kailas_devadkar @spit.ac.in

Abstract

phone users since studies say that almost 50% of the


population in Mumbai between the age group of 1840 makes use of smart-phones and also almost 80%
the same age group makes use of the local trains.
This application provides solutions to the current
problems and difficulties faced while buying local
tickets.

One of the biggest challenges in the current ticketing


facility is QUEUE in buying our suburban railway
tickets. E-Ticketing and M-ticketing are available for
long journey railways. Oyster cards & Octopus card
has become mandatory during travel. In this fast
growing world of technology we still stand in the
queue or buy with smart cards or coupons our
suburban tickets, which is more frustrating at times to
stand in the queue or if we forget our cards. This
application Smart-phone Ticketing Application(STA)
ticketing is mainly to buy the suburban tickets which
is the most challenging when compared to booking
the long journey tickets through `M-ticket' which
fails with suburban(local travel) tickets. Our STA
ticket can be bought with just a smart phone
application, where you can carry your suburban
railway tickets in your smart phone. It uses the smart
phones GPS facility to validate and delete your
ticket automatically after a specific interval of time
once the user reaches the destination. User's ticket
information is stored in a distributed database for
security purpose which is missing in the present
suburban system. Also the ticket checker is provided
with a checker application to search for the user's
ticket with the ticket number in distributed database
for checking purposes.

I. Introduction
Need for Project: Smart-phone Ticketing
Application (STA) is mainly to buy the suburban
ticket. Our Smart-phone ticket can be bought with
just a smart phone. It uses the smart phones "GPS"
facility to validate ticket automatically with ease.
This application is developed specially for smart-

Literature Survey: Surveying the basic railwaybased sites like www.mttnow.com, www.irctc.co.in
the following conclusion was derived. The user had
the ability of booking tickets through the internet but
the user could not book tickets through their mobile
phones directly. Also there was no facility to book
local suburban railway tickets through any websites
.So the understanding from the survey is that even
though the internet is a medium through which
people can book their railway tickets but due to lack
of facility to book local railway tickets and also
booking tickets using smart-phone there is a need to
develop a smart-phone application to book railway
tickets and also use GPS as ticket checker.[7]
Project Scope: This Smart-phone Local Ticketing
application is build for Android platform. This
application Smart-phone Ticketing Application(STA)
ticketing is mainly to buy the suburban tickets which
is the most challenging when compared to booking
the long journey tickets through `M-ticket' which
fails with suburban(local travel) tickets. It allows the
passenger to buy local train ticket for Mumbai
Suburbs which includes Central, Western and Harbor
Railways using the application on their smart-phone.
The GPS facility in the Smart-phone acts as a ticket
checker.
It uses the smart phones GPS facility to validate
and delete your ticket automatically after a specific

interval of time once the user reaches the destination.


User's ticket information is stored in a distributed
database for security purpose which is missing in the
present suburban system. Also the ticket checker is
provided with a checker application to search for the
user's ticket with the ticket number in distributed
database for checking purposes.

The framework divides the application into


three kinds of components. It also defines
the interactions between them.

Assumption and Constraints:


Constraints

It should take less than 2 second for local


transactions.

The network transactions should happen


within 3 seconds.

The application should be capable of


providing transaction for 24 hours per day.

Assumptions

The user should have an Android smartphone with an active data plan.

The balance in the users account should not


be less than the ticket fare.

GPS should be turned ON

Phone battery should be above 20%


II. METHOD DESCRIPTION:

The framework being used for the implementation


is the MVC architecture with the help of the PHP
framework. The basic structure of MVC is as
follows:

A controller can send commands to the


model to update the model's state (e.g.,
editing a document). It can also send
commands to its associated view to change
the view's presentation of the model (e.g.,
by scrolling through a document).
A model notifies its associated views and
controllers when there has been a change in its
state. This notification allows the views to
produce updated output, and the controllers to
change the available set of commands. A passive
implementation
of
MVC
omits
these
notifications, because the application does not
require them or the software platform does not
support them.
A view requests information from
the model that it needs for
generating an output representation
to the user

Technology to be used:

The various technologies that we will be used:


1. JAVA
Java is a set of several computer software
products and specifications from Sun
Microsystems (which has since merged with
Oracle Corporation), that together provide a
system for developing application software
and deploying it in a cross-platform
computing environment. Java is used in a
wide variety of computing platforms from
embedded devices and mobile phones on the
low end, to enterprise servers and
supercomputers on the high end. [4]
2.

Figure 1:MVC Architecture

Android
Android is a Linux-based operating system
designed primarily for touch screen mobile
devices such as smart-phones and tablet
computers, developed by Google in
conjunction with the Open Handset
Alliance. While Android is designed
primarily for smart-phones and tablets, the
open and customizable nature of the
operating system allows it to be used on
other electronics, including laptops and netbooks, smart-books, e-book readers, and
smart TVs (Google TV). Applications are
usually developed in the Java language

using the Android Software Development


Kit, but other development tools are
available, including a Native Development
Kit for applications. Applications can be
acquired by end-users either through an app
store such as Google Play or the Amazon
App-store, or by downloading and installing
the application's APK file from a third-party
site.[1]

software stack (and other 'AMP' stacks).


LAMP is an acronym for "Linux, Apache,
MySQL, Perl/PHP/Python." Free-softwareopen source projects that require a fullfeatured database management system often
use MySQL.

1.Register User:
3.

4.

5.

JSON(JavaScript Object Notation)


JSON or JavaScript Object Notation is a
text-based open standard designed for
human-readable data interchange. It is
derived from the JavaScript scripting
language for representing simple data
structures and associative arrays, called
objects. Despite its relationship to
JavaScript, it is language-independent, with
parsers available for many languages.
The JSON format is often used for
serializing and transmitting structured data
over a network connection. It is used
primarily to transmit data between a server
and web application, serving as an
alternative to XML.[4]
PHP
PHP is a server-side scripting language
designed for web development but also used
as
a general-purpose
programming
language. PHP is now installed on more than
244 million websites and 2.1 million web
servers. Originally created by Rasmus
Lerdorf in
1995,
the reference
implementation of PHP is now produced by
The PHP Group. While PHP originally
stood for Personal Home Page, it now stands
for PHP:
Hypertext
Preprocessor,
a recursive
acronym.PHP
code
is interpreted by a web server with a PHP
processor module, which generates the
resulting web page.[4]
MySQL
The MySQL development project has made
its source code available under the terms of
the GNU General Public License, as well as
under a variety of proprietary agreements.
MySQL was owned and sponsored by a
single for-profit firm, the Swedish company
MySQL AB, now owned by Oracle
Corporation. MySQL is a popular choice of
database for use in web applications, and is
a central component of the widely used
LAMP open source web application

User has to register before using the application. The


user credentials are verified and account is set up.
2.Login User:
User has to login before using the application. The
user credentials are verified and then the user is
allowed to use the application.[2]
3. Get Current Location:
The application uses GPS to track the current
location , based on that the source of the ticket is
detected.[3]
4. Select Destination:
The user has to enter the destination to buy ticket and
also to get fare.
6.Get fare:
The user can view the fare of ticket by entering the
source and destination.
7.Book Ticket:
The user has to specify the destination thereby he
can book the ticket. Also he has to have sufficient
balance in account.
8. Add into transaction log:
The record of the ticket is added to the database
known as the transaction log.
9. Generate QR image of the ticket:
The QR image of the ticket is generated using Google
QR generator API.[5]
10.Verify Ticket:
The QR image is scanned and the ticket is verified
accordingly.
11.Journey Tracker:
Using the phones GPS the current location is
updated at every instant, thereby tracking the entire
journey.

III. Block Diagram of System

Figure 4: Ticket Menu


Figure 2: Block Diagram
Technology Mapping of Different Blocks:
Login User: Android XML
Get Current Location: GPS
Select Destination: JSON, PHP
Get Fare: JSON, PHP
Database: MySQL
QR image: QR generator API

IV. Results

Figure 5: Book Ticket

Figure 3: Login Page

V. Future Scope
The application is currently limited to central and
western railways and does not support journey via
changing train at different stations. The application
has future scope for adding this facility. Return ticket
and Pass facility can be implemented in the future.

VI. Conclusion

Figure 6: Journey Tracker

The existing system has many limitations. With the


use of powerful technologies, bottlenecks have been
identified. The proposed system uses highly
integrated technologies which provide high security
and authorization. It uses the smart phones GPS
facility to validate and delete your ticket
automatically after a specific interval of time once
the user reaches the destination. User's ticket
information is stored in a distributed database for
security purpose which is missing in the present
suburban system. Also the ticket checker is provided
with a checker application to search for the user's
ticket with the ticket number in distributed database
for checking purposes.

VI. Acknowledgement
We have immense pleasure in presenting the synopsis
report for our project entitled Smartphone Local
Ticketing Application. We would like to take this
opportunity to express our gratitude to a number of
people who have been sources of help and
encouragement during the course of this project. We
are very grateful and indebted to our project guide
Prof.Kailas Devadkar, for providing his enduring
patience, guidance and invaluable suggestions. He
was the one who never let our morale down and
always supported us through our thick and thin. He is
a constant source of inspiration for us and took
Figure 7: QR Image

utmost interest in our project. We would also like to


thank all the Staff Members for their valuable
cooperation and permitting us to work in the I.T.
Lab.We are also thankful to all our classmates for
giving

us

cooperation.

their

useful

advice

and

immense

VII. REFERENCES

[1] Wei - Meng Lee (2011) "Beginning Android


Application Development" - Wiley Publishing Inc.
[2] LocationManager|Android Developers:
http://developer.android.com/reference/android/locati
on/LocationManager.html
[3] Layouts|Android Developers:
http://developer.android.com/guide/topics/ui/declarin
g-layout.html
[4] Code On Cloud: Android, MySQL, PHP & JSON
tutorial.
[5] B. N. Parlett, The QR algorithm, Computing Sci.
Eng., 2 (2000)
[6] Jeff" Java Jeff" Friesen's (2010) "Learn Java for
Android Development" - Apress Publications.
[7] 2012 IEEE International Conference on
Advanced Communication Control and Computing
Technologies (ICACCCT)"Android Suburban
Railway Ticketing with GPS as Ticket Checker"

Acknowledgements
We have immense pleasure in presenting the synopsis report for our project entitled Smartphone
Local Ticketing Application. We would like to take this opportunity to express our gratitude
to a number of people who have been sources of help and encouragement during the course of
this project. We are very grateful and indebted to our project guide Prof.Kailas Devadkar, for
providing his enduring patience, guidance and invaluable suggestions. He was the one who never
let our morale down and always supported us through our thick and thin. He is a constant source
of inspiration for us and took utmost interest in our project. We would also like to thank all the
Staff Members for their valuable cooperation and permitting us to work in the I.T. Lab.We are
also thankful to all our classmates for giving us their useful advice and immense cooperation.

49

Anda mungkin juga menyukai