Open access peer-reviewed chapter

Geo Location of Mobile Device

By Bashar M. Nema and Ali Nafaa Jaafar

Submitted: October 25th 2019Reviewed: March 17th 2020Published: August 26th 2020

DOI: 10.5772/intechopen.92154

Downloaded: 44


The proliferation of cellular network enabled users through various positioning tools to track locations; location information is being continuously captured from mobile phones, where a prototype is created that enables to detect locations based on using the two invariant models for Global Systems for Mobile (GSM) and Universal Mobile Telecommunications System (UMTS). The smartphone application on an Android platform applies the location-sensing run as a background process, and the localization method is based on cell phones. The proposed application is associated with remote server and used to track a smartphone without permissions and Internet. Mobile stores data location information in the database (SQLite) and then transfers it into location API to obtain locations’ result implemented in Google Maps. Track a smartphone with fixed identifiers mostly SSN (SIM (Subscriber Identity Module) Serial Number) and IMEI (International Mobile Equipment Identity) derived from an identifying string unique to the user’s device. The location result is moderately correct according to the cellular networks GSM and UMTS, which are used for obtaining location information.


  • tracking
  • Web services
  • MySQL
  • Mobile device

1. Introduction

Engineers and researchers have studied the cellular wireless systems offering reliable mobile location estimates for the past few years because of its temporal/spatial nature and rich context [1]. The mobile device’s location has become an important topic in wireless communication despite its low cost and transmission over the control channel owning short response time. The GSM/UMTS can be used to obtain location information without additional external hardware when there is cellular coverage [2]. Location-based services (LBS) for mobile devices have grown rapidly over the past few years and forecasts show similar growth in the future. As the need for tracking mobiles in our daily life is increasing, it became tracking thousands of users periodically; tracking mobiles by cellular networks does not need any hardware change within the core network. Tracking a smartphone is possible by exploiting a permanent mobile data link [3].

The mobile device used the location information consisting of Cell Identifier (cell ID), Location Area Code (LAC), Mobile Network Code (MNC), and Mobile Country Code (MCC). The location information is stored inside the SQLite database in mobile device periodically [4].

The contributions in this chapter can be summarized as follows: we utilize location information for a mobile device that is always available in the cellular network. We create an application of an efficient, easy-to-use, and inexpensive mobile device tracking system; the application provides the better balance between location accuracy and battery power. The location information collected during the mobile device roaming between the base stations connects them and the location information enables us to track the mobile device to see the historical location; the application can be used in any place in world covered by cellular network GSM/UMTS, compared to the information of location with the location APIs to provide the mobile device location. This work offers proactive services of assistance that consequently tell their users when they enter or leave the limits of pre-characterized focal points.

2. Structural GSM/UMTS architecture

The GSM network structure is divided into a base station subsystem and core network, which is shown in the Figure 1. The Base Transceiver Station (BTS) is a main communication area with mobile phones. BTS is linked to the Base Station Controller (BSC), which controls the small set of BTSs. These are linked using an interface known as the (A-bis) interface. The BSC handles the radio channel setup and frequency hopping control and links with a Mobile Switching Center (MSC) via the interface termed the (A interface). The core of a network subsystem is an Authentication Center (AuC) that provides authentication, allowing users to access the network. MSC via interfaces with the Visitor Location Register (VLR) and Home Location Register (HLR) provides location information for a network [5].

Figure 1.

The architecture GSM/UMTS network [5].

The connections originate in the fixed network (Public Switched Telephone Network (PSTN) and Integrated Services Digital Network (ISDN)). The connections have to pass through a dedicated Gateway Mobile Switching Center (GMSC). SIM card Serial Number (SSN) is stored on the SIM card. SIM is inserted to the mobile for providing information around the subscriber. IMEI consists of 15 digit number to identify a mobile phone. IMEI is checked when the mobile phone is trying to access the network and compared with an Equipment Identity Register (EIR) database. EIR registers equipment data rather than subscriber data [6].

UMTS network structure is divided into the UMTS Terrestrial Radio Access Network (UTRAN) and core network. UTRAN includes two nodes (the NodeB and Radio Network Controller (RNC)). Each RNC controls one or more NodeBs and is responsible for the control of radio resource parameters of cells managed by those NodeBs [7].

The Home Subscriber Server (HSS) is a database that communicates directly with a Gateway GPRS Support Node (GGSN) and Service GPRS Support Node (SGSN). SGSN, HSS, and GGSN exchange signaling messages only. Every GGSN can serve multiple SGSNs and every SGSN can serve multiple RNCs. RNC provides an air interface (Iub) between a mobile terminal and a core network, and an air interface (Iur) between RNCs.

There are two fundamental differences among GSM and UMTS systems. GSM networks use a methodology of more than one database communication (HLR and VLRs). The neighboring RNCs can ability to communicate with one another. In GSM systems, there is no immediate correspondence between neighboring VLRs and the correspondence is occurring just through the HLR. UMTS systems utilize a methodology with just a single database (HSS) to record the movements of the portable terminals [5].

3. GSM/UMTS-based localization

Cell-ID (ID) in combination with the MCC, the LAC, and the MNC is the unique identifier of the BTS. The Cell-ID of the BTS has the association with certain Mobile Station (MS), which is known by the mobile device and can be utilized to appraise the position of the mobile device [8]. GSM/UMTS service zone is separated into Location Areas (LAs), where every LA incorporates at least one radio cells. Every LA and radio cell has a unique identifier named Cell-ID and LAC [9].

BTS covers the set of cells, each of them identified by the unique Cell-ID (C1, C2, and C3 as shown in Figure 2). MS persistently chooses a cell and trades information and signaling traffic with the relating BTS. The cells are assembled into groups, every one of them distinguished by a Location Area Identifier (LAI). So as to maintain a strategic to avoid excessive signaling traffic, as long as the MS is in idle mode, the system knows just the LAI. The network gets mindful of the Cell-ID just when the MS switches into a dedicated mode, in particular when the channel is utilized to really establish a call. MS always knows the Cell-ID of the cell it is in. The size of a cell may range some meters; accuracy depends on cell size (illustrate in Table 1) [10].

Figure 2.

A simplified view of the cellular network and the mobile station is within the cell C3 [10].

Cell typeCell dimension (meter)
Small macrocell1000–3000
Large macrocell3000–30,000

Table 1.

The size range of cell type [10].

4. Android platform

Android is the platform introduced in 2007 for devices such as smartphones or tablets developed by Google, which is a Linux-based operating system and an open source code designed for touch screen mobile device. The applications were developed in Java language, which allows the software to be freely modified using the Android Studio software development kit (SDK). The SDK contains a comprehensive set of software libraries supported by integrated development environment (IDE), the Android Studio (Android 7.0) to get the cell ID, LAC, MMC, MNC, IMEI, and SSN of an Android mobile, and the database (SQLite) used to store this cell ID, LAC, MMC, and MNC values into periodical processes that are running as background process by applying Android service; Google Maps get from Web service the latitude and longitude in the format of a Java Script Object Notation (JSON) file, the Android mobile support from both Google Maps and third-party developers (remotely connect to a MySQL database) [11].

5. Web service

A Web service is the software designed to support communication between mobile application and remote server and location API over a network. The Web service designed to provide compute location information results in obtaining specific geographic regions (longitude and latitude) after connected with location API according to request by users; the Web service uses an online portal developed in the PHP which is an open source general; the Web service sends and receives data with insert/delete, and the Web service performs the tasks and generates output in the JSON format [12]:

[{"gsmlatitude":"33.24567","gsmlongitude":"44.362478","datetime":"2017/12/22 17:17:26"},{"gsmlatitude":"33.245621","gsmlongitude":"44.362425","datetime":"2017/12/22 17:22:12"},{"gsmlatitude":"33.245621","gsmlongitude":"44.362425","datetime":"2017/12/22 17:28:36"},{"gsmlatitude":"33.249792","gsmlongitude":"44.358406","datetime":"2017/12/22 17:33:19"},{"gsmlatitude":"33.249792","gsmlongitude":"44.358406","datetime":"2017/12/22 17:38:55"}]

Representational State Transfer (REST) is a structural style for creating Web services and exploits the advances and conventions of the World Wide Web, the relationship between the mobile and remote server by volley technique method proposed by Google 2013. The plan utilizes POST and JSON configurations to move information [13].

6. Tracking system

In order to implement a mobile tracking system with a GSM/UMTS network of detection of mobile location for places visited through your phone, the mobile device tracker connects with the tower BTS and stores location information (cell id, LAC, MCC, MNC) continuously for each specific period (5 minutes) in SQLite Database. All these processes run as background by applying Android service which is without a suspect by the mobile user. When mobile connected with internet can retrieve location information from SQLite Database of the mobile device, the location information transfer into the remote server during synchronizing between SQLite and MySQL. The server uses PHP and MySQL and can get all the necessary data to locate the phone. The PHP file will compute both latitude and longitude for location information that is stored in MySQL during which connections are created with location API to obtain the locations visited by the mobile device and the results are stored in MySQL. The data (latitude and longitude) is then transferred to the mobile device in the form of the JSON format and Google Maps is used that will plot the locations. Figure 3 shows the tracking system.

Figure 3.

Proposed tracking system.

In this section, we propose a tracking system algorithm to develop models of the relationship between the mobile application and the server site. The proposed algorithm can be implemented in six steps, which are described in Algorithm (1):

Algorithm (1): Description of the tracking system:

Step 1: The mobile device can read the location information (cell id, LAC, MCC, MNC) using cellular network (GSM/UMTS) every 5 minutes. The location information, IMEI, SSN, and current date&time were stored in the SQLite database every 5 minutes. Note IMEI, SSN, and current date&time can be obtained from the mobile device.

Step 2: Always have 100 records inside the SQLite database to maintain the storage space of the mobile device. In case of addition, the first field is deleted to guarantee nonexceeded 100 fields.

Step 3: Transfer location information, IMEI, SSN, and date&time from SQLite into the remote database MySQL using Volley Technologies and Web services, the server has received (IMEI, SSN, cell ID, LAC, MNC, MCC) via POST.

Step 4: The Web services provided communication between MySQL and the location API; the location information is then transferred into a location API for obtaining latitude and longitude of each record; the link location API uses URL= obtain the latitude and longitude.

Step 5: The results store latitude and longitude received from the location API in the MySQL database and create a JSON file.

Step 6: Through the mobile application, the data location is queried from the external database MySQL and received in the form of the JSON file format; the results use a JSON parser to display the location on Google Maps.

The tracking system can be separated into two parts that are mobile application and server site.

  • Mobile application

The Android mobile application obtains IMEI, SSN, and current location information (cell id, LAC, MNC, MCC) in the four parameters; the four parameters are considered the basic and latitude and longitude can be found.

These application processes are run in a background service using the Android service. This allows it to run operations without affecting your user so that it can continue to update current location information of the four parameters at specific intervals and periodically for a particular time to be designated by request service while device users move around towers of the mobile phone. After obtaining four parameters it stored in the SQLite database of the internal storage with the IMEI number and the SIM card serial number and the current date and time, this continues to store inside SQLite even if the mobile becomes the screen off and without the need to connect the mobile phone to the Internet, the Figure 4 shows sequence diagram the mobile tracking.

Figure 4.

A sequence diagram of mobile tracking using GSM/UMTS.

The SQLite database can store a maximum of 100 records which does not affect the storage capacity of the mobile device with the increasing data stored; in case if the record number inside SQLite database exceeds 100 records, the application deletes the first record and adds the current record at the end of the table. After connecting to the Internet, the mobile device can synchronize data between SQLite and MySQL using the JSON format as intermediate.

  • Server site

The server side includes a scripting language to be embedded into a PHP source document and a MySQL that is uses the open source relational database management system. After transferring four parameters to MySQL, create a connection between database MySQL and location API sitehttp://us1.unwiredlabs.comso as to retrieve latitude/longitude from four parameters in all records and the output is stored in MySQL database. All records in a table have a specific IMEI number, this send the data to the Android mobile application in JSON format.

7. Results

We have successfully implemented an Android application of a mobile tracking system by using a GSM/UMTS network; the application was run on December 21, 2017, for the distance from Baghdad to Samarra, the location information was recorded every 5 minutes, that can find the nearest position visited, the mobile was not connected with Internet. Some results were shown in Figure 5. The results we see after calculating latitude and longitude depending on the location information of the GSM/UMTS network are described in Table 2.

Figure 5.

Display result in Google Maps: (a) when the first marker is clicked, data&time are displayed; (b) with middle marker, title is displayed; (c) with the last marker, the title marker data and time is displayed.

idMCCMNCLACCell IDIMEISim serialDate&timeLatitudeLongitude
855418051400319945606359435058919189899640544000331706221/12/2017 6:12:1133.24566544.362809
856418051400319945609359435058919189899640544000331706221/12/2017 6:17:0433.24514444.362708
857418051400319949440359435058919189899640544000331706221/12/2017 6:22:4733.25443944.358063
858418051400319943755359435058919189899640544000331706221/12/2017 6:27:5233.27960644.349513
859418051400219946338359435058919189899640544000331706221/12/2017 6:32:3733.3008444.323802
860418051400819807215359435058919189899640544000331706221/12/2017 6:37:2433.44941744.261456
861418051400819807215359435058919189899640544000331706221/12/2017 6:42:2233.4494244.26146
862418051400819813445359435058919189899640544000331706221/12/2017 6:47:0633.48907944.226421
863418051400819820716359435058919189899640544000331706221/12/2017 6:52:4133.5282944.240307
86441805709650555359435058919189899640544000331706221/12/2017 6:57:2833.64715444.237929
86541805709653415359435058919189899640544000331706221/12/2017 7:02:3733.78222444.259622
86641805709653415359435058919189899640544000331706221/12/2017 7:07:2433.78222444.259622
86741805709653415359435058919189899640544000331706221/12/2017 7:12:1133.78222444.259622
86841805709651317359435058919189899640544000331706221/12/2017 7:17:0433.85594644.242762

Table 2.

Computing latitude and longitude from basis parameters.

The application updates a location information that can also cause heavy battery consumption; this can be lowered to achieve better battery efficiency. The location information updates every 5 minutes the interval at which the current location is updated. Table 3 illustrates the different intervals that can affect the battery life. The work creates new opportunities to perform tracking on remote servers, using a mobile device only to capture the location information and display the output results. The Volley Technologies provided the good communication infrastructure to transfer a data to the remote server and vice versa. When is receiving 25 requests for transferring the data between the mobile device and the remote server, compare a sync task and volley technology, a sync discussion 13.957 milliseconds and the volley discussion 4.275 milliseconds. Some tracking applications depended on GPS; there exist situations where GPS is not available, and the solution is to combine the GPS measured values with the measured values from the GSM/UMTS. This work provides a service that automatically tells their users when they enter or leave a boundary of predefined points of interest such as application Tammini from Zain.

Time intervalDetails
Every 5 secondsThis provides heavy consumption of battery power
Every 1 minutesThis is the default setting, which provides a better battery power
Every 30 minutesThis provides better battery efficiency

Table 3.

Computing frequency update intervals.

8. Conclusion

The application showed a low-cost tracking system using a GSM/UMTS network, which is suitable for the works all over the world with the combination of the Android mobile phone and Web services. The overhead is much lower compared to average battery consumption, and the application successfully tracks mobile across a single sensing. We demonstrated tracking using a cheap hardware with open source projects and showed mapping techniques with cell tower databases to take advantage of tracking a mobile device. Finally, we proposed an improvement in location accuracy by using GSM/UMTS tracking that could be implemented without connecting to API location, thus using external geographical information and achieving the best performance for mobile dynamic location with Kalman filters.

© 2020 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution 3.0 License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

How to cite and reference

Link to this chapter Copy to clipboard

Cite this chapter Copy to clipboard

Bashar M. Nema and Ali Nafaa Jaafar (August 26th 2020). Geo Location of Mobile Device, Recent Trends in Communication Networks, Pinaki Mitra, IntechOpen, DOI: 10.5772/intechopen.92154. Available from:

chapter statistics

44total chapter downloads

More statistics for editors and authors

Login to your personal dashboard for more detailed statistics on your publications.

Access personal reporting

Related Content

This Book

Next chapter

Cognitive Radio-Modulation and Demodulation

By Madhuri Gummineni and Trinatha Rao Polipalli

Related Book

First chapter

Introductory Chapter: Recent Advances in Cryptography and Network Security

By Pinaki Mitra

We are IntechOpen, the world's leading publisher of Open Access books. Built by scientists, for scientists. Our readership spans scientists, professors, researchers, librarians, and students, as well as business professionals. We share our knowledge and peer-reveiwed research papers with libraries, scientific and engineering societies, and also work with corporate R&D departments and government entities.

More About Us