All Projects → brminnick → XamarinIoTWorkshop

brminnick / XamarinIoTWorkshop

Licence: MIT license
A workshop that demonstrates how to collect IoT data from a mobile device using a Xamarin app, aggregating the data to the cloud using Azure IoT Hub

Programming Languages

C#
18002 projects
shell
77523 projects

Projects that are alternatives of or similar to XamarinIoTWorkshop

Xamarin.Plugin.ImageEdit
Image Edit Plugin for Xamarin
Stars: ✭ 52 (+300%)
Mutual labels:  xamarin, xamarin-forms, xamarin-ios, xamarin-android
LaunchMapsPlugin
Launch External Maps Plugin for Xamarin and Windows
Stars: ✭ 49 (+276.92%)
Mutual labels:  xamarin, xamarin-forms, xamarin-ios, xamarin-android
Xamarin Playground
Random cool stuff I play around using Xamarin.. :3 Some of these cool projects I feature them on my blog, with step by step explanation. :) Don't forget to check it out. Go to: theconfuzedsourcecode.wordpress.com
Stars: ✭ 183 (+1307.69%)
Mutual labels:  xamarin, xamarin-forms, xamarin-ios, xamarin-android
Microsoft.maui.graphics
Stars: ✭ 160 (+1130.77%)
Mutual labels:  xamarin, xamarin-forms, xamarin-ios, xamarin-android
XamSvg-Samples
Samples for Xamarin Svg enterprise cross platform and full featured Svg image control
Stars: ✭ 25 (+92.31%)
Mutual labels:  xamarin, xamarin-forms, xamarin-ios, xamarin-android
Improvexamarinbuildtimes
Tips and tricks on how to speed up the time it takes to compile a Xamarin app
Stars: ✭ 180 (+1284.62%)
Mutual labels:  xamarin, xamarin-forms, xamarin-ios, xamarin-android
Cognitive-Face-Xamarin
A client library that makes it easy to work with the Microsoft Cognitive Services Face API on Xamarin.iOS, Xamarin.Android, and Xamarin.Forms and/or Portable Class Libraries.
Stars: ✭ 18 (+38.46%)
Mutual labels:  xamarin, xamarin-forms, xamarin-ios, xamarin-android
Xamarin Docs
Xamarin Documentation - public content repo
Stars: ✭ 136 (+946.15%)
Mutual labels:  xamarin, xamarin-forms, xamarin-ios, xamarin-android
WheelPicker-Samples
WheelPicker samples for the WheelPicker Xamarin Component
Stars: ✭ 18 (+38.46%)
Mutual labels:  xamarin, xamarin-forms, xamarin-ios, xamarin-android
SKOR.UI
UI Controls for Xamarin.Forms
Stars: ✭ 56 (+330.77%)
Mutual labels:  xamarin, xamarin-forms, xamarin-ios, xamarin-android
Simpleauth
The Simplest way to Authenticate and make Rest API calls in .Net
Stars: ✭ 148 (+1038.46%)
Mutual labels:  xamarin, xamarin-forms, xamarin-ios, xamarin-android
XamarinHOL
Xamarin ハンズオン用のレポジトリ&ドキュメントです。
Stars: ✭ 52 (+300%)
Mutual labels:  xamarin, xamarin-forms, xamarin-ios, xamarin-android
Xamarin.forms.videoplayer
A Xamarin Forms control to render the native video player on every platform.
Stars: ✭ 140 (+976.92%)
Mutual labels:  xamarin, xamarin-forms, xamarin-ios, xamarin-android
UITestSampleApp
A sample app to demonstrate how to create Xamarin UITests using the Page Object architecture, Backdoor Methods and App Links (aka Deep Linking)
Stars: ✭ 38 (+192.31%)
Mutual labels:  xamarin, xamarin-forms, xamarin-ios, xamarin-android
Plugin.audiorecorder
Audio Recorder plugin for Xamarin and Windows
Stars: ✭ 140 (+976.92%)
Mutual labels:  xamarin, xamarin-forms, xamarin-ios, xamarin-android
Connectivityplugin
Connectivity Plugin for Xamarin and Windows
Stars: ✭ 253 (+1846.15%)
Mutual labels:  xamarin, xamarin-forms, xamarin-ios, xamarin-android
Xaml Code Experiences
A collection of the experiences I have collected during days of Xamarin and Wpf, while following the MVVM design pattern.
Stars: ✭ 114 (+776.92%)
Mutual labels:  xamarin, xamarin-forms, xamarin-ios, xamarin-android
Arcgis Toolkit Dotnet
Toolkit for ArcGIS Runtime SDK for .NET
Stars: ✭ 125 (+861.54%)
Mutual labels:  xamarin, xamarin-forms, xamarin-ios, xamarin-android
Xamarin Demos
This repository contains the Syncfusion Xamarin UI control’s samples and the guide to use them.
Stars: ✭ 218 (+1576.92%)
Mutual labels:  xamarin, xamarin-forms, xamarin-ios, xamarin-android
Prototype.Forms.Controls
This sample app contains a random mixture of Xamarin/Xamarin.Forms controls, views, and functionality snippets that I've created.
Stars: ✭ 21 (+61.54%)
Mutual labels:  xamarin, xamarin-forms, xamarin-ios, xamarin-android

Xamarin IoT Workshop

CI Tool Build Status
App Center, iOS Build status
App Center, Android Build status

About

This workshop will connect your mobile device to an Azure IoT Hub backend using a mobile app created in Xamarin and Azure IoT Central.

The app uses Xamarin Essentials to gather sensor data from the device's Accelerometer & Gyroscope, displays the data in the app using Syncfusion's Circular Gauge control, and then sends the sensor data to the IoT Central Portal where we can view the data.

Mobile App Sending Data to IoT Central Dashboard
Xamarin iOS App IoT Central Dashboard

Walkthrough

1. Install Xamarin App

Note: If this is workshop is being done in-person, led by Brandon Minnick, follow the App Center Installation steps.

  1. Clone/Download this git repo

Clone

  1. After downloading/cloning the repo, locate XamarinIoTWorkshop.sln
  2. Launch XamarinIoTWorkshop.sln in Visual Studio on PC or Visual Studio for Mac
  3. Build & Deploy XamarinIoTWorkshop.iOS or XamarinIoTWorkshop.Android to your local iOS or Android device

2. Create IoT Central Device

  1. On your computer, open a browser and navigate to Azure IoT Central
  2. If requested, sign in with your Microsoft account
    • You can use any Microsoft-connected account, e.g. Azure account, Live account, Hotmail account, etc.
    • If you do not have a Microsoft-connected account, now is a great time to create one!
  3. On the Azure IoT Central Portal, select New Application

IoT Central, New Application

  1. On the Create Application page, make the following selections:

    • Choose payment plan: Free
    • Select an application template: Custom Application
    • Application Name: Xamarin IoT Workshop [Last Name] -Note: Replace "[Last Name]" with your last name to create a unique Application Name
    • Url: xamarin-iot-workshop-[Last Name] -Note: Replace "[Last Name]" with your last name to create a unique Url
  2. On the Create Application page, select Create

IoT Central, Create Application

  1. On the Homepage screen, select Create Device Templates

IoT Central, Create Device Templates

  1. On the New device template page, enter "Mobile Device"
  2. On the New device template page, select Create

IoT Central, New device template

  1. On the Mobile Device 1 page, select "Delete"
    • Mobile Device 1 is a simulated device created by Azure IoT Central
    • We are deleting the simulated device and connecting a real device

IoT Central, Delete Simulated Device

  1. On the confirmation popup, select Delete

IoT Central, Confirm Delete

  1. On the Explorer page, select New -> Real

IoT Central, New Real Device

5. Add Measurements to IoT Central Device

  1. On your computer, open a browser and navigate to Azure IoT Central
  2. If requested, sign in with your Microsoft account
  3. On the Mobile Device page, select New Measurement -> Telemetry

IoT Central, New Measurement

IoT Central, Telemetry

  1. In the Create Telemetry pane, enter the following information:
    • Display Name: AccelerometerX
    • Field Name: AccelerometerX
    • Units: [Leave Blank]
    • Minimum Value: -1
    • Maximium Value: 1
    • Decimal Places: 5
  2. In the Create Telemetry pane, select Save

IoT Central, AccelerometerX

  1. On the Mobile Device page, select New Measurement -> Telemetry
  2. In the Create Telemetry pane, enter the following information:
    • Display Name: AccelerometerY
    • Field Name: AccelerometerY
    • Units: [Leave Blank]
    • Minimum Value: -1
    • Maximium Value: 1
    • Decimal Places: 5
  3. In the Create Telemetry pane, select Save

IoT Central, AccelerometerY

  1. On the Mobile Device page, select New Measurement -> Telemetry
  2. In the Create Telemetry pane, enter the following information:
    • Display Name: AccelerometerZ
    • Field Name: AccelerometerZ
    • Units: [Leave Blank]
    • Minimum Value: -10
    • Maximium Value: 10
    • Decimal Places: 5
  3. In the Create Telemetry pane, select Save

IoT Central, AccelerometerZ

  1. On the Mobile Device page, select New Measurement -> Telemetry
  2. In the Create Telemetry pane, enter the following information:
    • Display Name: GyroscopeX
    • Field Name: GyroscopeX
    • Units: [Leave Blank]
    • Minimum Value: -1
    • Maximium Value: 1
    • Decimal Places: 5
  3. In the Create Telemetry pane, select Save

IoT Central, GyroscopeX

  1. On the Mobile Device page, select New Measurement -> Telemetry
  2. In the Create Telemetry pane, enter the following information:
    • Display Name: GyroscopeY
    • Field Name: GyroscopeY
    • Units: [Leave Blank]
    • Minimum Value: -1
    • Maximium Value: 1
    • Decimal Places: 5
  3. In the Create Telemetry pane, select Save

IoT Central, GyroscopeY

  1. On the Mobile Device page, select New Measurement -> Telemetry
  2. In the Create Telemetry pane, enter the following information:
    • Display Name: GyroscopeZ
    • Field Name: GyroscopeZ
    • Units: [Leave Blank]
    • Minimum Value: -5
    • Maximium Value: 5
    • Decimal Places: 5
  3. In the Create Telemetry pane, select Save

IoT Central, GyroscopeZ

3. Get Device Connection String

  1. In IoT Central on the Mobile Device page, select Connect this device

Iot Central, Connect This Device

  1. In the Connect this device popup, select the Copy button adjacent to Primary connection string

IoT Central, Copy Primary Connection String

  1. On your computer, open a text editor, e.g. Notepad, TextEdit, Visual Studio Code, etc.
  2. In the text editor, paste the Primary connection string value

Primary Connection String

7. Install iOS App (iOS only)

We will now install the iOS app from App Center. If you have an Android Device and have already installed the Android app, skip to Step 8.

  1. On your iOS device, open Safari
  2. In Safari on your iOS device, navigate to the App Center installation page:https://install.appcenter.ms
  3. On the installation page, if prompted, sign in

App Center Installation Page

  1. On the installation page in Safari, tap on Xamarin IoT Workshop, iOS

Xamarin IoT Workshop, iOS

  1. On the Xamarin IoT Workshop, iOS page, select Install

iOS Installation Page

  1. On the confirmation popup, select Install

iOS Installation Confirmation

  1. On the iOS device, navigate to the iOS Home Screen
  2. On the iOS Home Screen, confirm that the app is installing

iOS Home Screen Installation

8. Connect App to IoT Central

  1. On your mobile device, launch the XamarinIoTWorkshop app
  2. In the XamarinIoTWorkshop app, tap the Settings tab

XamarinIoTWorkshop App, Accelerometer Page

XamarinIoTWorkshop App, Accelerometer Page

  1. On Settings page, enter the Primary Connection String into the text box
    • To avoid typos, I recommend emailing yourself the connection string, then copy/pasting the connection string into this text box
  2. On the Settings page, toggle the Send Data to Azure switch to On

XamarinIoTWorkshop App, Accelerometer Page

  1. Keep the app running in the foreground on your mobile device
    • The app will only collect data and send it to IoT Central while it is running in the foreground

3. View Data On IoT Central Dashboard

As you rotate your phone, the guages in the app will update and the data will appear on the IoT Central Dashboard in near-realtime

IoT Central Dashboard

Resources

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].