Wednesday, February 18, 2015

A Simple Ibeacon Scanner App in Android

I have written several articles about the possible uses of Ibeacons but I have never tried to develop a demo software to show how Ibeacons really work so I decided to develop my own app. This app will run at least on Android devices with Android Jelly Bean 4.3 operating system and equipped with Bluetooth 4.0 hardware.

I have never developed an Android App before so this is my first attempt to develop an app. I will be relying heavily from the search results that google will return and my prior experiences as a developer will not help me.

As a noob in this domain, I have to have a strategy to get this task running in 24 hours so I have identified the following steps:
  1. I will get the latest version of Android Studio, the official Android Development Environment.
  2. Watch some youtube tutorials how to properly setup this IDE.
  3. Complete at least 1 full basic tutorial Android Developer's Portal.
  4. I will use the source code of the Android app I used from my previous article More Fun with HM-10 and read something more about BlueTooth Low Energy API that is already inlcuded within the Android Studio.
  5. If all else fail, then it is a failure.
After 12 hours, I came up with a simple app capable of detecting Ibeacons and display them on screen. Here is a screenshot of the app:

The original app does not check whether the device it detected is an ibeacon so I did some research how to check if the device is an Ibeacon.

This is how ibeacons work:
Ibeacons continously transmit their identity(device name, mac address, uuid, minor, major, etc) which includes the pattern that makes it an ibeacon.

The ibeacon signal or the advertisement packet that we need to check is on the 6th byte of the transmitted signal ignoring the first few bytes which corresponds to the company or manufacturer identifier, the value should be equal to 0x02 and we need to confirm the length of the transmitted signal and it should be 0x15 which is located on the 7th byte.

The received bytes each time a bluetooth device is found is stored and can be processed within the callback component.

This app that I just developed provides a basic solution and can be further developed to meet almost every requirement for specific ibeacon application. Developing an full android app is not my expertise but I will continue to keep on developing this app until I become an expert. 

Update: If you are interested to check the app I created you may download it here: https://t.co/8XxjA8NGmh
And the source code can downloaded here : https://t.co/ryV9qT5QTW

The app frequently crashes because the code I inserted is still incomplete, it still needs further enhancement, error-catching routines to prevent it from crashing.

2 comments:

  1. Can you leave a link to a finished github repository in THIS article? Thanks.

    ReplyDelete
  2. Thank you so much for sharing this one ibeacon app all Kind of peaceful info,Love it- ibeacon app development

    ReplyDelete