DEV Community

Rlogical Techsoft Pvt Ltd
Rlogical Techsoft Pvt Ltd

Posted on

Geo fencing in Android

What is Geo fencing?

Geofencing is a service that triggers an action when a device enters or exit from the specified predefined location or geographical area for given radius. This is a location-based service in which a creator of an app or other platform/software uses GPS, RFID, Wi-Fi or cellular data to send/trigger messages like SMS, Email or In-App/App-based notifications (pre-programmed action) when mobile devices that enter, exit, or remain parked in the geographical location.

Android allow you to create a geo fence by specifying the radius and lat-long (short for latitude and longitude) of the centre of the real geographical region that you wish to monitor.

Geofencing in Android

There are smart companies that send product offers or specific promotions to consumers’ smartphones when they trigger a search in a particular geographic location, enter a mall, neighborhood, or store.

How Does Geo fencing Work?

So far, we’ve covered a lot about Geo fencing and what it can do for your business. Do you know how it works?

It’s simple though. Geo fencing helps you to keep in control of your business by notifying you when a potential consumer is passing by your store, by a competitor’s, or entering into a predefined area.

Advantages of Geo fencing

It helps in targeting customers in shops or retail outlets with appropriate ads as well as direct them to desired sections in order to increase sales.

It helps in influencing purchase decisions.

It does not require additional hardware to implement it. Mobile apps are available for android and iOS operating systems.

It is very easy to implement and use with the help of google maps.

It is very cheaper due to less costly mobile phones and availability of free apps.
Enter fullscreen mode Exit fullscreen mode

Disadvantages of Geo fencing

The size and accuracy of the Geo fences depends on the location and positioning technologies used. The Geo fencing positioning technologies such as GPS, cellular and WI-Fi deliver accuracy from 20 meters to 50 meters. Smaller Geo fencing use Bluetooth positioning technologies such as iBeacons and Eddystone beacons. These technologies deliver accuracy of about 2 meters.

GPS positioning technique can also be used for Geo fencing but due to higher power consumption it is not recommended for battery hungry devices.
Enter fullscreen mode Exit fullscreen mode

Obtaining a Google Maps API Key

Because this app uses Google Maps, you’ll need to obtain an API key.

  1. Open Google Cloud Platformand create a new project.

    2.Select APIs & Services ▸ Maps SDK for Android ▸ Enable.

    1. Click on Credentials, Credentials in the API Manager, CREATE CREDENTIALSand then choose API key.
  2. Copy your API key value. In your project, replace YOUR_KEY_HERE with the copied value.

Learn in details with code and images here: https://www.rlogical.com/blog/how-to-integrate-geofencing-in-an-android-app/

Top comments (0)