iBeacons Everywhere

Pierce Boggan

iBeacons were everywhere at Xamarin Evolve this year. From the Evolve Quest app, to the Darwin Lounge, to the presentation I gave with James, attendees got to experience using iBeacons as end users, learn about them in a lecture setting, and do hands on coding with them on both iOS and Android.

iBeacons at Evolve

Among the fun activities for people to do at Xamarin Evolve were the mini-hacks in the Darwin Lounge. Included in these was an Estimote iBeacon mini-hack that allowed attendees to create a simple app to experience iBeacons for themselves. The iBeacon mini-hack is available in the mini-hack repo on GitHub so you can try it yourself.

mini-hacks

The iBeacon mini-hack consists of a simple example that uses either Core Location on iOS to detect the proximity of an Estimote beacon, or the Estimote SDK Xamarin component on Android.

The code is different on each platform since these are different APIs, however conceptually it is very similar. For example, both platforms implement the concept of ranging, where the app will discover the proximity to a beacon.

On iOS, the CLLocationManager implements this in the DidRangeBeacons event:

// iOS uses CLLocationManager.DidRangeBeacons
locationManager.DidRangeBeacons += (object sender,
  CLRegionBeaconsRangedEventArgs e) => { ... }

whereas on Android it goes through the BeaconManager‘s Ranging event:

// Android uses BeaconManager.Ranging
beaconManager.Ranging += (object sender,
  BeaconManager.RangingEventArgs e) => { ... }

The mini-hack has some other goodness, too. In the iOS case, the walkthrough also shows you how to handle the new authorization and setup requirements for Core Location that were added in iOS 8.

I uploaded my completed solution for the mini-hack here.

Check out the mini-hack and see if you can come up with some novel use-cases for deploying iBeacons.

Happy ranging!

0 comments

Discussion is closed.

Feedback usabilla icon