{"id":15184,"date":"2014-10-31T12:45:46","date_gmt":"2014-10-31T16:45:46","guid":{"rendered":"http:\/\/blog.xamarin.com\/?p=15184"},"modified":"2014-10-31T12:45:46","modified_gmt":"2014-10-31T16:45:46","slug":"ibeacons-everywhere","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/xamarin\/ibeacons-everywhere\/","title":{"rendered":"iBeacons Everywhere"},"content":{"rendered":"<p>\t\t\t\tiBeacons were everywhere at Xamarin Evolve this year. From the <a href=\"https:\/\/github.com\/xamarin\/evolve-quest\" title=\"Quest app source code\" target=\"_blank\">Evolve Quest app<\/a>, to the Darwin Lounge, to the <a href=\"http:\/\/youtu.be\/YYTa_Rv5Pz4\" title=\"iBeacons and Location Awareness in iOS and Android Apps \" target=\"_blank\">presentation I gave with James<\/a>, 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.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-15189\" src=\"\/wp-content\/uploads\/sites\/44\/2019\/04\/beacons-evolve.png\" alt=\"iBeacons at Evolve\" width=\"590\" height=\"218\" \/><\/p>\n<p>Among the fun activities for people to do at Xamarin Evolve were the mini-hacks in the Darwin Lounge. Included in these was an <a href=\"http:\/\/estimote.com\/\" title=\"Estimote\" target=\"_blank\">Estimote<\/a> iBeacon mini-hack that allowed attendees to create a simple app to experience iBeacons for themselves. The iBeacon mini-hack is available in the <a href=\"https:\/\/github.com\/xamarin\/\" title=\"iBeacon mini-hack\" target=\"_blank\">mini-hack repo on GitHub<\/a> so you can try it yourself.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-15191\" src=\"\/wp-content\/uploads\/sites\/44\/2019\/04\/minihacks.png\" alt=\"mini-hacks\" width=\"718\" height=\"215\" \/><\/p>\n<p>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.<\/p>\n<p>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.<\/p>\n<p>On iOS, the <code>CLLocationManager<\/code> implements this in the <code>DidRangeBeacons<\/code> event:<\/p>\n<pre class=\"lang:csharp decode:true\">\n\/\/ iOS uses CLLocationManager.DidRangeBeacons\nlocationManager.DidRangeBeacons += (object sender,\n  CLRegionBeaconsRangedEventArgs e) =&gt; { ... }\n<\/pre>\n<p>whereas on Android it goes through the <code>BeaconManager<\/code>&#8216;s <code>Ranging<\/code> event:<\/p>\n<pre class=\"lang:csharp decode:true\">\n\/\/ Android uses BeaconManager.Ranging\nbeaconManager.Ranging += (object sender,\n  BeaconManager.RangingEventArgs e) =&gt; { ... }\n<\/pre>\n<p>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.<\/p>\n<p>I uploaded my completed solution for the mini-hack <a href=\"https:\/\/github.com\/xamarin\/\/solution\" title=\"iBeacon mini-hack solution\" target=\"_blank\">here<\/a>.<\/p>\n<p>Check out the mini-hack and see if you can come up with some novel use-cases for deploying iBeacons.<\/p>\n<p>Happy ranging!\t\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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. Among the fun [&hellip;]<\/p>\n","protected":false},"author":546,"featured_media":39167,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2],"tags":[4],"class_list":["post-15184","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-developers","tag-xamarin-platform"],"acf":[],"blog_post_summary":"<p>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. Among the fun [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts\/15184","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/users\/546"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/comments?post=15184"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts\/15184\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/media\/39167"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/media?parent=15184"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/categories?post=15184"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/tags?post=15184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}