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

BSCS Mid-term PROJECT PROPOSAL

Android Application, Where is my Car?

Name: Muhammad Ahmad Ali

Session: 2018-2022

Roll No: 183232 BSCS 2018

Department of Computer Science and Engineering


Air University Multan Campus
Android Application, Where’s My Car?

Reg. No:
183232

Name:
Muhammad Ahmad Ali

Degree:
BSCS

SUPERVISED BY:

Engr. Ahmad Zesshan

A Project Dissertation Submitted to the Department of


Computer Sciences &
Engineering for partial fulfillment of the requirements of
Subject

Air University Multan Campus

© Copyright Air University Multan


All Rights Reserved

2
In the name of Allah Most Gracious Most Merciful

3
Declaration

This thesis is a presentation of my original research work. Wherever contributions of others are involved,
every effort is made to indicate this clearly, with due reference to the literature, and acknowledgement of
collaborative research and discussions. I also declare that this work is the result of my own investigations,
except where identified by references and free from plagiarism of the work of others.

Signature: ………….…….
Muhammad Ahmad Ali
Date: ………………..…....

4
DEPARTMENT OF COMPUTER SCIENCE
AIR UNIVERSITY MULTAN CAMPUS

CERTIFICATE

The undersigned hereby certify that they have read and recommend the thesis entitled “Thesis Title”
by Student Name for the degree of Bachelor of Studies in Computer Science.

_________________________________
Supervisor Name (AUMC), Project Supervisor

_________________________________
Co Supervisor Name (if any), Co-supervisor

_________________________________
Committee Member Name ( ), Committee Member

_________________________________
Committee Member Name ( ), Committee Member

_________________________________
Chairperson Name (AUMC), Chairperson of the Department

5
PROJECT BRIEF

PROJECT TITLE Android Application, Where’s my Car?

NAME OF ORGANIZATION Air University Multan Campus

SUPERVISED BY Engr. Ahmad Zesshan

STARTING DATE November 20, 2020

ENDING DATE November 29, 2020

SOURCE LANGUAGE Blocks, Java

COMPUTER USED AMD A10 Generation-V, 8 GB RAM

OPERATING SYSTEM Microsoft Windows 8.1

TOOLS USED MIT App Inventor, Google Chrome

6
Acknowledgments

First of all, I would like to express my gratitude towards my project supervisor Engr. Ahmad Zesshan for his
support and guidance throughout the project. Several thanks to my friends for his or her glorious co-
operation, inspirations, and supports throughout this study. This two year expertise with all you guys are
remembered as necessary memory on behalf of me to face the new chapter of the life as a computer
scientist. I acknowledge my sincere financial obligation and feeling to my oldsters for his or her love,
dream, and sacrifice throughout my life. I’m extremely glad for his or her sacrifice, patience, and
understanding that were inevitable to create this work doable.

Finally, I’d wish to thanks somebody that contributes to my final year project directly or indirectly. I’d wish
to acknowledge their comments and suggestions that were crucial for the self-made completion of this
study.

7
Dedication
First of all, I would like to give thanks to God because without His will I could not be able to do this project.
I dedicate this dissertation to my beloved parents and my family (Fahad, Asad and Saad) and teachers
because without their support, this wouldn’t have been possible. I hope this achievement will complete the
dream they have for me since they choose to give me the best they have.

8
Table of Contents
Chapter 1 : Introduction...............................................................................................................................12

1.1 Problem..............................................................................................................................................................12
1.2 Instruction.........................................................................................................................................................12
1.2.1 MIT App Inventor.....................................................................................................................................12
Chapter 2: Literature Review.......................................................................................................................13

2.1 Technical background......................................................................................................................................13


2.1.1 Global Positioning System (GPS)..............................................................................................................13
2.1.2 Google Map................................................................................................................................................13
2.1.3 Global System for Mobile Communication (GSM).................................................................................13
2.1.4 Subscriber Identity Module (SIM)............................................................................................................13
2.1.5 General Packet Radio Service (GPRS).....................................................................................................14
2.1.6 Android.......................................................................................................................................................14
2.2 Related works....................................................................................................................................................14
2.2.1 Vehicle tracking system based on Google map and smartphone application........................................15
2.2.2 Tracking system using GPS technology....................................................................................................15
Chapter 3: Methodology and Implementation............................................................................................17

3.1 Designing the Components...............................................................................................................................17


3.1.1 Properties of components..........................................................................................................................19
3.2 Add Behaviors to the Component....................................................................................................................20
3.2.1 Display the Current Location....................................................................................................................20
3.2.2 Displaying Directions to the Remembered Location...............................................................................22
3.2.3 Retrieve the Remembered Location when the App Launches................................................................23
3.2.4 Android Where’s My Car?: Complete App.............................................................................................24
Chapter 4: Results and Conclusions............................................................................................................25

4.1 Testing and results:...........................................................................................................................................25

9
Figure
Figure 1.1: Application....................................................................................................................................12
Figure 1.2: Mit app Inventor............................................................................................................................12
Figure 2.1: structure of GSM...........................................................................................................................13
Figure 2.2: structure of Android platform.......................................................................................................14
Figure 3.1: Screen1..........................................................................................................................................17
Figure 3.2: Screen2..........................................................................................................................................18
Table 3.1: components of Application.............................................................................................................19
Table 3.2:ActivityStarter’s properties are only partially shown in the user interface.....................................20
Table 3.3:Blocks for getting location reading and displaying in labels in the app's UI..................................21
Figure 3.3: Remember Button.........................................................................................................................21
Table 3.4. Blocks for recording and displaying the current location...............................................................22
Figure 3.4: Direction Button............................................................................................................................23
Figure 3.5: Initializing screen2........................................................................................................................24
Figure 3.6: full application blocks...................................................................................................................24
Figure 4.1: testing results.................................................................................................................................25

10
Table
Table 3.1: components of Application.............................................................................................................19
Table 3.2:ActivityStarter’s properties are only partially shown in the user interface.....................................20
Table 3.3:Blocks for getting location reading and displaying in labels in the app's UI..................................21
Table 3.4. Blocks for recording and displaying the current location...............................................................22

11
Chapter 1: Introduction

1.1 Problem
You parked somewhere near the stadium, but when the concert Figure 1.1: Application

ends you don’t have a clue where the car is. The friends you came with
are equally as clueless. Fortunately you haven’t lost your android phone that never forgets anything, and you
remember you have the hot new application, Android, Where’s My Car? Design an application on which
upon clicking, a button when you park your car, and the android uses its location sensor to record the car’s
GPS coordinates and Address. Later, when you reopen the application, it shows you a Map from where you
are to the remembered location.

1.2 Instruction
Design the application using MIT App Inventor.

1.2.1 MIT App Inventor


Introduction of MIT App Inventor. A web application
integrated development environment originally provided by
Google, and now maintained by the Massachusetts Institute of
Technology (MIT). It allows newcomers to computer
programming to create application software (apps) for two
operating systems (OS): Android, and iOS, which, as of
8 July 2019, is in final beta testing. It is free and open-source
Figure 1.2: Mit app Inventor
software released under dual licensing: a Creative Commons
Attribution ShareAlike 3.0 Unported license, and an Apache License 2.0 for the source code. It uses a
graphical user interface (GUI) very similar to the programming languages Scratch (programming language)
and the Star Logo. which allows users to drag and drop visual objects to create an application that can run
on android devices, while a App-Inventor Companion (The program that allows the app to run and debug
on) that works on iOS running devices are still under development. In creating App Inventor, Google drew
upon significant prior research in educational computing, and work done within Google on online
development environments. App Inventor and the other projects are based on and informed

12
by constructionist learning theories, which emphasize that programming can be a vehicle for engaging
powerful ideas through active learning. As such, it is part of an ongoing movement in computers and
education that began with the work of Seymour Papert and the MIT Logo Group in the 1960s, and has also
manifested itself with Mitchel Resnick’s work on Lego Mindstorms and Star Logo.

13
Chapter 2: Literature Review
2.1 Technical background
2.1.1 Global Positioning System (GPS)
GPS is a system composed of a network of 24 satellites of the US. The satellites periodically emit
radio signal to GPS receivers. The GPS receiver receives the signal from at least three satellites using
triangular technique to compute two-dimensions, or four satellites to compute three dimensions (latitude,
longitude and altitude).

2.1.2 Google Map


Is a version of Google Earth it’s free software to provide map by satellite image, the programming
language of Google Map is KML (keyhole mark-up language). It used to show lines and pins objects.

2.1.3 Global System for Mobile Communication (GSM)


GSM is a standard developed by the European telecommunication standards institute (ETSI) to
describe the protocols for second-generation (2G) digital cellular networks used by mobile phones, first
deployed in Finland in July 1991. As of 2014 it has become the default global standard for mobile
communications - with over (90%) market share, operating in over 219 countries and territories.

2.1.4 Subscriber Identity Module (SIM)


SIM is a detachable smart card considered one of the key features of GSM, SIM card containing the
user's subscription information and phone book. This allows the user to retain information after switching
handsets. Alternatively, the user can also change operators while retaining the handset simply by changing
the SIM.

Figure 2.1: structure of GSM

14
2.1.5 General Packet Radio Service (GPRS)
GPRS was originally standardized by European telecommunication standard Institute (ETSI).
Subsequently the 3GPP developed third-generation (3G) UMTS standards followed by fourth- generation
(4G) LTE (long term evolution) advanced standards, which do not form part of the ETSI GSM standard.

2.1.6 Android
Automated Numeration of Data Realized by Optimization Image Detection is a mobile operating
system (OS) currently developed by Google, based on the (Linux kernel) and designed primarily for
touchscreen mobile devices such as smartphones and tablets.

Figure 2.2: structure of Android platform

2.2 Related works


Tracking system is very important in our life; so many different solutions have proposed show as
related work bellow:

The low-cost vehicle tracking and monitoring system is presented to track and monitor vehicle status
that are used by certain party for particular purposes, and to provide location and time information anywhere
on earth. The proposed system consists of in-vehicle GPS receiver, GSM modems and microcontroller GPS
15
module shield is used to track and locate the position of the vehicle, and the GSM for sending warning
message to the owner of the vehicle and embedded controller. Google Maps used to show the current
location of the vehicle and usually locate device position with the help of network. the client just send one
message to the vehicle and the vehicle’s mobile will send you the current location of vehicle in the form of
web link and user has to click on a link and that link goes to Google map and will show the current location
of vehicle. Although using SMS technology which it’s convenient way of transferring and receiving data,
and it is inexpensive technology, but the web service is not available at the whole time, so an android phone
application can be useful for receiving data without internet.

The system presents a GPS and GSM based vehicle tracking system that provides the owner with
full security and track of the asset. GSM/GPS technology used for security purposes, whereas the theft
prevention system provided by Android application. The aim proposed is to implement miniature model by
using a single chip microcontroller in the vehicle. The system embedded in the vehicle, consist of a GSM
modem, GPS receiver, control relay, current sensor and Microcontroller

The system allows users to track the position, speed, water level, engine level and different
parameters. The owner just has to send an SMS and the tracking system installed inside the vehicle will
respond within a minute. User can stop the two wheeler when the vehicle under theft by android application.
In this system GPS, GSM is interfaced with atmega162 v microcontroller and 16x4 LCD display is used to
show some message to the user. The web to track the vehicle on internet, and an android application for
smart phone to track the vehicles on Google Maps without need of internet. That system shows and
introduced the traditional existing tracking systems in terms of cost, services, reliability and control.

2.2.1 Vehicle tracking system based on Google map and smartphone


application
The proposed system is used Google earth and smartphone application to track the vehicle at any
time and to solve various problems that faced in this urban life transportation. The system proposed a
vehicle tracking system using GPS/GSM/GPRS technology and a Smartphone application to provide better
service and cost effective solution for users. GPS is mounting on the vehicle which gives current location
and it is transport by GSM along with various parameters in the form of SMS to the receiver.
Microcontroller is used to read certain engine parameters from automobile data port, processes the GPS
information and to transmit this data to the server using GSM modem by SMS. Smartphone application to
track and monitor a vehicle location obtained from the system in-vehicle tracking device controlled by a
microcontroller. In this proposed system a vehicle location and all information are automatically placed on
Google map after processing using Smartphone application. Thus, users will be able to continuously
monitor a moving vehicle on demand.

2.2.2 Tracking system using GPS technology


The proposed “Hybrid GPS-GSM” system helps the police automobile distribution and theft caution;
it’s used SMS to track the vehicle, and used “kalman” filter to correct the current position. Whereas in other
proposed systems The Google Maps API is used to display the vehicle on the map in the Smartphone
application, moreover the system will locate target by the use of a Web application which that it require web
16
server to run. This tracking system monitors all hazard and threats, used for security, remote monitoring
transportation and other field, and alert message to mobile phone for remote information. Also this approach
presents low cost solution for automobile position and useful in the case of car theft situation. Although of
using smartphone or Google map on internet to track the vehicle, but the internet is not available at the
whole time to track the vehicle. Thus, off line android application can be useful for tracking and antitheft
situations. The propose system will give the exact location of vehicle with distance between user and
vehicle. The organizations are investing money in monitoring and tracking vehicles aiming at improving
services and ensuring the safety in cargos transports. Transmitting Side contains GPS, GSM and GPRS
functionality which is preloaded in a smart phone. The system contains single android mobile that is
equipped with GPS and GSM modems along with processor that is installed in vehicle. The system allows
those companies to monitor the travelled routes through a web client that using Google Maps API and
shows colors on the map to indicate if the devices on route.

17
Chapter 3: Methodology and Implementation
3.1 Designing the Components
The user interface for "Android, Where's My Car?" consists of two screens named as screen1 and
screen2. Screen1 consists of a button “Start”, label “copyright Ahmad” and a background image. Button and
label are place in verticalArrangement1. The image and verticalArrangement1 is place inside the
horizontalArrangement1.

Figure 3.1: Screen1

Screen2 consists of labels to show your current and remembered locations, and buttons to record a
location and show directions to it. You'll need some labels that just show static text; for
example, GPSLabel will provide the text "GPS:" that appears in the user interface. Other labels, such
as CurrentLatLabel, will display data from the location sensor. For these labels, you'll provide a default
value(0,0), which will change as the GPS acquires location information. You'll also need three non-visible
components: a LocationSensor for obtaining the current location, a TinyDB for storing locations
persistently, and an ActivityStarter for launching Google Maps to get directions between the current and
stored locations.

18
Figure 3.2: Screen2

Component Type Palette Group What you’ll name it Purpose of component

Label Basic CurrentHeaderLabe l A header, “Your


current location”
HorizontalArrangem ent Screen HorizontalArrange Arrange address info
Arrangement ment1
Label Basic CurrentAddressLab el Displays text, “Address:”

Label Basic CurrentAddressDat Displays dynamic data,


aLabel the current address
HorizontalArrangem ent Screen HorizontalArrange Arrange GPS info
Arrangement metnt2
Label Basic GPSLabel Displays text, “GPS:”

Label Basic CurrentLatLabel Displays dynamic data,


the current latitude
Label Basic CommaLabel Displays “,”

Label Basic CurrentLongLabel Displays dynamic data,


the current longitude

19
Button Basic RememberButton Click to record
current location.
Label Basic HorizontalArrange Arrange remembered
ment2 address info
Label Basic RememberedAddre Displays
ssLabel text,
“Remembered
Place”
Label Basic RememberedAddre Displays dynamic data,
ssDataLabel the remembered address
Label Basic RememberedGPSLa bel Displays text, “GPS”

Label Basic RememberedLatLa bel displays dynamic data,


the remembered latitude
Label Basic Comma2Label Displays “,”
Label Basic RemembreredLong Label Displays dynamic data, the
remembered longitude
Button Basic DirectionsButton Click to show map
LocationSensor Sensors LocationSensor1 Senses GPS info
TinyDB Basic TinyDB1 Stores remembered
location persistently
ActivityStarter Other stuff ActivityStarter1 Launches Maps
Table 3.1: components of Application

3.1.1 Properties of components


Set the properties of the components in the following way:
● Set the Text property for the labels with fixed text as specified in the above table.
● Set the Text property of the labels for dynamic GPS data to “0.0”
● Set the Text property of the labels for dynamic addresses to “unknown.
● Uncheck the Enabled property of the RememberButton and DirectionsButton.
● Set the ActivityStarter properties so that it will open Google Maps. (The
ActivityStarter’s properties are only partially shown in the user interface). Table
3.1 describes how they should be specified; you can leave all properties not listed
in the table blank.

Property Value

Action android.intent.action.VIEW

20
ActivityClass com.google.android.maps.MapsActivity

ActivityPackage com.google.android.apps.maps
Table 3.2:ActivityStarter’s properties are only partially shown in the user interface

3.2 Add Behaviors to the Component


You’ll need the following behaviors for this app:
● When the app start you see a start button to start the application.
● When the LocationSensor gets a reading, place the current location data into the
appropriate labels of the user interface. This will allow the user to know the sensor has read a
location and is ready to remember it.
● When the user clicks the RememberButton, copy the current location data into the labels
for the remembered location. You’ll also need to store the remembered location data so it will
be there if the user closes and re-launches the app.
● When the user clicks the DirectionsButton, launch Google Maps so it shows directions to the
remembered location.
When the app is re-launched, you should load the remembered location from the database into the application.

3.2.1 Display the Current Location


The LocationSensor.LocationChanged event occurs not just when the device’s location changes, but
also when the sensor first gets a reading. Sometimes that first reading will take a few seconds, and
sometimes you won’t get a reading at all if the sight lines to GPS satellites are blocked (and depending on
the device settings). For more information about GPS and LocationSensor, see chapter X, Reading and
Responding to Sensors.

Block Type Drawer Purpose

LocationSensor1.Location LocationSensor The event-handler that is


Changed triggered when phone received
a new GPS reading

set CurrentAddressDataLabel. CurrentAdressDataLabel Place the new data into the


Text to label for current address.

LocationSensor1.CurrentA LocationSensor This property gives you a street


ddress address.

set CurrentLatLabel.Text to CurrentLatLabel Place the latitude sensed into


appropriate label

21
value latitude My Definitions Plug into set block above

set CurrentLongLabel.Text to CurrentLongLabel Place the longitude sensed into


appropriate label

value longitude My Definitions Plug into set block above

set RememberButton.Enabled RememberButton As you now have a reading, let


to user remember it.

True Logic Plug into set block above

Table 3.3:Blocks for getting location reading and displaying in labels in the app's UI

3.2.1.1 How the Blocks Work


The RememberButton.Click event handler places the GPS readings into the corresponding text
labels so that they appear in the user interface. latitude and longitude are arguments of the LocationChanged
event, so you grab references to those in the My Definitions drawer. CurrentAddress is not an argument,
but a property of the LocationSensor, so you grab it from LocatonSensor's drawer. The LocationSensor does
some additional work for you by calling Google Maps to get a street address corresponding to the GPS
location. When the user clicks on the RememberButton, you’ll store the location data to the database.When the
app launches, you’ll load the location data from the database into a variable or property.

Figure 3.3: Remember Button

3.2.2 Displaying Directions to the Remembered Location


When the user clicks on the DirectionsButton, you want the app to open Google Maps with the
directions from the user’s current location to the remembered location (e.g., where the car is parked).The
ActivityStarter component can open any Android app, including Google Maps. You have to set some
configuration data to use it, but to open something like a Browser or Map, the data you need to specify is
fairly straightforward.To open a map, the key property to configure is the ActivityStarter.DataUri property.

22
You can set the property to any URL that you might enter directly in a browser. If you want to explore this,
open maps.google.com in your browser and ask for directions between, say, San Francisco and Oakland.
When they appear, click the link button in the top-right of the map and check URL that appears. This is the
kind of URL you need to build in your app. The difference for your app is that the directions map you’ll
create will be from a specific set of GPS co-ordinates to another (not city to city). The URL needs to be in
the following form:

http:/maps.google.com/maps?saddr=37.82557,-122.47898&daddr=37.81079,- 122.47710

Try typing that URL into a browser: can you tell which famous landmark it directs you across? For
this app, you need to build the URL and set its source address (saddr) and destination address (daddr)
parameters dynamically. You’ve put text together before in earlier chapters using make text; we’ll do that
here as well, plugging in the GPS data for the remembered and current place. You’ll put the URL you build
in as the ActivityStarter.DataUri property, then call ActiivtyStarter.StartActivity.
Table 3.4. Blocks for recording and displaying the current location

Block Type Drawer Purpose

DirectionsButton.Click DirectionsButton Triggered when the user clicks


“Directions”

set ActivityStarter.DataUri to ActivityStarter Set the URL for the map you
want to bring up

make text Text Build a URL from multiple


parts.

text (“http:// Text The fixed part of the URL


maps.google.com/maps?
saddr=”)

CurrentLatLabel.Text CurrentLatLabel The current latitude

text (“,”) Text Put a comma between lat and


long

CurrentLongLabel.Text CurrentLongLabel The current longitude

text (“&daddr=”) Text The second parameter of the


URL, for destination

RememberedLatLabel.Text RememberedLatLabel The remembered latitude

text (“,”) Text Put a comma between lat and

23
long

RememberedLongLabel.Te xt RememberedLongLabel The remembered longitude

ActivityStarter.StartActivity ActivityStarter This opens Maps

3.2.2.1 How the Blocks Work


When the user clicks the DirectionsButton, the event-handler builds a URL for a map and calls
ActivityStarter to launch the Maps application and load the map, as shown in Figure 3.4. Make text is used
to build the URL to send to the Maps application.

Figure 3.4: Direction Button

3.2.3 Retrieve the Remembered Location when the App Launches


The reason you store data in a database is so you can recall it later. In this app, if someone stores a
location and then closes the app, you want to recall that information from the database when the app is re-
launched, and show it to the user. As discussed in previous chapters, the Screen.lnitialize event is triggered
when your app launches. Retrieving data from a database is a very common thing to do on start-up, and it’s
exactly what we want to do for this application.

24
Figure 3.5: Initializing screen2

3.2.4 Android Where’s My Car?: Complete App

Figure 3.6: full application blocks

25
Chapter 4: Results and Conclusions
4.1 Testing and results:
I try this application with my car and it’s a successful experiment a few images are given below:

Figure 4.1: testing results.

Here we can see the location and the details in the form of longitude and latitude on the screen. The most
recent saved location is shown in the figure. This location details save in the database. And when we install
and open the application it needs permissions to access the GPS sensor for location.

26
References:
 https://www.cs.usfca.edu/~wolber/appinventor/book2011/
 https://appinventor.mit.edu/explore/ai2/tutorials
 https://www.researchgate.net/figure/Fig-12-Working-of-MIT-APP-Inventor-App-Inventor-involves-
three-aspects-i-App_fig7_325567957

27
28
29

You might also like