Bachelor of Engineering
by
Bhakti Anekar(Roll No.:05)
Neelay Upadhyaya(Roll No.:76)
Yash Sanghavi(Roll No.:59)
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
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
36
Appendix - Algorithms
37
References
38
Acknowledgements
49
ii
List of Figures
2.1
3.1
3.2
3.3
3.4
3.5
3.6
3.7
3.8
3.9
3.10
3.11
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
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
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
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
1.6
1.6.1
System Requirements
Software
1.6.2
Hardware
1.6.3
Chapter 2
Literature Review
2.1
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.
2.2
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
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
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
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
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 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 shows the collaboration diagram. It represents the interaction between the entities.
11
3.1.6
Figure 3.6 refers to State Chart Diagram for the Passenger. It shows the different states of the
Passenger.
12
3.1.7
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 refers to Class Diagram for the entire system showing interaction between different
classes.
14
3.2
3.2.1
Design
Block Diagram
15
3.2.2
Architecture Diagram
3.3
Implementation
3.3.1
Technology used
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
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
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
21
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
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
// 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();
28
4.2
Test cases
29
4.3
Results Snapshots
30
31
32
33
34
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.
http://developer.android.com/guide/topics/ui/declaring-
38
2012 IEEE International Conference on Advanced Communication Control and Computing Technologies (ICACCCT)
Abstract
phones "GPS"
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
operating
system,
middleware
and
key
applications.
Android
I.
has
large
community
of
developers
writing
INTRODUCTION
of the
facility
was
introduced
where
users
browse
through
technology
called
M-ticketing
(Mobile
Ticketing)
was
FEATURES:
framework enabling
reuse
and
replacement of components.
Application
for mobile
devices
Integrated
browser
based
on
the
open
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
of
Media support
four
standardized
kinds
Camera,
GPS,
compass,
and
accelerometer (hardware dependent)
Rich development environment including a
Numeric onl)
Eclipse IDE
most
of
standard, using
QR CODE
A QR code
Binary/byte
Kanji/Kana
(version
SQLlTE
SQLite
40-L symbols
Management contained in a
Sqlite
(mode,
dependent)
A.
(numeric,
(hardware dependent)
data
GSM Telephony
of
("modes")
(where characterrefers
to
individual
values
of
the
input
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
and
use
the Reed-Solomon
Level L
Level M
Level Q
Level H
(abbreviated from
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
and verifY the journey details, especially the time and date of the
ticket.
code block.
A.
EXPLANATION
1.) Personal Information Gathering:
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 user buys the ticket this customer information is also sent to
generation.
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
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
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
displayed.
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
the user and nearby train station to display the train arrival
memory.
In this module (fIg 1.0) the GPS plays the role of the checker,
where when the user buys the ticket, the source geopoints,
enters or leaves the station, where the user can have access
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
&
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]
Apress Publications.
Wallace Jackson's (2011) "Android Appsfor Absolute Beginners"
Apress Publications.
[10] Wei - Meng Lee (20II)" Beginning Android Application
[9]
Development"
66
Abstract
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
Assumptions
The user should have an Android smartphone with an active data plan.
Technology to be used:
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
1.Register User:
3.
4.
5.
IV. Results
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
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
us
cooperation.
their
useful
advice
and
immense
VII. REFERENCES
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