Using iBeacons in Titanium

download Using iBeacons in Titanium

of 39

  • date post

    23-Aug-2014
  • Category

    Mobile

  • view

    1.178
  • download

    0

Embed Size (px)

description

iBeacons show great promise, but real-world issues prevent them from working as well as we might like. This presentation describes the issues and proposes some possible solutions.

Transcript of Using iBeacons in Titanium

  • Implementing BeaconTechnology inTitanium!! Martin Hudson!! BEACONS Mobile Data Systems! http://www.mobiledatasystems.co
  • INDOOR LOCALISATION GPS is not an option - Low spatial discrimination (10m)! - Poor signal penetrance through buildings! Unique building shapes - Signal reection issues! Noisy environment - Many signals, varying crowd density
  • BEACONTECHNOLOGY Small Bluetooth emitting devices! Battery powered! Signicantly larger range than NFC! Uses Bluetooth Low Energy (LE) protocol
  • Geofencing Passive process, alerting user to location based information! Outdoors - Reminders! Indoors - Art gallery walkthroughs! - Special offers Geolocation Active process, providing user with precise location! Outdoors & Indoors - Route navigation USE CASES
  • Geofencing Passive process, alerting user to location based information! Outdoors - Reminders! Indoors - Art gallery walkthroughs! - Special offers Geolocation Active process, providing user with precise location! Outdoors & Indoors - Route navigation USE CASES
  • BARRIERSTO ENTRY Upfront costs - Beacons, licences for services! Implementation - Installation of beacons, databases, content! Security - Physical and software
  • BEACONS IN ACTION
  • BEACONS IN ACTION UUID Major RSSI Minor Power Complement
  • ABSORPTION ISSUES
  • ABSORPTION ISSUES
  • ABSORPTION ISSUES
  • BUFFER ZONES
  • BUFFER ZONES
  • BUFFER ZONES
  • BUFFER ZONES Entrance Region Exit Region
  • BUFFER ZONES
  • BUFFER ZONES
  • BUFFER ZONES
  • BUFFER ZONES
  • BUFFER ZONES
  • 1 2 3 4 TRIANGULATION
  • 1 2 3 4 Triangulation is highly inaccurate - Reection TRIANGULATION
  • 1 2 3 4 Triangulation is highly inaccurate - Reection - Refraction TRIANGULATION
  • 1 2 3 4 Each point x,y co-ordinates Collect several training data sets at different orientations Beacon 1 RSSI! Beacon 2 RSSI! Beacon 3 RSSI! Beacon 1 RSSI! Beacon 2 RSSI! Beacon 3 RSSI! Beacon 1 RSSI! Beacon 2 RSSI! Beacon 3 RSSI! Beacon 1 RSSI! Beacon 2 RSSI! Beacon 3 RSSI! FINGERPRINTING
  • Mobile device receives an RSSI from each beacon, creating its own data set. The received data set is compared with the training data set to estimate the most probable user location 1 2 3 4 FINGERPRINTING
  • TIBEACON MODULE Allows you to create up to 5 beacon regions! Regions dened by;! - UUID! - UUID and major! - UUID, major, and minor
  • ACCESSINGTHE MODULE To access the module in JavaScript, you would do the following;! ! ! TheTiBeacon variable is a reference to the Module object. var TiBeacon = require("co.mobiledatasystems.tibeacon");
  • REFERENCE The following functions are exposed;! initializeBeaconMonitoring - used to register the app with core location services startMonitoringBeaconRegion - can be called several times and is used to register a region with core location services stopMonitoringBeaconRegion - used to stop and clear down a region and remove it from core location services! stopAllBeacons - used to stop and clear down all the beacon regions and remove them all from core location services! sendLocalNotication - a convenience function that allows you to send an immediate local notication
  • initializeBeaconMonitoring arguments:! success - A function that is called when the module successfully registers with core location services.! error - A function that is called when the module fails to register with core location services.! region - A function that is called when we detect we have entered or exited a beacon region.! ranged - A function that is called whenever we successfully process beacon monitoring (roughly every second) and returns the beacons found.! change - A function that is called when we detect another beacon is the nearest one.! purpose: Used to register the app with core location services.We specify the functions that will be called when one of the modules events re.
  • initializeBeaconMonitoring TiBeacon.initializeBeaconMonitoring({ success:function(e){ //called when we have registered core location services }, error:function(e){ //called if we fail to register the core location services alert("This device doesn't support iBeacons"); }, region:function(e){ //called when we enter or exit a region }, ranged:function(e){ //when the app is in foreground, this returns all the beacons }, change:function(e){ //called when a new beacon becomes the nearest one } }); !
  • startMonitoringBeaconRegion arguments: ! uuid -The uuid we will listen for, estimotes use this by default B9407F30-F5F8-466E- AFF9-25556B57FE6D.! major -The major value that the beacon will transmit (optional, may be omitted).! minor -The minor value that the beacon will transmit (optional, may be omitted).! identier - A string we use to identify the region. It is returned in the beacon data so we can identify the region the beacon belongs to.! notifyEntryStateOnDisplay - Should be left set to true, used for module debugging purposes.! keepRanging - When we have exited a region, if false ranging will be switched off until we detect we entered the region again. This may be slow but signicantly saves battery power. Setting to true leaves ranging on, improving performance at the expense of power consumption.
  • startMonitoringBeaconRegion purpose: ! We call this once we have successfully registered the module with core location services. Core location services will detect when we have entered or exited a beacon region, even if the app is no longer running and will re the regionChanged event.This is exposed in the region event in the 'initializeBeaconMonitoring' function.! If the app is running in foreground and the 'keepRanging' argument is 'true' then regardless of whether we are in a region we will continue to check for beacons.! If a beacon is detected that belongs to the beacon region, its data is returned in the ranged event.This is exposed in the ranged event in the 'initializeBeaconMonitoring' function. If we detect that a different beacon in the same region is now neared then the change event is red.
  • startMonitoringBeaconRegion // begin monitoring a specific region. // must initialise beacons before calling this method // we can call this several times to create different regions to monitor ! beacons.startMonitoringBeaconRegion({ uuid:'B9407F30-F5F8-466E-AFF9-25556B57FE6D', identifier:'all', // a logical name that is returned when beacons // fire events so we can easily identify which // region they belong to ! notifyEntryStateOnDisplay:true, ! keepRanging:true // tells the module to keep on ranging even if // no beacons are in a region, this improves // performance at the expense of power consumption }); ! !
  • stopMonitoringBeaconRegion arguments:! identier -The string we used to identify the region when we started monitoring.! purpose: Stop monitoring for that region and remove it from core location services.You can therefore safely call startMonitoringBeaconRegion again to begin monitoring for the same region if you then wish.
  • stopMonitoringBeaconRegion arguments:! identier -The string we used to identify the region when we started monitoring.! purpose: Stop monitoring for that region and remove it from core location services.You can therefore safely call startMonitoringBeaconRegion again to begin monitoring for the same region if you then wish. stopAllBeacons arguments: None! purpose: Stop monitoring for all the regions and remove them from core location services.
  • stopping Monitoring // stop monitoring for a specific region ! // we can stop a specific region TiBeacon.stopMonitoringBeaconRegion({ identifier:'all' }); ! // or we can stop monitoring all the regions // stop monitoring all regions TiBeacon.stopAllBeacons();