The ability for smartphones to offer location services fostered major opportunities for app developers looking to create new apps and enhance functionality of existing apps. Tinder, FourSquare, & Waze use geolocation in the center of their functionality to great success. In combination, these three apps can help a user determine a dinner companion, restaurant of choice, and route to the restaurant. By delivering location-sensitive information to users regardless of where they are in the country, these apps appeal to massive audiences.
Programming geolocation services into an app will have a major impact on the overall quality of the app—and it’s easier said than done. Inefficient geolocation services drain device battery life and deliver inaccurate location data. When apps drain battery life, users uninstall them. In order to determine the best method of programming geolocation services, it is vital for app developers to know who is going to be using the app and how they are going to use it.
Location can be determined by a smartphone in a number of ways. The most widespread include:
Cell ID: When GPS isn’t available, phones can use Cell ID, information from cellular towers, to determine location. Cell ID is ideal in big cities with vast amounts of cell towers. Serial fans should be familiar with how cellular tower information can be vital in identifying one’s location. GPS & Cell ID can also work in conjunction to deliver a more precise GPS location.
Wi-Fi: Devices can detect Wi-Fi networks in the same way they can detect cellular towers, but Wi-Fi is more precise as Wi-Fi networks cover smaller regions. Devices can use RSSI (Received Signal Strength Indication) to refer signals from the phone with Wi-Fi points database. Devices can also use the user’s frequently visited places, a profile or wireless fingerprint based on locations in Wi-Fi networks frequented by the user. Wi-Fi can identify a user’s position within 2 meters of accuracy.
The decision of how an app should prioritize these three methods to determine location is a vital one. If users are located in the city, that means both dense Wi-Fi router and cell tower coverage will open up options. If the app is being used primarily in a domestic situation, Wi-Fi might be both the most accurate and efficient method. Apps designed for rural areas may have to use Wi-Fi due to lack of cell towers.
Geofencing utilizes a device’s GPS to determine a user’s distance from a particular point. Geofencing can sense when a user enters within a set radius defined by the coordinates of its center. Geofencing will sense when users are inside or outside of a retailer and offer action prompts for either space. There are three types of geofencing:
Static geofencing is based on a user’s position in relation to a specific place. For example, a retailer app sends a message to users who pull into the parking lot of a mall containing the retailer.
Dynamic geofencing takes into account both a user’s location and a changing data stream. For example, a parking app sends the user a message about a recently evacuated parking space that the user is approaching.
Combined geofencing determines when a user enters into a location in relation to other users. For example, apps like Yelp, Facebook, or FourSquare send notifications if a friend checks into a nearby merchant .
CREATING BATTERY-EFFICIENT APPLICATIONS
Making a geolocation app battery-efficient is one of the biggest challenges app developers face in the programming stage. Developers must create a comprehensive strategy based on their audience.
ACTION THRESHOLDS: Defining accurate action thresholds and use-cases for an app’s geolocation services will dictate its level of battery-efficiency. The more precise your location accuracy requirements, the greater the battery drain. Action thresholds and use-cases define how an app is intended to be used, allowing a framework for developers to enact an efficient model of internal processes for location determination.
COMPREHENSIVE TESTING: Testing the app aggressively to gather a large amount of data is the only way to know the most efficient action thresholds. The more the developer understands how an app is being used, the more they can refine their programming. After release, continuing to gather analytics from user behavior and refine tactics based on how users are getting value from the app becomes a crucial ongoing process.
POLLING FREQUENCY: One of the major variables dictated by action thresholds is polling frequency. The more an app polls for locations, the better its location accuracy. The necessary level of location accuracy varies depending on the app. The precision of location accuracy necessary for an app to be functional can vary. A restaurant app, for example, might be able to get away with accuracy from 200 meters to a few kilometers, while an app that locates friends might need accuracy within 10 – 20 meters.
Evaluating the most efficient polling frequency requires thorough use-cases and some creativity. Programmers can design algorithms to reduce polling frequency if an app hasn’t changed locations for several minutes. Programmers can also analyze the speed of the device and use this data to change polling frequencies. A developer may elect to increase polling frequency as a car accelerates to ensure they maintain location accuracy within a selected radius.
DEFERRING TO OS: Many major mobile platforms will share geolocation information at an operating system level. As a result, any app that is listening can receive location updates requested by other apps. By deferring to other apps already polling for location data, apps can minimize battery drain while still retaining acceptable location data.
Check out Apple and Android’s developers’ sites for more information on best practices for programming location services.