Accuracy Evaluation of Location Service Modes on Mobile Devices

The widespread use of location-based services requires accurate user positioning information provided by location sensing systems. To facilitate destination searching and navigation tasks, both outdoors and indoors, mobile device users can use navigation services such as Google maps together with location services, which use information from cellular, Wi-Fi, Bluetooth, and Global Positioning System (GPS) networks to determine approximate locations. Mobile devices offer three kinds of location service modes: high accuracy, battery saving, and device only. The default high-accuracy mode is most used but it rapidly consumes battery life. In this study, we investigated the accuracies of the three location modes in various scenarios, and used scatterplots in R software to visually display and evaluate positioning accuracies. The experimental results show that for static locations, in an indoor environment, the battery-saving mode is most accurate, while in the outdoor environment, the device-only mode is most accurate, the high-accuracy mode is second, and the battery-saving mode is the least accurate. Finally, we perform dynamic positioning at locations on an outdoor route, and find that the high-accuracy mode is the most accurate when the mobile device is in motion.


Introduction
Nowadays, location-based services (LBSs) have been applied in real world applications in numerous areas, including tracking, marketing, emergency services, information services, and navigation. The widespread use of LBSs requires accurate user positioning information both outdoors and indoors. Web mapping services, such as Google Maps developed by Google, can provide people with easy and fast positioning and facilitate navigation to destinations. Google Maps application programming interfaces (APIs) are available for web browsers and Android or iOS apps. Android mobile devices have three built-in location service modes: high accuracy, battery saving, and device only. Usually, mobile device users just select the high-accuracy mode as the default location mode for positioning and navigation.
To determine locations, the high-accuracy mode uses the device's built-in Global Positioning System (GPS) receiver, Wi-Fi and mobile network connections; the battery-saving mode uses Wi-Fi and mobile networks; and the device-only mode uses GPS only.
The purpose of this study is to explore the differences in the three location service modes, and to analyze and compare their accuracies in various application scenarios, including in indoor and outdoor environments for static locations, and dynamic locations along an outdoor route when the mobile device is in motion. Additionally, for data visualization, scatterplots are created using R software with the ggplot2 package.

Background
In this section, we provide overviews of background technologies and related studies.

GPS
The GPS, developed, maintained, and controlled by the U.S. Air Force, is one of the Global Navigation Satellite Systems (GNSSs) that provide worldwide coverage for end users with location services, including time, speed, and location information. GPS is free and available for civilian use; however, it does not emphasize security measures such as integrity and confidentiality, and is vulnerable to jamming or denial of service (DoS) and spoofing attacks. (1) GPS is widely used for positioning, but its signal is weak (−130 dBm indoors and −125 dBm outdoors) and very susceptible to interference from buildings or a signal that has reached the receiver antenna by two or more different paths, and it is easily masked by other transmissions, either from jammers or malfunctioning electronic equipment. Google combines GPS with Wi-Fi technologies to improve positioning and navigation services. The indoor tracking problem is more challenging than the problem of indoor localization. (2) When GPS operation in indoor or obstructed environments is not feasible, some ad hoc solutions such as impulse radio ultra wideband (UWB) techniques can be used for indoor tracking. (3) GPS cannot provide precise location information in all situations; GPS receivers are not reliable in dense environments (e.g., urban canyons), indoor environments (e.g., parking garages), or any location without a direct line of sight to an adequate number of satellites. (4) To improve localization accuracy, an integrated localization algorithm can be used, which exploits all possible data from different resources, including GPS, radio-frequency identification, and vehicle-to-vehicle communications. (5) For positioning in challenged environments, such as indoors, many approaches have been proposed. For example, the concept of assisted GPS has significantly expanded the applications for GPS receivers and can be applied for positioning in challenged environments. (6) To confirm the reliability of using GPS on mobiles phones as a source of location information for LBS applications, empirical analyses of the positioning accuracy of location information obtained using GPS-enabled mobile phones have been performed, in which horizontal errors between 5.0 and 8.5 m were measured in static outdoor tests, and the horizontal errors were found to be larger in static indoor tests. (7)

Wi-Fi
Wi-Fi, a technology for a high-frequency wireless local area network (WLAN), is developed based on the 802.11b specification, which uses the unregulated radio signaling frequency (2.4 GHz) and has low cost but may suffer interference from home appliances. (8) To design and implement a Wi-Fi network, one needs to consider the specifications of the required hardware and software. For hardware, one needs to assess the distances of 802.11b links; for software, one needs to consider medium access control (MAC) protocol, routing protocol, network architecture, network management, and resource allocation. (9)(10)(11)(12) The Wi-Fi-based indoor localization of a device decides the position of devices with respect to access points. Many techniques exist to accomplish this, for example, the global indoor positioning system (GIPS) that utilizes crowd-sourced fingerprints. (13) Google sends Google Street view cars to collect longitude/latitude and MAC address data of wireless base stations and Wi-Fi nodes to establish a basic database. It updates the database through the Google location API inside users' mobile devices. When the positioning mode of mobile devices is turned on, it retrieves the latitude, longitude, and MAC address information of a nearby wireless network base station and uploads the data to update the database.

R software
R software, an integrated data processing and statistics programming language, supports data analytics with a powerful array and matrix operation capability and graphic tools. (14) In recent years, R has become very popular and has been used by many specialists such as statisticians, risk analysts, and researchers. R is free and open source software, and numerous packages written by its users can be found on the R official website. The rapid expansion of R is due to its flexibility in syntax, easy-to-edit features, object-oriented capabilities, and ability to execute user-defined functions and packages. In this study, for data visualization, scatterplots are created using the ggplot2 package in R software.

Experimental Design
The workflow of the experimental design is shown in Fig. 1. First, Google Maps is used to determine the latitude and longitude of the datum point of the destination location. After choosing a location service mode for the mobile device, latitude and longitude data of measurements are repeatedly acquired by the acquisition program developed with the Eclipse Platform until the preset iteration limit is reached. Finally, the distance d between each measurement and datum point is calculated according to Eq. (1).
Here, r, the Earth's radius, is 6378.137 km. The central angle Δσ between two points, S and F, is calculated using the Haversine formula in Eq. (2), which remains particularly well-conditioned for numerical computation even at small distances, unlike calculations based on the spherical law of cosines. (15) ∆σ = 2 sin −1 sin 2 ( ∆ϕ 2 ) + cos ϕ S cos ϕ F sin 2 ( ∆λ 2 ) Here, λ and φ are the longitudinal and latitudinal angles of the points S and F, respectively. The specifications of the cellular phone used in the experiment are listed as follows: HTC One M7; CPU, Snapdragon 600 1.7 GHz 4-core; graphics processing unit (GPU), Adreno 320; network, 3G; memory, 2 GB RAM.

Experimental Results and Analyses
In this section, experimental results of different application scenarios are presented and discussed.

Indoor environment
The latitude and longitude of the datum point in the indoor environment (located in a suburb of Taichung City, Taiwan) determined using Google Maps are 24.355040 and 120.609435, respectively. After selecting the location mode for the mobile device, positioning measurements are performed 30 times to retrieve the latitude and longitude values, and then distances between the datum point and the measured values are calculated.
In the indoor environment, the device-only mode is not applicable and no data are acquired during the experiment, since the GPS signals used for positioning suffer severe interference.
For the high-accuracy mode in the indoor environment, the average distance between the datum point and the measured values is computed to be 0.2152993 km. The scatterplot of the datum point and measured values with the high-accuracy mode in the indoor environment is shown in Fig. 2.
For the battery-saving mode in the indoor environment, the average distance between the datum point and the measured values is computed to be 0.09434 km. The scatterplot of the datum point and measured values with the battery-saving mode in the indoor environment is shown in Fig. 3.
From the scatterplots in Figs. 2 and 3, we observe that in indoor environments, the batterysaving mode is more accurate than the high-accuracy mode and is most suitable for the indoor positioning of a static location.

Outdoor environment
The latitude and longitude of the datum point in the outdoor environment (an outdoor basketball court in Tunghai University, Taiwan) determined using Google Maps are 24.181526 and 120.596618, respectively. After selecting the location mode for the mobile device, positioning measurements are repeatedly performed 50 times. In the outdoor environment, all three location modes are applicable.  For the high-accuracy mode in the outdoor environment, the average distance between the datum point and the measured values is computed to be 0.0223 km. The scatterplot of the datum point and measured values with the high-accuracy mode in the outdoor environment is shown in Fig. 4. Note that the retrieved latitude/longitude values are very close to one another; for Figs. 4-6, only the 6 digits following the decimal point are shown for the x-and y-axes.
For the battery-saving mode in the outdoor environment, the average distance between the datum point and the measured values is computed to be 0.060026 km. The scatterplot of the datum point and measured values with the battery-saving mode in the outdoor environment is shown in Fig. 5.
For the device-only mode in the outdoor environment, the average distance between the datum point and the measured values is computed to be 0.014578 km. The scatterplot of the datum point and measured values with the device-only mode in the outdoor environment is shown in Fig. 6. Note that fewer measured points are shown in Fig. 6, since several measured points are so close that they are shown as a point.
From the scatterplots in Figs. 4-6, we observe that in outdoor environments, the deviceonly mode is most accurate among the three location modes and is most suitable for the outdoor positioning of a static location. One reason for this result is that the device-only mode has saved coordinates of frequently visited places in the cache; hence, it is most accurate for positioning in these places.

Further study of high-accuracy mode and device-only mode in outdoor environment
We further compared the high-accuracy mode and the device-only mode in the outdoor environment, since both use GPS for positioning. As found in Sect. 4.2, the device-only mode has the coordinates of frequently visited places saved in the cache; hence, it is most accurate in  positioning for these outdoor places. In this experiment, the location measurements were taken at a frequently visited outdoor place, i.e., the sports field in the school (24.350571, 120.614619).
The high-accuracy mode was tested in two settings: one is to take location measurements immediately when one arrives at the place, and the other is to wait 30 s before taking measurements. The test results with the high-accuracy mode taking location measurements immediately and waiting 30 s before measuring are shown in scatterplots in Figs. 7 and 8, respectively. The average distances between the datum point and the measured values are 0.00357 and 0.0004 km, respectively, for taking location measurements immediately and waiting 30 s before measuring. Hence, the average distance is reduced by waiting 30 s before measuring.
We also performed location measurements with the device-only mode after waiting 30 s. The tests results with the device-only mode when waiting 30 s before measuring are shown in the scatterplot in Fig. 9; the average distance between the datum point and the measured values is 0.0002 km. Therefore, by waiting 30 s before taking location measurements, the accuracy of the high-accuracy mode is improved and similar to that of the device-only mode.

Dynamic location positioning
In this experiment, we compare the accuracy of the three location modes for outdoor dynamic location positioning, i.e., taking location measurements while the mobile device is being moved. We wrote an automatic acquisition program to retrieve location coordinates with the rate of six maps per minute. From the retrieved map data, we determined 30 locations in a route as the datum points. We moved along the route and performed dynamic positioning measurements at the 30 locations using all three location modes. Three tests, i.e., Tests 1-3, are taken with each location mode at the 30 locations along the route when the mobile device is moving. The test results of the high-accuracy mode, battery-saving mode, and device-only mode are shown in scatterplots in Figs. 10-12, respectively. From these three scatterplots, we observe that the high-accuracy mode has the densest scatterplot.
For the high-accuracy mode, the average distances between the 30 datum points and the measured values for Tests 1-3 were respectively computed to be 0.0091, 0.0068, and 0.0055 km (0.0071 km on average). For the battery-saving mode, the average distances between the 30 datum points and the measured values for Tests 1-3 were respectively computed to be 0.0624, 0.0608, and 0.0558 km (0.0597 km on average). For the device-only mode, the average distances between the 30 datum points and the measured values for Tests 1-3 were respectively computed to be 0.0213, 0.0094, and 0.0159 km (0.0155 km on average). We conclude that the high-accuracy mode is the most accurate for outdoor dynamic location positioning.

Conclusions
In general, mobile device users choose the high-accuracy mode as the default location mode for positioning and navigation, thinking that it will provide the most accurate outcomes. However, the experimental results show that in outdoor environments, the device-only mode is the most accurate among the three location modes, whereas in indoor environments, the battery-saving mode is the most accurate in positioning, since the GPS signals used by the highaccuracy mode and the device-only mode are easily interfered with by indoor obstacles and the buildings themselves. In addition, we performed dynamic positioning at 30 locations along an outdoor route when the mobile device is in motion, and found that the high-accuracy mode is   the most accurate if one performs location measurements while moving. In the future, we plan to perform location accuracy analysis for mobile devices with other operating systems such as iOS and to compare their location performance with that of Android devices.