Simple ways to develop iBeacon and Eddystone Beacon applications

Companies around the world are looking to deliver exceptional unique customer experience. Businesses require more customer engagements. Engaging a customer through their mobile phone is really important for business to grow.

Beacons can help provide a greater customer experience by providing context-aware information to the customers in their mobile phones.

Beacons are mostly used for the following purposes –

  1. Navigate buildings where there is limited GPS
  2. Track things smarter – warehouse navigation
  3. Provide alert to customer when they walk past the store

There are 3 major types of Beacons that is widely used –

  1. iBeacon from Apple – Most widely used – Simple to use – Supports both iOS and Android platform.
  2. Eddystone from Google – This format is also supported by both android and iOS. Eddystone has 3 frametypes – All 3 cans be transmitted at the same time. (1) URL – Directly pushes the content in the form of URL to any nearby devices. No custom app is needed to receive the URL. (2) UID – The custom app identifies the beacon using the UID and then responds accordingly. (3) Telemetry – This provides information about the health of the beacon itself.
  3. AltBeacon from radius networks – Focused on open source to support any platform not restricting to just iOS and Android.

Now, what are the elements needed in a beacon development platform?

  1. Beacons – BLE transmitters
  2. Mobile phones with Bluetooth turned on – Beacon scanners
  3. Mobile app – A mobile app which can act according to the beacons visibility and range
  4. AN AWESOME DEVELOPER 🙂

Google makes Beacon development much simpler using Google beacon platform.

Firstly, Let’s understand how beacons work by looking at the below picture –

A simple demonstration on how beacons work

So beacons are nothing but a simple BLE transmitters which always transmits continuous packets of data identifier. The mobile device then responds accordingly.

A simple architecture on beacon implementation is depicted below –

Beacon application development architecture using Google Beacon Platform

Now let’s start one by one to develop a simple beacon application –

First – Get the beacon hardware from any of the beacon manufacturers. There are plenty of options. In addition to beacons with BLE, most vendors have some customized sensors for light, temperature, etc.

Calibrate the beacons using the manufacturers mobile app. Adjust the RSSI and TX power values if needed. These values are crucial while calculating the range of the beacons from mobile device. Also provide Namespace and Instance ID for the beacons in Eddystone format.

Second – Create a Google account and enable NearBy API. Generate the API key under credentials in Google developer console.

Third – Register the beacons under Google beacon dashboard using BeacoonTools mobile app. You can add attachment to individual beacons. Attachments are nothing but data available for the beacons in Google cloud. I prefer to attach a JSON.

Atlast – Now use Nearby API and Google API in your app.

1. Nearby API – This let’s the app scan for any BLE beacons in range. Set the strategy to scan only for BLE.

SubscribeOptions options = new SubscribeOptions.Builder() .setStrategy(Strategy.BLE_ONLY)

2. Google API Client – This let’s the app to pick the right attachment associated with the beacon from Google cloud.

GoogleApiClient mGoogleApiClient = new GoogleApiClient.Builder(this) .addApi(Nearby.MESSAGES_API, new MessagesOptions.Builder() .setPermissions(NearbyPermissions).build()).addConnectionCallbacks(this) .enableAutoManage(this, this) .build();

Google Beacon Platform
Google Beacon Platform


Both Bluetooth and Location has to be turned on in the mobile device. Add run-time permission for location access.

That’s all – Beacon application development is as simple as this. However, like I mentioned earlier, there are varieties of purposes and usecases that can be derived through beacons. The basic workflow on implementing a beacon app is the same. Some improvisations and customization can be made to the flow explained above.

More excited to see how beacons can solve the real world problems.

Happy coding!!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.