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 –
- Navigate buildings where there is limited GPS
- Track things smarter – warehouse navigation
- Provide alert to customer when they walk past the store
There are 3 major types of Beacons that is widely used –
- iBeacon from Apple – Most widely used – Simple to use – Supports both iOS and Android platform.
- 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.
- 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?
- Beacons – BLE transmitters
- Mobile phones with Bluetooth turned on – Beacon scanners
- Mobile app – A mobile app which can act according to the beacons visibility and range
- 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 –
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 –
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();
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.