Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 47

SMART PARKING BOOKING APPLICATION

Submitted in partial fulfillment of the requirements


of the degree of

B. E. Computer Engineering

By

Aldrich Fargose132040
Sussan Tuscano132122

Supervisor:
Mr. Jerin Thankappan

Department of Computer Engineering

St. Francis Institute of Technology


(Engineering College)
University of Mumbai
2016-2017
CERTIFICATE

This is to certify that the project cntitkd "SMART PARKING BOOKING Al'l'LIC..\TfON,"
is a bonafide work of "Aldrich Fargosr (132040)"submiltl"CI 10 thl· nin:n.ity Clt' ltuul ai in
partial fulfillment of the requirement for the award C1f lhl' th.•gfl• · 0f U.E. in ( \•111pu1 ·r
Engineering

Mr. Jcrin Thankappan


(Supervisor/Guide)

(Pri1u.·ip11I)
( Head of Department)
Project Report Approval for B.E.

This project report t ntitlcd SMART PARKING BOOKING APPLICATION. by Aldrich


Fargosc (132040) is approved for the degree of B.E. i11 Computer I::ngineering.

Examiners

l. ·

2.-------------W -----------------

Date: 28-04-2017
Place: Mumbai
Declaration
We declare that this written submission represents my ideas in my own words and where
others' ideas or words have been included, I have adequately cited and referenced the original

sources. I also declare that I have adhered to all p,;nciples of academic honesty and integrity and
ha e not misrepresented or fabricated or falsified any idea/data/fact/source in my submission. I
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 fro
horn proper permission has not been taken when needed.

Aldrich Fargose (132040)

@J.. 0,VL
· -'
' ,,,•:s.an Tuscano (132122)

Date:28-04-2017

111
Abstract
Most of us own a vehicle use our private vehicles almost on regular basis. Most common problem
that people face is to find a parking space. The development of technology has an impact for the
transportation sector. One of them is about finding parking space for your vehicle. To find an
empty parking spot, a driver must look up for a parking lot that has been allowed for parking, it is
quite difficult to find a spot because the space available for parking is very limited and the
number of vehicles that need parking is very high. It requires relatively longer time for a driver to
get a parking spot which can cause traffic jam in the parking lot. This is the reason why we
proposed an application for parking lot using Android Smartphone. Hence, we propose a parking
system which can be used by a simple android smartphone.

We aim to make our system less human dependent by automating the entire parking lot’s way of
working, on the other hand existing system requires manual efforts. Our system offers a web
based reservation where users can view various parking areas and select the space to view
whether space is available or not. If the booking space is available, then the user can book it for
specific time slot. It is also beneficial for the parking lot owner as there is atomization in the
traditional way.

i
Conten
Chapter Contents Page No.
1 INTRODUCTION 1
1.1 Description 1
1.2 Problem Formulation 2
1.3 Motivation 2
1.4 Proposed Solution 3
1.5 Scope of the project 4
2 REVIEW OF LITERATURE 5
3 SYSTEM ANALYSIS 8
3.1 Functional Requirements 8
3.2 Non-Functional Requirements 9
3.3 Specific Requirements (Hardware and software 10
requirements)
3.4 Use Case Diagrams and Description 12
4 ANALYSIS MODELING 13
4.1 Data Modeling 13
4.2 Activity Diagrams 14
4.3 Functional Modeling 15
4.4 TimeLine Chart 16
5 DESIGN 18
5.1 Architectural Design 18
5.2 User Interface Design 20
6 IMPLEMENTATION 23
6.1 Working of the Project 23
7 TESTING 34
7.1 Test Cases 34
7.2 Types of Testing 35
8 CONCLUSIONS and FUTURE SCOPE 36

Appendix
Literature Cited
Acknowledgements

v
List of

Fig. No. Figure Caption Page No.

3.4.1 Use Case Diagram 12

4.1.1 ER Diagram 13
4.2.1 Activity Diagram 14
4.3.1 DFD 0 (Context Level) 15
4.3.2 DFD 1 15
4.4.1 Timeline Chart 1 16

4.4.2 Timeline Chart 2 16

4.4.3 Timeline Chart 3 17


5.1 System Architecture 18
5.2.1 GUI-Homepage 20
5.2.2 GUI-Lot login 20
5.2.3 GUI- Lot specification Map 20
5.2.4 GUI-Registeration of lot 20

5.2.5 GUI-User registeration 21

5.2.6 GUI-User login 21

5.2.7 GUI-Homescreen 2 21

5.2.8 GUI-Google maps showing lots 21

5.2.9 GUI-Types of slots 22

5.2.10 GUI-Selection of slot 22

5.2.11 GUI-Booking page 22

5.2.12 GUI-Invoice 22

v
List of

Sr. No. Abbreviation Expanded form

i. UML Unified Modelling Language


ii. FTP File Transfer Protocol
iii. UDP User Datagram Protocol
iv. ADT Android Development Tool
v. REQ Requirement

v
Chapter 1

Introduction

In this present world all the people are busy in their own daily routine where most of this
people are the ones who travel a lot in order to reach their destination. This travel is mostly
done by vehicles where it is privately owned one or the temporary hired one. But the problem
that is faced is by the private vehicle owners since they couldn’t find the space for parking
their vehicle when they reach their destination. In earlier times, the private vehicle owner use
to reach the destination then search for nearby space, which eventually results that the parking
spaces are not free or there is no parking space nearby this destination. So the vehicle owner
would park the vehicle road side which lead to cause of traffic on the road and tolling of
vehicle by government servants.
To overcome all this earlier problems, we introduced a system called SMART PARKING
BOOKING APPLICATION which will help the common people in finding parking space
nearby their destination and avoid the tolling of vehicles as well as saves the time of the
owner in searching for the parking space. In short the existing traditional method is atomized
where there will be less human intervention.

1.1 Description

The electronic world has good significance with technological development. It has brought
convenience to everyone’s life. Smartphone is very widely used and has become an important
part of everyday life. For example, an android based mobile phone is one of the advanced
electronic media, popular among the public and extensively used for the apps making life
easier for users.In the transportation sector, one of the technological developments can be
found in the parking sector. Today many parking lots have improved the quality of parking
services, either by adding camera in the parking lot or providing parking attendant to assist
drivers who wants to find an empty parking spot. To get the empty spot, a driver must roam
the whole parking lot several times, because of limited space and increase in the number of
cars. It needs a relatively long time for the drivers to get the parking spot and can cause traffic
issues.Also the current way of parking is not proper, vehicles are parked in random manner
hence many problems are faced while parking the vehicle.

1
Chapter Introducti

1.2 Problem Formulation

The existing system is the manual way of finding the parking spot. In this system the user has
to go in search of parking lot near user’s destination. The user spends a lot of time finding the
space and sometimes also faces disappointment in finding it.

Also there are places like malls, cinema halls etc. where the parking space is available in the
vicinity of the destination but, the user when reaches the place, they find it already full and
then has to search for space outside or nearby their destination which causes inconvenience to
the vehicle owner. There are some user destination which has no parking lots within it or
around it, this also causes problem for the user since when user reaches destination there is no
parking space; and the one which is there is way too far from his destination.

1.3 Motivation

In the past few years, we have seen the growth of mobile applications in all fields and in this
rising age of technology many new and efficient alternatives to the older technologies are
being discovered. Parking have been using the manual system of functioning and we observed
that if they move and evolve into the new system of mobile applications and the connectivity
of the internet not only will their working conditions become more organized but also their
profits and output will increase marginally and also their customer base will become stronger.
The daily use of vehicle for transportation and finding space to park the vehicle inspired us to
think if such problem occurs then we should find a solution to help such users.
The increase in mobile users in the past few years and the inclination for the users to use
mobile applications led us to the decision of creating a mobile app which will help them find
parking space online. This will help to book a place without wasting time.
To decide on this project, we conducted a survey where we came across the fact that many
people face such problem every day. Hence, the thought to build a system that can help
people find the space before reaching the destination thus leading to a beneficial outcome for
both.

2
1 Proposed

1.4 Proposed Solution


The problem of finding the parking space near the user destination without time consumption
in existing system is overcome by using android based parking application which is user
friendly and convenient. Also there is beneficial factor for the free space owner who wants to
make his/her free land as a parking space for monitory gains can also be benefited by this
android application.

The application consists of three main modules:

 USER

 The user first has to register and then login into the system.
 Application will generate the maps highlighting the parking lot areas with pointers.
 The user can select the desired parking lot.
 The user can book the parking space for the particular time and pay.

 PARKING LOT OWNER


 The parking lot owner has to login into the system as a lot owner.
 The owner then enters its parking space details including the type and number of
lots available.
 The payment done by the user for parking booking is monitored by them.
 It sets the status of parking either filled or not.

 ADMIN
 The admin login is based on website where they can manage databases, user
authentication and user information.
 The admin verifies the parking spaces provided by parking lot owners to verify if
the details are valid or not, until then the parking lot owner cannot access this
system as they are not verified parking lot owners.

3
Chapter Introducti

1.5 Scope of the Project


 The work that is usually done manually is substituted by an automated system making

it easier and convenient for the local people, the vehicle owners for finding
parking space.
 Many big firms, companies and malls have very large parking areas this
application can be used in these areas as automated system in these area is feasible.
 The system can be used in government offices and schools so the parking can
beorganized.
 In parking lots, it can help the parking lot owner as the system is automated and
most of the manual work is done fast and efficiently.
 The system will be very simple to understand and use, setup also is very
cheap comparatively.
 The most useful feature of these application i.e. advance booking will help
many people as they can book prior to the parking.

4
Chapter Review of

Chapter 2

Review of Literature

Application for parking area with Android smartphone [1]: In the transportation sector,
one of the technology developed can be found in parking. To find an empty parking spot, a
driver must look up for a parking lot that has been allowed for parking. It is quite difficult to
find a parking spot because the space available for parking is very limited and the number of
vehicles that need parking is very high. It needs a relatively long time for a driver to get a
parking spot and cause a traffic jam in the parking lot because many drivers are trying to find
an empty spot for their vehicles.
This is the reason why the author develops an application for parking lot using android
smartphone. This application can help driver to find empty parking spot in a short time easily.

The main menu shows the button of cars or motors.


 Car menu displays the filled parking lot number based on existing location.
 Parking lot status displays both the empty parking lot status and filled parking lot
status.
 Outgoing vehicle displays number of form, parking identity to be filled by officer and
to display price to be pay by outgoing vehicle.
 Location data shows the new location entered, location deleted or change location.

Automatic car parking system commended by Android application [2]:The paper presents
a miniature model of an automated car parking system that regulates the number of cars that
can be parked in a given space at any given time based on the parking space availability. The
paper aims at automating the car park by allowing the cars into the parking. LCD is provided
to display the information about the total number of cars that can be parked and the place free
for parking. When a car arrives at the entrance, it will be stopped over a path leading towards
the parking lot. The owner, then, de-boards the car and using the Android application on his
Smartphone, will command the car to park it. On receiving this command, the car will begin
to trace the path that leads towards the parking lot. When a car comes in front of the gate of
the parking, it will wait on the white marking outside the parking space for the searching of

5
Chapter Review of
free space. On allocation of free slot, the car will further trace its path to free parking spot. On
successful parking, the data on the LCD will be updated automatically.
Four basic modules were required for implementation of this system.

(1) Interfacing of Microcontroller with LCD.


(2) Interfacing of Microcontroller with GSM.
(3) Interfacing of Microcontroller with RF Module.
(4) Android Application.
The car driver initially positions the vehicle on the path leading to the parking space.
Then, with the help of an Android Application he sends an encoded SMS saying “Park the
car”.
The car traces the path to the gate of the parking. On the gate, the microcontrollers of the
parking unit and the car communicate and availability of free parking slot is checked for. If a
free slot is found, it is allocated and the car traces the path to the slot and gets parked. The
data on LCD gets updated simultaneously. Thus, the aim of this system is to provide an
efficient car parking system with minimal human intervention.

Innovative smart car parking system using NFC access [3]: The project aims at developing
an automated parking system for cars. This proposed system improves the recently used
parking system by enhancing its security features and simplifying the parking process by
eliminating the need for manual intervention. The parking system uses Near Field
Communication (NFC) technology for authentication and owner car identification. NFC is a
technology with the set of standards for smart phones and similar devices to establish radio
communication with each other by touching them together or bringing them into close
proximity, usually no more than a few inches. NFC Module is widely present in today’s smart
phones and thus can be used to eliminate the need for parking tokens or cards. On the other
hand, the automation process and space management is managed by the ARM microcontroller
by controlling the mechanical motors in transporting the car at an appropriate parking space.

OBJECTIVES:
1. Automation
2. Authentication using NFC
3. Easy to use
4. Security
5. Efficient parking space management

6
Chapter Review of
6. Uncongested parking
7. Easy in parking maneuverings
8. Independence on human

While parking the driver places his car at the specified location at the entrance of the parking
lot. He then brings his NFC tag near (5cm approx.) the NFC reader module controller. The
NFC reader module is based on PN 532 breakout board which consists of PN 532
reader/writer IC. Every tag has its own 7-byte unique identity number (UID) which is used for
authentication. The NFC breakout board gives this 7-byte identity number to ARM Cortex
M3 microcontroller using Serial Peripheral Interface (SPI) mode. ARM microcontroller
compares this UID with other UID stored in the memory. If there is no match of UID the
microcontroller understands that there is a new car which needs to be parked else, it
understands that the car which has already been parked and needs to retrieved.
After storing the UID in the memory, microcontroller calculates the nearest empty slot.
Accordingly, it gives commands to the motor driver circuit and the LCD interfaced with
cortex M3 will display “Parking at the slot”. The motors are driven by motor driver circuit
according to the commands received and the car is parked at the nearest empty location
assigned by cortex M3. After the car is parked at particular slot, the LCD will display
“Parking Successful”.
While retrieving the driver will bring his NFC tag near the NFC reader module and the
microcontroller again initiates the comparison process of UID. During this process if UID
match is found then the microcontroller understands that the car
needs to be retrieved. The cortex M3 again gives commands to the motor driver circuit
repeats the process only this time to retrieve the car. After the car has been successfully
retrieved, the LCD will display “Thank You”.

7
Chapter 3 System Analysis

Chapter 3

System Analysis

3.1 Functional Requirements

The system’s main function is to connect the user with resource of parking space available in its
vicinity thereby improving the traditional method and providing an automatic technique for
finding parking space in a crowded area. This system will help people to book a space sitting at
home and thereby reducing the time in finding the space.

Connection to the web server

1. Description and Priority


Connection is achieved to the web server through the login page. The user must fill in the
required fields and login. This function has most priority to ensure authenticity of the user and
that only user should be able to access devices.

2. Stimulus/Response Sequence
i. User enters username and password.

ii. The details are verified and validated by web server.

iii. If valid the user can proceed to use the application.

3. Functional Requirements
REQ-1: Proper validation of username and password.

REQ-2: In case of incorrect entry user should be sent back to login page.

REQ-3: Maximum 3 login attempts in case of failure.

8
3 Non-Functional

3.2 Non-Functional Requirements

3.2.1 Performance Requirements

This System requires active internet connection at all times that is from signing in to the app
and must have an accessible database of the entire nearby Parking spots to connect the users
in order to easily surf through the app and find the suitable spot for parking and immediately
book the space. So the mobile device should be connected to a wireless network.

3.2.2 Security Requirements

The following things are required to ensure that the automation process is completed in a safe
and secure manner:

1) The username and password has to be checked before providing access to the app else the
user should be denied any access.

2) The login details of a user should be stored securely and should not be visible to any other
user.

3) While accepting the booking we must confirm that it has been checked by an authorized
authority.

3.2.3 Software Quality Attributes


The mobile device has to be connected to the internet and the database will be available
online and hence will be accessible from anywhere and anytime and hence avoiding
availability and portability issues. The information entered in the login menu will be checked
for errors. All the details of the parking places (location, availability, cost etc.) will be stored
in the database. So this system will not have any data integrity and correctness issues either.
Also the data entered will be secure and cannot be accessed by anyone. This system can be
maintained and updated by the server depending on the requirements like the new added
parking space, the release of the booked space after the user cancels the booking etc.

9
Chapter System

3.3 Specific Requirements

3.3.1 User Interfaces

User interfaces consist of various menus and submenus. User accesses the Interface on the
mobile device through the installed software application. The steps that need to be followed
hereafter are given below:

The following are the modules that are included in this application

1. Login and registration.


2. Nearest lot calculation.
3. Booking of Parking space.
4. Status update.
5. Payment.

1 Login and registration:


There will be a separate login procedure for the user and the parking lot owner. If new to the
system a registration procedure is provided.

2 Nearest lot calculation:


Here the destination should be entered which will generate Where user will see a map
showing his current location and nearby parking lots in the map with markers.

3 Booking of parking space:


The user can then select the parking lot and the space and book for particular timing.

4 Status update:
When the particular space is booked the space is shown reserved. When the user reaches the
parking lot and parks his/her vehicle then the status is updated as not available.

5 Payment:
Payment can be done manually to the parking lot owner when the user reaches the destination.
Payment can also be done online and the invoice generated is emailed to the user.

1
Chapter System

3.3.2 Hardware Interfaces


 Smartphone
 Ram 500mb and above
Dual core processor.

3.3.3Software Interfaces
Android studio/Eclipse-ADT bundle.
Android OS (ver. 4.0 and above)
SQLite database
Driver software.

3.3.4Communication Interfaces
Client (customer) on Internet will be using HTTP/HTTPS protocol.
Administrator on Internet will be using HTTP, FTP, TCP /UDP protocol.
Data transfer rates may vary depending on the Internet speed.

1
Chapter System

3.4 Use-Case Diagrams and description

Fig. 3.4.1: Use Case Diagram

The user is the main actor in this project where he/she login into the application and searches for parking lo
verifies the registered parking space. Parking lot owner is third main actor who itself registers

and provide the details about the space he/she wants to allocate for parking. The parking lot
owner also set the status when the vehicle arrives or leaves.

1
Chapter Analysis

Chapter 4

Analysis Modeling
4.1 Data Modelling
ER Diagram

Fig 4.1.1: ER Diagram

1
4 Activity

4.2 Activity Diagram

Fig4.2.1: Activity Diagram

1
Chapter Analysis

4.3 Functional Modeling


4.3.1 DFD Level 0 (Context Level DFD)
Us

View lots

Booking
Nearby
User parking verification Details about booking

lots
Lot booking details

for
Checks lot owner status
Fig.
Lot registration

0.0
Lot owner Car Parking Application
Admin

DFD Level

Fig. 4.3.2: DFD 1 (Level 0 Diagram)

1
4 Timeline

4.4 Timeline Chart

Fig. 4.4.1: Timeline Chart 1

Fig. 4.4.2: Timeline Chart 2

1
Chapter Analysis

Fig. 4.4.3: Timeline Chart 3

1
Chapter Desi

Chapter 5

Design
5.1 Architectural Design
System Architecture

A Parking application system which is proposed in order to reduce the time for the user in finding parkin
system architecture for the parking application app.

1. Registration Module:
 Different registration will be required for different sections like a user will require a
different registration process while a parking lot owner will require a different one.
This will separate the different login modules and the system will be able to
distinguish between different users of the system.
 Basic information that is entered is stored in database.

1
Chapter Desi

2. Nearest lot calculation:


 According to the user’s destination the nearest parking lots are calculated and shown
on google map on the users phone along with the markers indicating the lots.

3. Selecting time and space and finalizing booking:


 The user can book the time and space for its parking on the selected parking space.
 The finalization of the booking is done by payment.

4. Function/Operation Module:
 The admin of the system performs operations through the functions provided by the
system. If the parking is done, then the status is updated as allocated and the space is
shown not available.
 The lot registration and verification is done for the security reasons to check whether
the registered parking space is really present or is faked.
 The booking log is where the user bookshisspace for a particular time period.

5. User Module:
 The user is only allowed to access and perform operations.

6. Parking lot owner Module:


 The parking lot owner is only allowed to access and perform operations.

7. Admin Module:
 The admin of the application is only allowed to access and perform operations.

8. Database (SQL Lite):


 The database that is used in the system which is SQL Lite which will store contents
like Login details, Booking logs and parking lots.
 The data is stored in the database in different sections for distinguishing the data
stored for better retrieval of data from the database.

1
Chapter Desi

5.2 User Interface Design

5.2.1 Homepage 5.2.2 Lot login

5.2.3 Lot specification Map 5.2.4 Registeration of lot

2
Chapter Desi

5.2.5 User Registeration 5.2.6 User login

5.2.7 Homescreen 2 5.2.8 Google map showing lots

2
Chapter Desi

5.2.9 Types of slots 5.2.10 Selection of slot

5.2.11 booking page 5.2.12 Invoice

2
Chapter Implementati

Chapter 6

Implementation

6.1 Working of the Project

Display of Google map for Registration of lot


There are two modules in our project first is lot related module i.e. (login, registration,
selecting lot area etc.). In these modules, the lot owner first chooses
Its lot location by placing the marker on right place and then owner adds the lot information
and registration of the lot is done.

package com.example.smartpark;

import com.google.android.gms.maps.CameraUpdate;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.GoogleMap.OnMarkerDragListener;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.content.Intent;
import android.location.Criteria;

public class Lotsignup extends Activity implements

LocationListener{ GoogleMap gogmap;


Button b1;
double lat;
double longi;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_lotsignup);

b1=(Button)findViewById(R.id.nextstage);
b1.setEnabled(false);

b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

AlertDialog.Builder a_builder = new AlertDialog.Builder(Lotsignup.this);


a_builder.setMessage("Do you want to Continue lott registration")
.setCancelable(false)

2
Chapter Implementati

.setPositiveButton("Yes",new DialogInterface.OnClickListener()
{ @Override
public void onClick(DialogInterface dialog, int which) {
Intent i=new Intent(Lotsignup.this,Lotsignup2.class);
String nlat=Double.toString(lat);
String nlong=Double.toString(longi);
i.putExtra("latitude", nlat);
i.putExtra("longitude", nlong);
startActivity(i);
finish();
}
})
.setNegativeButton("No",new
DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
}) ;
AlertDialog alert = a_builder.create();
alert.setTitle("Alert !!!");
alert.show();
}
}
);

initailize();

}
private void initailize() {
if(gogmap==null)
{
MapFragment mf=(MapFragment)
getFragmentManager().findFragmentById(R.id.lotgmap);
gogmap=mf.getMap();
}
if(gogmap!=null)
{
gogmap.setOnMarkerDragListener(new
OnMarkerDragListener() {

@Override
public void onMarkerDragStart(Marker m) {
// TODO Auto-generated method stub

@Override
public void onMarkerDragEnd(Marker m) {
// TODO Auto-generated method stub
LatLng ll=m.getPosition();
lat=ll.latitude;
longi=ll.longitude;

2
Chapter Implementati

Toast.makeText(getApplicationContext(), "You have chossen lat="+lat+" long="+longi,


Toast.LENGTH_SHORT).show();
b1.setEnabled(true);
}

@Override
public void onMarkerDrag(Marker m) {
// TODO Auto-generated method stub

}
});

Display of lot on Google map


The logged in user after login when clicks on new booking option he is redirected to
the google map where all the parking lots near to him are shown as markers. The lots are
displayed according to the users current gps position.

package com.example.smartpark;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;

import com.google.android.gms.maps.CameraUpdate;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.GoogleMap.OnMarkerClickListener;

import android.content.Context;
import android.content.Intent;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.AsyncTask;
import android.os.Bundle;

public class Newbooking extends Activity implements LocationListener{

GoogleMap gogmap;
Context ctx;
Button b1;
String lat,longi,info,lotname,user_email;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

2
Chapter Implementati

setContentView(R.layout.activity_newbooking);

info=getIntent().getStringExtra("name");
user_email=getIntent().getStringExtra("email");
initailize();

b1=(Button) findViewById(R.id.bt1);
b1.setEnabled(false);
gogmap.setOnMarkerClickListener(new OnMarkerClickListener() {

@Override
public void onClick(View v) {

Intent i=new Intent(Newbooking.this,Newbooking1.class);

i.putExtra("latitude", lat);
i. putExtra("longitude", longi);
i.putExtra("name", info);
i.putExtra("lotname", lotname);
i.putExtra("email", user_email);
startActivity(i);
}});

private void initailize() {


if(gogmap==null)
{
MapFragment mf=(MapFragment)
getFragmentManager().findFragmentById(R.id.gmap);
gogmap=mf.getMap();
}
if(gogmap!=null)
{
gogmap.setMyLocationEnabled(true);
LocationManager lm=(LocationManager) getSystemService(LOCATION_SERVICE);

String provider=lm.getBestProvider(new Criteria(), true);

if(provider==null)
{
onProviderDisabled(provider);
}

Location loc=lm.getLastKnownLocation(provider);
if (loc!=null) {
onLocationChanged(loc);
}

backmarker bm=new backmarker (ctx);


bm.execute();
}
}

@Override

2
Chapter Implementati

public void onProviderEnabled(String provider) {


// TODO Auto-generated method stub

}
@Override
protected void onPreExecute() {
url="http://aldfar.comli.com/viewbooking.php";
}

@Override
protected void onPostExecute(String result) {
addmarkers(result);
}

Selection of slots
After user selects the desire parking lot from the map the application creates virtual
parking lot picture and then user can select the empty slot and continue further with the
booking.

package com.example.smartpark;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;

public class Newbooking1 extends Activity


{
String lat,longi,info,lotname,user_email;
int totalslots,deluxslots,normalslots;
Context ctx;
String status;

Button but,b1;
RadioGroup radiogrp;
Button buttons[][];
RadioButton rb;

2
Chapter Implementati

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_newbooking1);

b1=(Button) findViewById(R.id.selectspace);

Intent i=getIntent(); info=i.getStringExtra("name"); lotname=i.getStringExtra("lotname"); lat =i.getStringEx

Toast.makeText(getApplicationContext(), " "+lat+" "+longi,Toast.LENGTH_SHORT).show();

parkingback b=new parkingback(ctx); b.execute(lat,longi);


}

class parkingback extends AsyncTask<String,String,String>


{
String url,json_string; Context ctx;
public parkingback(Context ctx) { this.ctx=ctx;}

@Override
protected void onPreExecute() { url="";
}
@Override
protected void onPostExecute(String result) {

JSONObject obj; JSONArray arr;

try {
obj=new JSONObject(result);
arr=obj.getJSONArray("result");
int count=0;
String name;
while (count<arr.length())
{
JSONObject jobj=arr.getJSONObject(count);
name=jobj.getString("lott_name");
totalslots=jobj.getInt("totalslots");
deluxslots=jobj.getInt("deluxslots");
normalslots=jobj.getInt("normalslots");

2
Chapter Implementati

displaylots(name,totalslots,deluxslots,normalslots);
count++;
}
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

private void displaylots(final String name, int totalslots, final int deluxslots, final int
normalslots) {
// TODO Auto-generated method stub
radiogrp=(RadioGroup)findViewById(R.id.selectparkingstatus);
radiogrp.setOnCheckedChangeListener(new OnCheckedChangeListener() {

private void lotselected(String name,int slot)


{
final int slots=slot/2;
final int cols=2;
buttons=new Button[slots][cols];

TableLayout tb=(TableLayout)findViewById(R.id.table);
tb.removeAllViews();
for(int i=0;i<(slots/2);i++)
{
TableRow tr=new TableRow(Newbooking1.this);

tb.addView(tr);
tr.setLayoutParams(new TableLayout.LayoutParams(
TableLayout.LayoutParams.MATCH_PARENT,
TableLayout.LayoutParams.WRAP_CONTENT,1.0f));

for(int j=0;j<2;j++)
{
final int row=i;
final int col=j;
final Button b=new Button(Newbooking1.this);
b.setLayoutParams(new TableRow.LayoutParams(
TableRow.LayoutParams.MATCH_PARENT,

TableRow.LayoutParams.MATCH_PARENT,1.0f
));

b.setText("slot "+i+","+j);

if(j==0)
{
b.setTag(""+i+""+(j+1));
}
else
{
b.setTag(""+i+""+(j+2));

2
Chapter Implementati

}
tr.addView(b);
buttons[row][col]=b;

final Drawable d=b.getBackground();


b.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
if(b.getBackground()==d )
{
lockbuttons(slots,cols);
gridbuttonclicked(row,col);
b1.setVisibility(View.VISIBLE);

}
else
{
for(int i=0;i<(slots/2);i++)
{
for(int j=0;j<2;j++)
{

/*setselected();
for(int i=0;i<lot_status.length;i++)
{
if(lot_status[i].equals("Normal slots"))
{
int temp1,temp2;
temp1=updateid[i]%10;
updateid[i]=updateid[i]/10;
temp2=updateid[i];
if(temp1==3)
{
temp1=temp1-2;
}
else
{
temp1=temp1-1;
}
but=buttons[temp2][temp1];

int wid=but.getWidth();
int heig=but.getHeight();
Toast.makeText(getApplicationContext(), ""+wid+"x"+heig,
Toast.LENGTH_LONG).show();

Bitmap
or=BitmapFactory.decodeResource(getResources(),R.drawable.car);
Bitmap sc=Bitmap.createScaledBitmap(or, wid, heig, true);
Resources r=getResources();

3
Chapter Implementati

but.setBackground(new BitmapDrawable(r,sc));
but.setBackgroundResource(R.drawable.car1);
but.setEnabled(false);
}
} */
}

Booking Page
The final step in the booking system is the booking page where the user is asked to
select start time and end time and the details related to user are auto loaded by the
application based on logged-in user.After adding all details the parking slot is reserved and
user get invoice through e-mail.

package com.example.smartpark;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

import android.app.Activity;
import android.app.DatePickerDialog;
import android.app.TimePickerDialog;
import android.app.TimePickerDialog.OnTimeSetListener;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.TimePicker;
import android.widget.Toast;

public class Booking extends Activity {

int hour_x,minute_x, mYear, mMonth, mDay;


String id,starttime,endtime,date,name,lotname,status,user_email;
double amount=10;
Button b1,b2,b3,b4;
TextView e1,e2,e3,et1,et2,et3,et4;
final int dialog_id=0;
Context ctx;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_booking);
Intent i=getIntent();
id=i.getStringExtra("id");
lotname=i.getStringExtra("lotname");
name=i.getStringExtra("name");
name = name.replace("Welcome ", "");
status=i.getStringExtra("status");
user_email=i.getStringExtra("email");

3
Chapter Implementati

Toast.makeText(getApplicationContext(), " "+id+" "+name+" "+lotname+" "+status+"


"+user_email, Toast.LENGTH_SHORT).show();
e1=(TextView)findViewById(R.id.et_starttime);
e2=(TextView)findViewById(R.id.et_endtime);
e3=(TextView)findViewById(R.id.et_calender);
et1=(TextView)findViewById(R.id.diff);
et2=(TextView)findViewById(R.id.logedinas);
et3=(TextView)findViewById(R.id.logedinemail);
et4=(TextView)findViewById(R.id.fare);
initializebutton();
b4=(Button) findViewById(R.id.book);
b4.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
Toast.makeText(getApplicationContext(), starttime+"
"+endtime+" "+date, Toast.LENGTH_SHORT).show();
Bookback b=new Bookback(Booking.this);
String amount=et4.getText().toString();
b.execute(id,lotname,name,status,starttime,endtime,date,user_email,amount);
Intent i=new Intent(Booking.this,Userhome.class);
startActivity(i);}});}
public void initializebutton()
{

b1.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {

TimePickerDialog t=new TimePickerDialog(Booking.this,new


OnTimeSetListener() {

},hour_x, minute_x,true);

t.show();
});

b2.setOnClickListener(new OnClickListener() {

amount=Math.floor(amount);
et4.setText(amount+" Rs");

} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

final Calendar c = Calendar.getInstance();


mYear = c.get(Calendar.YEAR);
mMonth = c.get(Calendar.MONTH);

3
Chapter Implementati

mDay = c.get(Calendar.DAY_OF_MONTH);

DatePickerDialog datePickerDialog = new


DatePickerDialog(Booking.this, new
DatePickerDialog.OnDateSetListener() {

3
7 Types of

Chapter 7

Testing

7.1 Case
Test Test Id Test Case Expected Actual Result Pass/Fail
Results
1 Create a user User should be User was able to Pass
account allowed to create an
create an account
account successfully
2 Parking lot Owner should Owner was able Pass
Registration be able to to register
Register its lot his/her lot
with exact successfully
location and
plot marker on
map
3 Display of Lots The registered The lots are Pass
on Google map lots should be successfully
displayed to displayed on
user on Google Google maps
map using using markers
markers but only
markers near to
user are
displayed
4 Display of The user should The user is Pass
parking space be able to allowed to
slots choose its choose the slot
preferable slot for its parking
for parking

3
Chapter Testi

7.2 Types of Testing

Unit Testing
Unit testing involves the design of test cases that validate that the internal program logic is
functioning properly, and the program input produces valid outputs. All decision branches and
internal code flow should be validated. It is the testing of individual software units of the
application. It is done after the completion of an individual unit before integration. Unit tests
ensure that unique path of business process performs accurately to the documented
specifications and contains clearly defined inputs and expected results.
We have used this testing to check the working of individual codes used in the ‘Smartpark’
application. We checked that each code gives the right output.

Integration Testing

Integration tests are designed to test integrated software components to determine if they
actually run as one program. Integration tests demonstrate that although the components were
individually satisfaction, as shown by successfully unit testing, the combination is correct and
consistent. Integration testing is specifically aimed at exposing the problems that arise from
combination of components.
Integrating the different parts of the code to create the final software application. We used this
testing in getting the desired output from the final software application after combining all the
individual unit codes.

Black-box Testing

In black-box testing, we try various inputs and examine the resulting outputs. The black-box
testing can also be used for scenarios based test. In this test we verify whether it is taking
valid input and producing resultant out to the user. It is imaginary box testing that hides
internal working.

3
Chapter 8

Conclusion and Future work


The Smart Parking Booking application is one stop solution to the problems faced by
common people in finding the parking space for their vehicles. The application also serves to
provide the parking lot owners to earn money by making their free space available for parking
by registering on the application. It reduces the time consumption which a driver will face
while searching for parking space near his/her destination.
The application uses online payment option along with manual payment. The booking
reminder is send via email. Also the payment receipt invoice is mailed to the user. The
application also maintains a database of all the parking lots and the availability and cost which
is used in order to provide booking Information for the user to view the details of the booked
space and also to cancel the booking done previously. Also if the user does not reach on time
on the parking lot, the lot owner then waits for 30 minutes and if the user has not arrived then
sets the status as the space is not occupied and the admin the makes the space available to the
next user.

Future Work:

The application as of now has two modes of payment one is online payment and other is
manual payment (i.e. paying while parking the vehicle using invoice) but later on we expect
the implementation of QR code based system in which application will generatethe QR code
for generating booking details.
Also improvement in GUI is an always ongoing task in which we always look to improve the
interface to better serve our customers through all the transactions. We also aim to implement
a rating system in order to allow the users to rate the parking lot service which will helps
other user.

3
Appendix

1. Lucid chart

Lucid chart is a web based diagramming software which allows users to collaborate and work
together in real time to create flowcharts, organizational charts, website wireframes UML
designs, mind maps, software prototypes, and many other diagram types. Built on web standards
such as HTML5 and JavaScript, Lucid chart is supported in all modern web browsers like Google
Chrome, Firefox, Safari and Internet Explorer 8+.

2. Smart sheet

Smart sheet is an online project management, productivity and team collaboration software as a
service application based in Bellevue, Washington.
Its online project management tool works like a familiar spreadsheet, but with additional
functionality including cloud capabilities for sharing, attachments, integration with file storage
services and Gantt charts. Smart sheet combines functions found in Microsoft Excel, Project,
Access and Share point into a single application.
Smart sheet project and task management software is not targeted at a specific market niche, but
rather has customers spanning multiple industries, business functions and company size.
Customers include sporting events like the NFL Super Bowl, technology firms like Google,
Group on and Netflix

3
Literature Cited

IEEE standard
Journal Paper,

[1] Dr. Ir. TMA Ari Samadhi, Jayanti Putri Permata Runtuwarow, Angreine Kewo,
”APPLICATION FOR PARKING AREA WITH ANDROID SMARTPHONE”, Vol. 2, No. 1,
pp 63, 2015

[2] Mr. John Nair, Mr. Nimesh Gupta, Ms. Rakhee Mahadik, Mr. Chintan Chauhan, ”Innovative
Smart Car Parking System with NFC Access”, International Journal of Engineering and
Technical Research (IJETR) ISSN: 2321-0869, Volume-3, Issue-4, April 2015

[3] Mrs. D.J. Bonde, Rohit Sunil Shende, Ketan Suresh Gaikwad, Akshay Sambhaji Kedari and
Amol Uday Bhokre, ” AUTOMATED CAR PARKING SYSTEM COMMANDED BY
ANDROID APPLICATION”, 2014 International Conference on Computer Communication and
Informatics (ICCCI -2014), Jan. 03 – 05, 2014, Coimbatore, INDIA

3
Acknowledgements

We would like to express our gratitude to our guide Mr. Jerin Thankappan for his advice and guidance. His f
support and guidance. We thank the Almighty, our parents, siblings and friends for their support.

You might also like