iBeacon Scanner Android

At In The Pocket‘s Harald I’ve developed a library for Android: the iBeacon Scanner Android library.

This library takes the pain away when you want to scan for iBeacons on Android. You register the iBeacons you are interested in and via a callback you are notified when you enter or exit the range of an iBeacon.

You can read more about this on In The Pockets developer blog.

On top of that I created 2 apps that build upon this library:

  • iBeacon Scanner scans for all the iBeacons around you and displays them.
  • iBacon allows you to broadcast an iBeacon via your bluetooth chip on your Android phone.

The singleton

While I agree that a Singleton shouldn’t be used to often, I do want to share my favourite way to implement the singleton pattern for reference.

public class Example
{
    private static Example instance;

    private Example()
    {
        // this class cannot get instantiated
    }

    public static Example getInstance()
    {
        if (instance == null)
        {
            instance = new Example();
        }

        return instance;
    }
}