A Guide to Location Aware Apps
Location Services Insights for Developers
Latest posts by Madalin
- A Guide to Location Aware Apps - November 5, 2018
What are Location Aware Apps?
First of all, what is “location?” This actually depends on what the app uses the location for. It may be a region or country if the app only cares about that, or a city if the app needs to show tourist attractions, the exact GPS position for navigation apps or the proximity to special gadgets like a beacon to detect if a user enters a restaurant.
So we can say that a location aware application is an app that has access to the user’s location to some extent, from very precise to very loose. But just knowing the location doesn’t really say anything, an application always needs to justify its need to access it, and usually, it’s used for some features.
Features and Examples
What features can a location-aware app offer to the user? There’s a very broad range of what an application can do with the user’s location. It can vary from the core functionality – the app can literally only work properly if it has the location it needs – to a feature that’s optional, without which the app can perfectly deliver the core functionality the user needs. But let’s look at some concrete examples:
Waze Navigation & Live Traffic – We all know and love Waze, but disable its access to location and it’s not going to be that useful anymore. Sure, the live traffic feature is great, but at its core, the exact GPS location is absolutely necessary.
Facebook – Wes, there are many things Facebook wants to know and location is no exception. Of course, users can never be sure what an app does with the personal data it has access to (maybe except users of services under GDPR), but what we can notice is at least one useful feature that needs the location – easier check-in. When location access is enabled, you get a list of suggestions for places close to your location, so you don’t need to type and search for that bar you’re at but you don’t know how to search for.
Groupon – A very popular app you can use to find great deals and save lots of money doing things you like. Here, they use the approximate location to show relevant deals. You don’t really want to see a deal of 50% off a haircut that’s 500 miles away, do you?
In this case, location access isn’t vital to the core functionality but it’s also not used for an optional feature. It actually improves the core functionality (showing deals) because if you travel to another city you automatically get deals nearby, you don’t need to change the location manually.
Combine the power of live location with geofencing, and use it to send targeted notifications to users who visit the city where you own a restaurant.
Launch Here – A very different and smart app that doesn’t use the user’s location in coordinates, but by proximity to beacons. You place a few of these gadgets around the house and when you approach one of them, the app will launch another app that you associated with that particular beacon. For example, place one on your fridge and tell it to open your favourite to-do list app so you can easily update your grocery list.
Of course, the possibilities are endless with beacons. Use them to automatically detect students’ attendance to a course, automatically balance the lines to a stadium entrance or even turn phones into beacons that strangers can use to kickstart a conversation with people who have similar interests.
How do they do it?
There are several ways an application can get your rreal-timelocation. Most of them will provide latitude and longitude coordinates, but not all of them.
Cell Tower Triangulation
Triangulation actually means using angles to determine the location. Cell towers usually have three antennas that send and receive signal in a 120-degree angle, like you can see in the picture. So they use angles, but the signal strength is also an indicator for the distance to the antenna, and when we also take distance into account, it’s called triangulateration.
The accuracy of the location determined by cell towers can vary from meters to kilometers, but for some apps, it’s good enough to determine the city the user is currently in. The upside is that this method is the most battery efficient.
Yes, wireless networks can be used to determine the coordinates of a device. You don’t even need to be connected! It works similarly to cell towers, by detecting nearby devices that provide WiFi signal, but the difference between WiFi and cell towers is that WiFi antennas are usually non-directional, communicating with devices over 360 degrees. So they only take signal strength into account to measure the approximate distance, and this is what is called trilateration.
Given that the signal strength of WiFi devices is a lot smaller than cell towers, it means that there’s less room for error, but your device needs to use its WiFi radio so it uses up a little more battery than in the cell tower case.
Global Positioning System
Widely known as GPS, this is probably the most known way of determining the position of a device. We even refer to latitude and longitude as GPS coordinates, but that’s misleading.
This works by trilateration, just like WiFi. Satellites broadcast their position and time through their signal, which receivers like your phone or car GPS pick up and use to determine the distance to each satellite. Do this for at least three satellites, and you have a pretty accurate location.
Accuracy is good but it comes at a cost: very big battery usage. Your device needs to constantly communicate with several satellites to get the precise location, so naturally, it needs a lot of power for capturing all that weak signal.
Not very popular and mostly used indoor, beacons are gadgets that use Bluetooth to send data to receivers like smartphones. The core principle is the same – use some sort of signal to receive location-related data and do the math to determine the device location, more or less accurate. In this case, the beacons use Bluetooth Low Energy (BLE) as the signal medium.
Unlike the previous technologies that are used to determine an approximate set of coordinates on the globe, beacons can be used just to detect when a user enters a building. If you have a home automation app, it can use a beacon to detect when you get home and turn on the lights, music, air conditioner, and launch a cooking app.
The accuracy of beacons is good enough for indoor location, given the low range of the signal, and battery usage is low enough to not worry about it, just like it’s the case with WiFi.
NFC tags are similar to beacons, but they don’t send a signal to receivers. Instead, NFC readers use a magnetic field to power the microchip in the tag, which contains some data. These data can be anything from simple text to location or payment information, so actually, NFC is used for many other things, not just location.
The accuracy if obviously the best you can get, because you need to be within a centimeter close to the tag to scan it. Battery life is also not an issue since you only use it for a second.
On iOS and Android, there are frameworks that allow app developers to easily use location services and transparently communicate to the user exactly what the live location is used for. You can get the last known location, request location updates, set up geofencing and more.
“Core Location provides services for determining a device’s geographic location, altitude, orientation, or position relative to a nearby iBeacon. The framework uses all available onboard hardware, including Wi-Fi, GPS, Bluetooth, magnetometer, barometer, and cellular hardware to gather data.”
These frameworks allow developers to express their needs for location access without thinking too much about the different technologies that determine the location. It can be as easy as “I want the current location within a 200 meters range”.
As a developer, you can request the operating system to notify you on significant location changes, for example when you leave or arrive in a city, but also more complicated rules.
More than that, it’s a really powerful tool especially considering that as a developer you can’t or don’t want to always request the user’s location. Either the OS won’t allow you to do that or users will notice and deny your location access. Battery life is also an important aspect because you don’t want to always keep an eye on location, draining the user’s battery, just to know when they leave the city.
Should You Use Location in Your App?
Absolutely maybe! Of course, it only depends on the features in your app. If you need a location for the core functionality, you will implement it and request access. If you have a feature that a user can choose to use or not, design your app such that it can smoothly work without location access. But keep in mind that there are a lot of smart things you can do with location services as a developer, and if you can exploit them, do it.
Latest posts by Madalin
- A Guide to Location Aware Apps - November 5, 2018