Android Developer Tips | How to Set Up a Geofence on Esper

Keith Szot

November 12, 2019

Geofence is a function that mobile apps use to trigger device location alerts — text messages, emails, etc. — when connected to WiFi, Bluetooth, GPS, or cellular data. This functionality is useful for some dedicated device deployment scenarios to access the device’s location data. With geofencing, you use the device’s geographic area (typically determined by GPS) to trigger an alert when the Android device leaves a defined area. Common use cases include making sure a fleet of delivery devices stays in their virtual boundary-delivery zone, warehousing devices don’t stray far from the warehouse’s physical location, or restaurant ordering devices don’t leave the restaurant area.

The mobile device needs Internet connectivity, Wi-Fi access, and location services enabled for geofencing to work. So this is typically for cellular-connected devices with high accuracy location services enabled — whether smartphones or tablets.

Steps for setting up a Geofence

Setting up a geofence for a device on Esper is easy – it starts by selecting Geofence in Esper Console’s left navigation pane – this brings you up a wizard for quickly defining the geofence. Click on New Geofence.

In the first screen, you define the size of your geofence (meaning where you expect devices to be for this geofence) – it is a circle that can be as small as a 100m radius up to 10km. Note that GPS can drift and jump; thus, a geofence smaller than 100m can cause false positives. To set it up at a location simply type the address for the center of the circle, or drag it in the map view to set it up. Give it a name and description, and then click Next.

Now assign devices to this geofence – you can assign as many as you need that fit the criteria for the virtual fence. In this case, we are just doing one.

In the last step, you define the action to be taken when any of the assigned devices leave the geofence – you can either lock them, have them beep, or both. In this case, I went with beep!

That’s it! Here is a video tutorial to set up geofence on Esper platform.

Love this feature? Sign up with Esper to get started.