xamarin and azure iot

50

Upload: puja-pramudya

Post on 22-Jan-2018

157 views

Category:

Software


7 download

TRANSCRIPT

• Azure IoT Hub provides a fully managed service that allows secure bidirectional

communication between IoT devices and the Cloud

• Azure IoT Hub is well suited for multiple platforms and languages, but there are

times when Event Hub is a better choice for your environtment

IoT Hub Event Hub

Device to cloud and cloud to device Device to cloud communication only

Support MQTT, AMQP, AMQP over

Web Socket, HTTP/1 and Azure IoT

Protocol gateway

Support MQTT, AMQP, AMQP over

Web Socket, HTTP/1

Enables devices identity management

and connectivity events

• IoT hub SDK has been tested with multiple platforms and languages

OS

Devices

Languages

• Azure IoT Hub offered in 4 tiers and has differently limits on each Tier

• Azure IoT Hub has many different endpoints to work, with each having a different

function

• Device identity Registry allows us to access and manage our devices resources

• You can use this services to CRUD device identities

• Allows you to create per devices resource suh as queue of Cloud-to-Devices

messages

• Azure IoT Hub allows communication from an authenticated device using MQTT,

AQMP and HTTP

• Each token is transported and implemented in different ways

MQ Telemetry Transport uses a connect packet containing a device ID that is sent over

as the usernames and a SAS tken when is used in the password field

You will also have to include you IoT Hubs Cname in the username

When using HTTP to transmit an auth token, you must include a valid token in auth

request

IoT Hubs messaging allows for bidirectional communication between device and

cloud on multiple different protocols

Use MQTT when you do not need use of WebSockets

Use AMPQ when you need multiplexing across multiple devices and gateways

Use HTTP when you cannot support any other protocols

iOS WindowsAndroid

Objective-C

Xcode

C#

Visual Studio

Java

Android Studio

No shared code • Many languages & development environments • Multiple teams

App Generator

Lua

Javascript

Actionscript

HTML+CSS

Limited native API access • Slow performance • Poor user experience

Shared C# codebase • 100% native API access • High performance

iOS C# UI Windows C# UIAndroid C# UI

Shared C# Mobile

Traditional Xamarin

Approach

With Xamarin.Forms:

More code-sharing, all native

iOS C# UI Windows C# UIAndroid C# UI

Shared C# Backend

Shared UI Code

Shared C# Backend

Xamarin.iOS does full Ahead Of Time

(AOT) compilation to produce an ARM

binary for Apple’s App Store.

Xamarin.Android takes advantage of

Just In Time (JIT) compilation on the

Android device.

Xamarin is included

in Visual Studio

Xamarin.com/Download

• Create UI with drag & drop

simplicity

• Target multiple screen

sizes, resolutions and

Android versions

• Layouts saved in standard

Android XML files

• Multi-Touch Enabled

• Super Fast

• Rotate, screenshots,

location changes, and

more!

http://bit.ly/hyperv-android

• Follows familiar Visual Studio

designer idioms

• Supports all UIKit elements

• Edit custom and 3rd party

components

• Live preview of changes to

properties

• Multi-Touch Enabled

• Pressure Sensitive

• Super Fast

• Rotate, screenshots,

location changes

• Never leave VS

Xamarin.iOS Xamarin.Android

Mac

iOS

Android

Windows Phone

Calca iCircuit Touch Draw

86%

14%

72%

28%

77%

23%

70%

30%61%39%

94%

6%

88%

12%

76%

24%

90%

10%

Page is an abstract class used to define a single screen of content. Derived

types provide specific visualization/ behavior

Page that

navigates

between children

using tab bar

Content Master Detail Navigation Tabbed Carousel

Page allowing

swipe gestures to

switch between

children

View is the base class for all visual controls, most standard controls are

presents

Label Image SearchBar

Entry ProgressBar ActivityIndicator

Button Slider OpenGLView

Editor Stepper WebView

DatePicker Switch ListView

BoxView TimePicker

Frame Picker

Platform defines a renderer for each view that creates a native

representation of the UI

Button button = new Button {

Text = "Click Me!"

};

UI uses a Xamarin.Forms Button

Platform Renderer takes view and

turns it into platform-specific control

Android.Widget.Button

UIButton

System.Windows.Button

What if we didn’t have to write this code?

What if we could access it from shared code?

UI+APIs UI + APIsUI + APIs

Battery

GPS

Lights

Notifications

Settings

Text To Speech

Battery

GPS

Lights

Notifications

Settings

Text To Speech

Battery

GPS

Lights

Notifications

Settings

Text To Speech

TextToSpeech

Speak(“Hello World”);

AVSpeechSynthesizer SpeechSynthesizer

Common API