Location-based applications are software that uses where a person, vehicle or item is to decide what to show or what to record. For a business, the useful ones are rarely about advertising to passers-by. They send the nearest engineer to a job, prove that a visit took place, show a customer where a delivery has got to and find the closest depot with stock. Most of this can be built with technology already in every phone, and a good part of it works in an ordinary web browser.
How a device knows where it is
A phone or tablet works out its position from several sources and combines them without the user noticing.
- Satellite positioning. GPS and the other satellite systems give the best accuracy outdoors with a clear view of the sky. They work poorly indoors and between tall buildings.
- Wi-Fi and the mobile network. The device estimates its position from the Wi-Fi networks and phone masts it can detect. This works indoors and is less precise.
- Bluetooth beacons. A beacon is a small battery-powered transmitter fixed to a wall or shelf. An app that picks up its signal knows the phone is close to that spot. Apple’s iBeacon is the best-known standard. Beacons are used where satellites cannot reach: zones in a warehouse, wards in a hospital, checkpoints on a security patrol.
Software does not deal with these sources directly. It asks the operating system for the position and receives coordinates together with an estimate of how accurate they are.
For some jobs there is a simpler method still. A QR code or NFC tag fixed at a location, scanned by the person who arrives there, proves presence at a known place with no positioning at all.
What businesses use location for
- Field service. Offer a new job to the nearest free engineer, put the day’s visits in a sensible order and give the customer a realistic arrival time.
- Proof of attendance. Stamp the time and place when a carer, cleaner or inspector starts and finishes a visit, and attach the position to photographs taken on site.
- Delivery tracking. Show customers where their delivery is and when to expect it, often inside a customer portal. It cuts down the calls asking where an order has got to.
- Asset tracking. Know which site a trailer, generator or piece of hire equipment is on, using a tracker fitted to the item.
- Lone working. Hold the last known position of someone working alone, so that help can be sent to the right place.
- Nearest branch or stockist. Let a visitor to your website find the closest place to buy or collect.
A related technique is geofencing: drawing a virtual boundary round a place and having the software act when a device crosses it. Typical uses are clocking a worker on when they arrive at a site, or raising an alert when a trailer leaves the yard at night.
Web application or installed app
A web application can read a device’s position through a standard browser feature called the Geolocation API. It is supported by every current browser, it is available only on secure (HTTPS) pages, and the browser asks the user’s permission first. For anything of the form “record where I am when I press this button”, that is all you need.
What a web page cannot do is carry on when it is closed. Continuous tracking with the phone locked, geofences and beacon detection belong to installed apps.
| What you need | Web application | Installed app |
|---|---|---|
| Record the position when the user presses a button | Yes | Yes |
| Show the nearest branch or job on a map | Yes | Yes |
| Follow the position while the screen is on | Yes, while the page stays open | Yes |
| Track with the phone locked or the app closed | No | Yes, if the user allows it |
| Geofence alerts | No | Yes |
| Detect Bluetooth beacons | Not on an iPhone | Yes |
Geofences are less immediate than people expect. Google’s documentation for Android says that an app in the background is told about a crossing every couple of minutes, and it limits each app to 100 active geofences. Design the process round “within a few minutes”, and do not promise the second somebody crosses the line.
The wider choice between browser and app, including the options in between, is covered in our comparison of native apps and web apps.
Accuracy, battery and running costs
Accuracy varies, so the software must allow for it. Each reading arrives with an estimated margin of error. Store that margin with the reading, and avoid rules that need more precision than the device can give. A rule that an engineer must be within 50 metres of the site to start a job will fail inside a steel-framed building or a basement. Give people a way to proceed with a reason recorded, or the office will spend its day taking calls from staff who are standing in the right place.
Users control what they share. Both iPhones and Android phones let the owner refuse location access, allow it only while the app is in use, or share an approximate position in place of a precise one. The application has to behave sensibly in each case.
Tracking uses battery. Frequent readings drain a phone, and both operating systems restrict background location to protect battery life. Decide how often a position is really needed. For most scheduling purposes every few minutes is plenty.
Maps and address lookups are a running cost. Drawing maps, turning addresses into coordinates and calculating routes are services you buy. Google Maps Platform charges by usage, with a free monthly allowance and subscription plans. OpenStreetMap data is free to use under an open licence as long as you credit it, although somebody still has to host and serve the maps. Estimate how many lookups a normal month will involve before choosing.
Privacy and the law
The location of an identifiable person is personal data, so UK data protection law applies to it.
Tracking your own staff counts as monitoring workers. The Information Commissioner’s Office has published guidance on this for employers. It says that you must identify a lawful basis, make sure workers know what is being collected and why, use the least intrusive means of achieving your purpose, and carry out a data protection impact assessment before any monitoring likely to pose a high risk to them. Read that guidance and take advice before introducing tracking.
Some design decisions make this much easier:
- record location only during working time, and make it obvious in the app when tracking is on;
- collect a position at the moments that matter, such as arrival and departure, if a continuous trail is not needed;
- let staff see what has been recorded about them;
- set a period after which location history is deleted;
- do not reuse the data for a purpose nobody was told about.
The same principles apply to customers. Tell them what is collected, and collect no more than the feature needs.
Questions to settle before commissioning one
Answering these before you approach a supplier will save time and narrow the price. They fit alongside the other requirements in our software project planning worksheet.
- What decision or record will the location feed? If nothing changes as a result, leave it out.
- Is a position needed at certain moments, or continuously?
- How accurate must it be, and what should happen when the reading is poor?
- Who or what is being located, and have the people involved been told?
- What should happen with no signal? The usual answer is to store readings on the device and send them later.
- Which existing system needs the result: scheduling, payroll, the customer portal?
- How long will the history be kept?
If a position is needed only at certain moments and staff usually have a signal when they record it, a web application will probably do, and the project is smaller than you may have feared.