Developing context aware applications with iBeacons technology

Preview:

DESCRIPTION

Having mobile applications that is context aware leads to interesting use cases. Imagine you are walking through a shopping mall and your mobile application shows near by shops where you are located, with information like products available, offers available etc as you walk by it. In this session, we will see a brief history of iBeacons, what it is and how it can be useful for building context aware applications. Also we will see how we can create an Android application using C# that is context aware.

Citation preview

www.unicomlearning.com

Emerging Technology Emerging Technology Summit 2014Summit 2014

www.cloudandmobility.org

26 Sept, 2014 - Bangalore26 Sept, 2014 - Bangalore

Developing Context Aware Applications using iBeacon Developing Context Aware Applications using iBeacon technologytechnology

Suresh BallaSuresh Balla

Principal ConsultantPrincipal Consultant

Neudesic, IndiaNeudesic, India

www.unicomlearning.comHeading

UNICOM PresentsUNICOM Presents

Emerging Technology Emerging Technology Summit-2014Summit-2014

Demo to set the stageWhat is an iBeacon technology?Why iBeacon technology?How to develop context aware mobile applications?Code Walkthrough Possibilities?

Demo

UNICOM Conference Event Mobile App

iBeacons

Proximity Technology – Enables Location Awareness Possibilities

Related Technologies

GPS – Location TechnologyNFC – One to one proximity based

communication

Bluetooth Low Energy (BLE)

• Bluetooth LE is a specification • The specification is used to create Bluetooth LE

chipsets e.g. Kontakt Chipset • The chipsets are embedded in devices e.g. Estimote

Device• Ultra low power consumption

• Streaming data• High data transfer data rates• Standard Bluetooth profile

Bluetooth Classic

iBeacons Specification

Apple Specification and Trademark on using Bluetooth LE/Smart for indoor proximity

Implementing specification is free, subject to Apple NDA

Devices with iBeacon Technology

• Called as Beacons• Obtain License from Apple– Technical specifications– iBeacon Logo– iBeacon Identity Guidelines

Different Beacons

How do iBeacons work?

• iBeacon broadcasts signal using a UUID• UUID is unique to a group of iBeacons, not an individual• Major• Minor

Configurations for Retail ScenarioStore Location Bangalore Hyderabad Mumbai

UUID 2F234454-CF6D-4A0F-ADF2-F4911BA9FFA7

Major 1 2 3

Minor Clothing 10 10 10

Housewares 20 20 20

Automative 30 30 30

iBeacons in Use• Devices can find iBeacons nearby that match a particular

UUID• This is known as ranging of beacons• Once found, device can determine power level of signal from

the beacon• Which in turn can approximate the distance• Three enumerated ranges supported in the specification

– IMMEDIATE, NEAR, and FAR

Beacons are not Smart!

• No network connectivity• No concept of devices that have discovered them• No storage or additional information beyond UUID, Major,

Minor

Device Compatibility

• iPhone 4S / iPad 3 and upwards, running iOS 7+• Android 4.3 and upwards, running Linux Kernel 3.4+ (with

Bluetooth 4.0 BLE)• Macs with Bluetooth 4 hardware, running Mavericks• Hardware vendors: Radius, Redbear, Estimote, and others

Developing Applications

iOS

• Support for iBeacons in CoreLocation in iOS 7.x• Create new CLBeaconRegion using UUID• DidRangeBeacons event used to detect nearby beacons• Returns array of beacons

iOS (Xamarin)private CLLocationManager locationManager;private NSUuid beaconUUID = new NSUuid (" 2F234454-CF6D-4A0F-ADF2-F4911BA9FFA7 ");private CLBeaconRegion beaconRegion;

public void StartListeningForBeacons (){

beaconRegion = new CLBeaconRegion (beaconUUID, "0");locationManager = new CLLocationManager ();locationManager.DidRangeBeacons += (object sender, CLRegionBeaconsRangedEventArgs args) => {// args.Beacons contains the array of found beacons};locationManager.StartRangingBeacons (beaconRegion);locationManager.StartUpdatingLocation ();

}

Android

• Apple does not provide iBeacon SDK for Android• Radius Networks open sourced SDK• OnIBeaconServiceConnect and RangingBeaconsInRegion

Android (Xamarin)private readonly IBeaconManager iBeaconManager;private readonly Region monitoringRegion;private readonly Region rangingRegion;private const string UUID = " 2F234454-CF6D-4A0F-ADF2-F4911BA9FFA7 ";

public MainActivity (){

iBeaconManager = IBeaconManager.GetInstanceForApplication (this);monitorNotifier = new MonitorNotifier ();rangeNotifier = new RangeNotifier ();monitoringRegion = new Region ("r2MonitoringUniqueId", UUID, null, null);rangingRegion = new Region ("r2RangingUniqueId", UUID, null, null);

}

Code Walkthrough of UNICOM conference event application

Running iBeacons in the Background• Background Detection in iOS– Made possible by iOS 7.1!– Invoke ranging for beacons from AppDelegate (not

ViewController)– Beacon ranging will persist background and even work

when device is locked/standby

Background detection in Android

• Default as Radius SDK actually runs as a service• Developer chooses how to handle OnResume, OnPause

events, and invoking application/service on updates• Should consider own service to handle background

notifications

Background Tips

• Keeping BLE enabled and ranging will have some effect on battery

• Consider adding sleep time if running in background• Don't make expensive calls (e.g. networking, computation) on

each ranging

iBeacon Ranging Accuracy

Walls or line-of-sight obstructions will decrease observed power range, and lead to inaccurate results

Possiblities• Retail with Analytics• Museums and exhibitions• Mass transit• Events• Parking• Home Automation• Theme Parks

www.unicomlearning.com

Emerging Technology Emerging Technology Summit-2014Summit-2014

Organized byOrganized byUNICOM Trainings & Seminars Pvt. Ltd. UNICOM Trainings & Seminars Pvt. Ltd.

contact@unicomlearning.comcontact@unicomlearning.com

Suresh BallaSuresh BallaSuresh.Balla@Neudesic.comSuresh.Balla@Neudesic.com

www.cloudandmobility.org

Recommended