Mobile development in age of Internet of Things and programming Apple Watch

  • View
    219

  • Download
    1

  • Category

    Mobile

Preview:

Citation preview

MOBILE DEVELOPMENT IN THE AGE OF INTERNET OF THINGS

Janusz ChudzynskiFlorida Northwest IT Pro Camp

November 2014

ABOUT MeJanusz Chudzynski● Research Associate at University of West Florida● Coauthor of two eBooks related to iOS programming● Developer of mobile applications for iOS, Android and Blackberry● Taught multiple editions of iOS programming course at UWF

Outline● Introduction● Mobile Development● Internet of Things● WatchKit Demo● iBeacons

History

Why mobile development?

● it pays well● it’s a future● it’s more interesting than building regular

applications

Internet of ThingsInternet of things or IoT is a network of connected computing devices. Complexity of devices varies from simple sensors, to advanced computing devices with UI and high processing capabilities.

Scale of IoT20141.4 billions mobile device 1.5 billion computers

20208 billions connected devices20 - 700 billion IoT devices!

Source: Rethinking the Internet of Things

IoT Components

End User

Sensors Layer

Input/Output - Presentation Layer

Processing & Analytics Layer

Platforms ComparisonPlatform OS Native Programming

Language

Apple iOS Objective-CSwift

Blackberry Blackberry OS Cascades Qt/C++WebWorks HTML5Native SDK C/C++Adobe AIR ActionScriptAndroid Runtime Java

Google Android Java

Microsoft Windows Phone C#

Samsung Tizen JavaScript, CSS, HTML5

IoT Mobile Frameworks

Android iOS Windows

Android WearAndroid AutoAndroid TV

iOS 8● Handoff● Continuity● HealthKit● HomeKit

iBeaconWatchKit

Windows Developer Program for IoT.

WatchKit● Framework designed to create apps for iWatch● Introduced two days ago● Currently requires presence of an iPhone to run

third-party apps. Fully native applications will be available next year.

● Watchkit Apps can be divided into three groups○ Apps - applications with full UI○ Notifications○ Glances - supplemental way for the user to view

important information from your app

IOS TOOLS AND DEMO

iBeaconiBeacon is a name of technology that is enabling new location awareness possibilities for estimation of proximity to a beacon [1] .

Leveraging Bluetooth Low Energy (BLE), a device with iBeacon technology can be used to establish a region around an object. This allows an iOS device to determine when it has entered or left the region, along with an estimated proximity.

user-iBeacon-data

1

2 3

1. User enters the beacon’s region2. App recognizes it and starts

approximating it’s distance from/to the beacon

3. app identifies iBeacon, it’s proximity and displays data related to it

iBeacon Use CasesRetailContextualized deals:based on time, location, clientMonitoring Shopping Behaviorstoring and analyzing data about customer’s behaviorIndoor Mapping

EducationContextual learning can be used in libraries, art museums, scavenger hunts, student orientation

HealthcareIdentifying location of patient, doctor.

Home AutomationDetecting user’s location

Social/DatingDetecting users with the same preferences nearby

HospitalityAutomated check in

Proximity and rangeApple Identifies four different proximities defined as CLProximity enumeration type

enum CLProximity : Int { case Unknown case Immediate case Near case Far}Unknown - Location unknown, out of range

Immediate - immediate vicinity most likely right next to the beacon (few inches)

Near - relatively close to beacon (few meters)

Far - relatively close to beacon (more than 10 meters)

Standard beacons have an approximate range of 70 meters. Long range beacons can reach up to 450 meters.

iBeacon AdvertisementEach iBeacon device transmits advertisement with the following fields, that help to identify location of the beacon:

Field Size Description

UUID 16 bytes Most generic, can be used for iBeacons used by app

Major 2 bytes Specifies iBeacon subregion

Minor 2 bytes Further subdivision

Store Location

Pensacola Chicago

UUID D9B9EC1F-3925-43D0-80A9-1E39D4CEA95C

Major 1 2

Minor- Patients

1 - 100000 1-100000

Minor Equipment

100000-200000 100000-200000

Little Bit of Programming//Register regions and start monitoring for themCLBeaconRegion *beaconRegion = [[CLBeaconRegion alloc]initWithProximityUUID:@"B9407F30-F5F8-466E-AFF9-25556B57FE6D" major:1 minor:2 identifier:@"beacon id"]; beaconRegion.notifyOnEntry=YES; beaconRegion.notifyOnExit=YES; beaconRegion.notifyEntryStateOnDisplay=YES; [self.locationManager startMonitoringForRegion:beaconRegion];

//Delegate Methods:- (void)locationManager:(CLLocationManager *)manager didDetermineState:(CLRegionState)state forRegion:(CLRegion *)region{}//get’s called when user entered the region- (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region{ if([region isKindOfClass:[CLBeaconRegion class]]){[self.locationManager startRangingBeaconsInRegion:(CLBeaconRegion *) region];}}//gets called when the system determines proximity to the beacons -(void)locationManager:(CLLocationManager *)manager didRangeBeacons:(NSArray *)beacons inRegion:(CLBeaconRegion *)region{}//get’s called when user left the region-(void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region{}

You can download my iBeacon manager from Github:

https://github.com/appzzman/OpenSource/

Supported HardwareAny device capable of connecting with BLE is capable of interacting with the iBeaconsApple:● iPad Mini or later● iPhone 4s or later● iPod Touch 4th generation or later● iPad 3rd generation or later● Mac Book Air, Mac Book Pro, Mac Pro with BLE

Android● Google Nexus 4,5,7,10● Samsung Galaxy

iBeacon is in almost 200 Million devices around us

Where to get the iBeacon Hardware ?

● Estimote● Gimbail● Kontakt.ioand...Apple! Each device with BLE can serve as a iBeacon

Q&A

?

CONTACT

Email: jan@appzman.comLinkedIn: https://www.linkedin.com/in/chudzynskiTwitter: @appzzman

Best Places to Learn● Stanford iOS Programming Course on iTunes

U● Resources at developer.apple.com● Coursera and other MOOCs● Tutorials from Ray Wenderlich● Android Development site http://developer.

android.com/

References and resources1. https://developer.apple.com/ibeacon/Getting-Started-with-iBeacon.pdf2. http://en.wikipedia.org/wiki/Bluetooth_low_energy3. http://developer.apple.com4. http://www.cdc.gov/handhygiene/Guidelines.html5. http://www.healthit.gov/policy-researchers-implementers/safer/guide/sg0066. http://www.forbes.com/sites/anthonykosner/2013/12/15/the-internet-of-ithings-apples-

ibeacon-is-already-in-almost-200-million-iphones-and-ipads/7. http://www.slideshare.net/TheMarketingDistillery/iot-presentation8. http://postscapes.com/what-exactly-is-the-internet-of-things-infographic9. http://venturebeat.com/2014/06/11/the-6-challenges-of-building-an-ibeacon-app/

10. http://www.bizjournals.com/atlanta/blog/atlantech/2014/09/at-t-says-it-plans-to-serve-10-million-connected.html

11. http://postscapes.com/internet-of-things-resources/12. http://electronicdesign.com/embedded/understanding-protocols-behind-internet-things