├── .gitignore ├── CONTRIBUTING.md ├── Common └── AzureIoTSuiteRemoteMonitoringHelper.cs ├── LICENSE ├── README.md ├── XamFormsIoTSuiteDevice ├── XamFormsIoTSuiteDevice.sln └── XamFormsIoTSuiteDevice │ ├── XamFormsIoTSuiteDevice.Droid │ ├── Assets │ │ └── AboutAssets.txt │ ├── Helpers │ │ └── Settings.cs │ ├── MainActivity.cs │ ├── MainApplication.cs │ ├── Properties │ │ ├── AndroidManifest.xml │ │ └── AssemblyInfo.cs │ ├── Resources │ │ ├── AboutResources.txt │ │ ├── Resource.Designer.cs │ │ ├── drawable-hdpi │ │ │ └── icon.png │ │ ├── drawable-xhdpi │ │ │ └── icon.png │ │ ├── drawable-xxhdpi │ │ │ └── icon.png │ │ └── drawable │ │ │ └── icon.png │ ├── XamFormsIoTSuiteDevice.Droid.csproj │ ├── app.config │ └── packages.config │ ├── XamFormsIoTSuiteDevice.UWP │ ├── App.xaml │ ├── App.xaml.cs │ ├── Assets │ │ ├── LockScreenLogo.scale-200.png │ │ ├── SplashScreen.scale-200.png │ │ ├── Square150x150Logo.scale-200.png │ │ ├── Square44x44Logo.scale-200.png │ │ ├── Square44x44Logo.targetsize-24_altform-unplated.png │ │ ├── StoreLogo.png │ │ └── Wide310x150Logo.scale-200.png │ ├── MainPage.xaml │ ├── MainPage.xaml.cs │ ├── Package.appxmanifest │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ └── Default.rd.xml │ ├── Windows_TemporaryKey.pfx │ ├── XamFormsIoTSuiteDevice.UWP.csproj │ ├── XamFormsIoTSuiteDevice.UWP.nuget.targets │ ├── project.json │ └── project.lock.json │ ├── XamFormsIoTSuiteDevice.WinPhone │ ├── App.xaml │ ├── App.xaml.cs │ ├── Assets │ │ ├── Logo.scale-240.png │ │ ├── SmallLogo.scale-240.png │ │ ├── SplashScreen.scale-240.png │ │ ├── Square71x71Logo.scale-240.png │ │ ├── StoreLogo.scale-240.png │ │ └── WideLogo.scale-240.png │ ├── Helpers │ │ └── Settings.cs │ ├── MainPage.xaml │ ├── MainPage.xaml.cs │ ├── Package.appxmanifest │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── XamFormsIoTSuiteDevice.WinPhone.csproj │ ├── app.config │ └── packages.config │ ├── XamFormsIoTSuiteDevice.Windows │ ├── App.xaml │ ├── App.xaml.cs │ ├── Assets │ │ ├── Logo.scale-100.png │ │ ├── SmallLogo.scale-100.png │ │ ├── SplashScreen.scale-100.png │ │ └── StoreLogo.scale-100.png │ ├── Helpers │ │ └── Settings.cs │ ├── MainPage.xaml │ ├── MainPage.xaml.cs │ ├── Package.appxmanifest │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Windows_TemporaryKey.pfx │ ├── XamFormsIoTSuiteDevice.Windows.csproj │ └── packages.config │ ├── XamFormsIoTSuiteDevice.iOS │ ├── AppDelegate.cs │ ├── Entitlements.plist │ ├── Helpers │ │ └── Settings.cs │ ├── Info.plist │ ├── Main.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Resources │ │ ├── Default-568h@2x.png │ │ ├── Default-Portrait.png │ │ ├── Default-Portrait@2x.png │ │ ├── Default.png │ │ ├── Default@2x.png │ │ ├── Icon-60@2x.png │ │ ├── Icon-60@3x.png │ │ ├── Icon-76.png │ │ ├── Icon-76@2x.png │ │ ├── Icon-Small-40.png │ │ ├── Icon-Small-40@2x.png │ │ ├── Icon-Small-40@3x.png │ │ ├── Icon-Small.png │ │ ├── Icon-Small@2x.png │ │ ├── Icon-Small@3x.png │ │ └── LaunchScreen.storyboard │ ├── XamFormsIoTSuiteDevice.iOS.csproj │ ├── app.config │ ├── iTunesArtwork │ ├── iTunesArtwork@2x │ └── packages.config │ └── XamFormsIoTSuiteDevice │ ├── App.cs │ ├── GettingStarted.Xamarin │ ├── Helpers │ └── Settings.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── XamFormsIoTSuiteDevice.csproj │ ├── app.config │ └── packages.config └── XamNativeIoTSuiteDevice ├── XamNativeIoTSuiteDevice.sln └── XamNativeIoTSuiteDevice ├── XamNativeIoTSuiteDevice.Droid ├── Assets │ └── AboutAssets.txt ├── Helpers │ └── Settings.cs ├── MainActivity.cs ├── Properties │ ├── AndroidManifest.xml │ └── AssemblyInfo.cs ├── Resources │ ├── AboutResources.txt │ ├── Resource.designer.cs │ ├── drawable-hdpi │ │ └── Icon.png │ ├── drawable-mdpi │ │ └── Icon.png │ ├── drawable-xhdpi │ │ └── Icon.png │ ├── drawable-xxhdpi │ │ └── Icon.png │ ├── drawable-xxxhdpi │ │ └── Icon.png │ ├── layout │ │ └── Main.axml │ └── values │ │ └── Strings.xml ├── XamNativeIoTSuiteDevice.Droid.csproj ├── app.config └── packages.config ├── XamNativeIoTSuiteDevice.WinPhone ├── App.xaml ├── App.xaml.cs ├── Assets │ ├── Logo.scale-240.png │ ├── SmallLogo.scale-240.png │ ├── SplashScreen.scale-240.png │ ├── Square71x71Logo.scale-240.png │ ├── StoreLogo.scale-240.png │ └── WideLogo.scale-240.png ├── Helpers │ └── Settings.cs ├── MainPage.xaml ├── MainPage.xaml.cs ├── Package.appxmanifest ├── Properties │ └── AssemblyInfo.cs ├── XamNativeIoTSuiteDevice.WinPhone.csproj ├── app.config └── packages.config ├── XamNativeIoTSuiteDevice.iOS ├── AppDelegate.cs ├── Entitlements.plist ├── Helpers │ └── Settings.cs ├── Info.plist ├── Main.cs ├── Main.storyboard ├── Resources │ ├── ITunesArtwork │ ├── ITunesArtwork@2x │ ├── Images.xcassets │ │ ├── AppIcons.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-60@2x.png │ │ │ ├── Icon-60@3x.png │ │ │ ├── Icon-76.png │ │ │ ├── Icon-76@2x.png │ │ │ ├── Icon-Small-40.png │ │ │ ├── Icon-Small-40@2x.png │ │ │ ├── Icon-Small-40@3x.png │ │ │ ├── Icon-Small.png │ │ │ ├── Icon-Small@2x.png │ │ │ └── Icon-Small@3x.png │ │ └── LaunchImage.launchimage │ │ │ ├── Contents.json │ │ │ ├── Default-568h@2x.png │ │ │ ├── Default-Portrait.png │ │ │ ├── Default-Portrait@2x.png │ │ │ ├── Default.png │ │ │ └── Default@2x.png │ └── LaunchScreen.storyboard ├── ViewController.cs ├── ViewController.designer.cs ├── XamNativeIoTSuiteDevice.iOS.csproj ├── app.config └── packages.config └── XamNativeIoTSuiteDevice ├── Helpers └── Settings.cs ├── MyClass.cs ├── Properties └── AssemblyInfo.cs ├── XamNativeIoTSuiteDevice.csproj ├── app.config └── packages.config /.gitignore: -------------------------------------------------------------------------------- 1 | # User-specific files 2 | *.suo 3 | *.user 4 | 5 | # NuGet Packages Directory 6 | packages/ 7 | 8 | # Build results 9 | 10 | [Dd]ebug/ 11 | [Rr]elease/ 12 | [Bb]in/ 13 | [Oo]bj/ 14 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Azure samples 2 | 3 | Thank you for your interest in contributing to Azure samples! 4 | 5 | ## Ways to contribute 6 | 7 | You can contribute to [Azure samples](https://azure.microsoft.com/documentation/samples/) in a few different ways: 8 | 9 | - Submit feedback on [this sample page](https://azure.microsoft.com/documentation/samples/iot-hub-xamarin-remote-monitoring-device/) whether it was helpful or not. 10 | - Submit issues through [issue tracker](https://github.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/issues) on GitHub. We are actively monitoring the issues and improving our samples. 11 | - If you wish to make code changes to samples, or contribute something new, please follow the [GitHub Forks / Pull requests model](https://help.github.com/articles/fork-a-repo/): Fork the sample repo, make the change and propose it back by submitting a pull request. -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Microsoft Corporation 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | --- 2 | services: iot-hub, iot-suite 3 | platforms: csharp, xamarin 4 | author: olivierbloch 5 | --- 6 | 7 | # Connect iOS, Android and Windows devices to Azure IoT Suite Remote Monitoring using Xamarin 8 | This sample shows how to run and connect a Xamarin mobile application to an Azure IoT Suite Remote Monitoring Preconfigured Solution. 9 | This sample is useful to demonstrate the Azure IoT Suite using a mobile device (Android, iOS, Windows). 10 | Here are some links to learn more on [Azure IoT Suite](https://azure.microsoft.com/en-us/documentation/suites/iot-suite/) and [Azure IoT Suite preconfigured solutions](https://azure.microsoft.com/en-us/documentation/articles/iot-suite-what-are-preconfigured-solutions/). 11 | 12 | ## Running this sample 13 | The repository contains 2 samples, one for Xamarin native and one for Xamarin Forms. There is one solution for each. 14 | The Xamarin native solution targets Android, iOS and Windows Phone 8.1. 15 | The Xamarin Forms solution targets Android, iOS, UWP (Windows 10 and Windows 10 Mobile), Windows Phone 8.1 and Windows 8.1 16 | 17 | ### Prerequisites 18 | 19 | You can build and run the samples on a Windows machine or on a Mac. 20 | 21 | #### Developing on Windows 22 | On Windows you will be able to build and run the samples on the following platforms: 23 | 24 | - Android (Xamarin native and Xamarin Forms samples) 25 | - iOS (Xamarin native and Xamarin Forms samples) (note that you will need a Mac with the dev tools installed next to your Windows dev machine to compile and run the sample for iOS) 26 | - Windows 10 (Xamarin Forms) 27 | - Windows 10 mobile (Xamarin Forms) 28 | - Windows 8.1 (Xamarin Forms sample) 29 | - Windows Phone 8.1 (Xamarin native and Xamarin Forms samples) 30 | 31 | Requirements: 32 | 33 | - A PC running Windows 10 (this would be your development machine). 34 | - [Visual Studio 2015 Update 2](https://www.visualstudio.com/) making sur you checked the **Cross Platform Mobile Development | C#/.Net (Xamarin)** option during install 35 | - [optional] [Windows 10 SDK](https://dev.windows.com/en-US/downloads/windows-10-sdk) if you want to build and run the UWP project. 36 | - [optional] A Mac machine with the development tools installed for Xamarin (see below for the tools requirements). 37 | - [optional] A mobile device running one of the following: iOS, Android, Windows 10, Windows 10 mobile, Windows 8.1, Windows Phone 8.1 if you want to deploy the application on a real device. Otherwise you can use emulators and simulators that come along with Xamarin and related tools. 38 | - [optional] [Xamarin Android Player](https://www.xamarin.com/android-player). This one is a great Android emulator for development. 39 | 40 | To target Windows 10, you will need to setup your OS to developer mode: 41 | 42 | - On Windows 10 PC: 43 | 1. Click on the Windows Icon, 44 | 1. Type `For Developers Settings` and press enter. 45 | 1. In the **Developers Settings** section, select the option **Developer Mode** 46 | - On Windows 10 Mobile (if you plan to deploy to a phone running Windows 10 mobile) 47 | 1. Touch the search button 48 | 1. Type `Settings` and touch the **Settings** icon to enter the settings panel 49 | 1. Scroll down to **Update & Security**, then Developers and select the **Developer mode** option 50 | 51 | #### Developing on a Mac 52 | On Mac you will be able to build and run the samples on the following platforms: 53 | 54 | - Android (Xamarin native and Xamarin Forms samples) 55 | - iOS ( (Xamarin native and Xamarin Forms samples) 56 | 57 | Requirements: 58 | 59 | - A Mac running OSx 10.10.5+ or 10.11 60 | - XCode 7.1 61 | - [Xamarin Studio](https://www.xamarin.com/download) 62 | - [optional] [Xamarin Android Player](https://www.xamarin.com/android-player). This one is a great Android emulator for development. 63 | 64 | To build and deploy to iOS device you will need to have an Apple Developer account. 65 | 66 | 67 | ## Deploy an Azure IoT Suite Remote Monitoring preconfigured solution 68 | 69 | In order to deploy an Azure IoT Suite preconfigured solution, you need an Azure subscription. If you don't have one, you can easily create a [free trial subscription](https://azure.microsoft.com/en-us/free/). 70 | This [article](https://azure.microsoft.com/en-us/documentation/articles/iot-suite-getstarted-preconfigured-solutions/) describes in details how to get started with Azure IoT Suite Remote Monitoring preconfigured solutions, but if you want the short version, see below. 71 | Once you have an Azure subscription, browse to [http://www.azureiotsuite.com](http://www.azureiotsuite.com) 72 | Once logged in using your Azure subscription credentials: 73 | 74 | 1. Click on **Create a new solution**. 75 | 1. Select **Remote Monitoring** 76 | 1. Enter a solution name 77 | 1. Select a region for your solution to be hosted in 78 | 1. Select your subscription (if you have several subscriptions for the account you're logged in with) 79 | 1. Click on **Create solution** at the bottom 80 | 81 | It will take several minutes to deploy all the services of the solution, in the meantime, you can get the device application ready. 82 | 83 | ## Run the device application on Windows 10 PC and mobile 84 | 85 | In order to run the device application on your PC, here are the few steps: 86 | 87 | 1. Clone or download the github repository (see links on top) 88 | 1. For the Xamarin Native sample, open the solution XamNativeIoTSuiteDevice\XamNativeIoTSuiteDevice.sln in Visual Studio (for Windows) or Xamarin Studio (for Mac), build, run. 89 | 1. For the Xamarin Forms sample, open the solution XamFormsIoTSuiteDevice\XamFormsIoTSuiteDevice.sln in Visual Studio (for Windows) or Xamarin Studio (for Mac), build, run. 90 | 91 | ## Create a device ID for your mobile device application in Azure IoT Suite Remote Monitoring preconfigured solution 92 | 93 | At this point the Remote Monitoring solution should be deployed (if not, go get a coffee). 94 | 95 | ![](https://raw.githubusercontent.com/Azure-Samples/iot-hub-dotnet-uwp-remote-monitoring/master/Media/IoTSuiteSolution.PNG) 96 | 97 | ``` 98 | Important: we are not using the simulated devices that are automatically deployed as 99 | part of the remote monitoring solution. 100 | 101 | It is recommended to deactivate all the simulated devices from the Devices tab in 102 | the dashboard to prevent unecessary traffic and cost to the Azure subscription. 103 | ``` 104 | 105 | In order to connect your mobile application to your Azure IoT Suite instance (which by now should be deployed), you will need to create a unique ID for it in the Suite dashboard. 106 | Navigating the Remote Monitoring dahboard and creating a device ID is extensively described in the [Getting Started with Azure IoT Suite preconfigured solutions article](https://azure.microsoft.com/en-us/documentation/articles/iot-suite-getstarted-preconfigured-solutions/). 107 | Once you have created a new device ID, copy the Device ID, Host Name and Device Key from the IoT Suite into the mobile application. 108 | 109 | ## Use the application 110 | 111 | The device application is dead simple. 112 | 113 | 1. Connecting to IoT Suite: 114 | - Enter the credentials generated in previous steps in the corresponding fields of the app. 115 | - Press the "Press to Connect To IoT Suite" button. 116 | - At this point you should see the device metadata appear in the IoT Suite dashboard under the **devices** tab. 117 | 1. Sending telemetry data 118 | - Press the **Press to send data to IoT Suite** button. 119 | - Data will start showing up in the IoT Suite dashboard. You can play with the sliders to change the values 120 | 1. Receiving messages from IoT Suite on the device 121 | - In the IoT Suite dashboard, go to the **Devices** tab 122 | - Select your device 123 | - In the right menu, press on **Commands** 124 | - In the Commands combo, select the command you want to send to the device, type your text and press **send** 125 | - The device should display the message. 126 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Droid/Assets/AboutAssets.txt: -------------------------------------------------------------------------------- 1 | Any raw assets you want to be deployed with your application can be placed in 2 | this directory (and child directories) and given a Build Action of "AndroidAsset". 3 | 4 | These files will be deployed with you package and will be accessible using Android's 5 | AssetManager, like this: 6 | 7 | public class ReadAsset : Activity 8 | { 9 | protected override void OnCreate (Bundle bundle) 10 | { 11 | base.OnCreate (bundle); 12 | 13 | InputStream input = Assets.Open ("my_asset.txt"); 14 | } 15 | } 16 | 17 | Additionally, some Android functions will automatically load asset files: 18 | 19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf"); 20 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Droid/Helpers/Settings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | // Helpers/Settings.cs This file was automatically added when you installed the Settings Plugin. If you are not using a PCL then comment this file back in to use it. 3 | using Plugin.Settings; 4 | using Plugin.Settings.Abstractions; 5 | 6 | namespace XamFormsIoTSuiteDevice.Droid.Helpers 7 | { 8 | /// 9 | /// This is the Settings static class that can be used in your Core solution or in any 10 | /// of your client applications. All settings are laid out the same exact way with getters 11 | /// and setters. 12 | /// 13 | public static class Settings 14 | { 15 | private static ISettings AppSettings 16 | { 17 | get 18 | { 19 | return CrossSettings.Current; 20 | } 21 | } 22 | 23 | #region Setting Constants 24 | 25 | private const string SettingsKey = "settings_key"; 26 | private static readonly string SettingsDefault = string.Empty; 27 | 28 | #endregion 29 | 30 | 31 | public static string GeneralSettings 32 | { 33 | get 34 | { 35 | return AppSettings.GetValueOrDefault(SettingsKey, SettingsDefault); 36 | } 37 | set 38 | { 39 | AppSettings.AddOrUpdateValue(SettingsKey, value); 40 | } 41 | } 42 | 43 | } 44 | }*/ -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Droid/MainActivity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using Android.App; 4 | using Android.Content.PM; 5 | using Android.Runtime; 6 | using Android.Views; 7 | using Android.Widget; 8 | using Android.OS; 9 | 10 | namespace XamFormsIoTSuiteDevice.Droid 11 | { 12 | [Activity(Label = "XamFormsIoTSuiteDevice", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] 13 | public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity 14 | { 15 | protected override void OnCreate(Bundle bundle) 16 | { 17 | base.OnCreate(bundle); 18 | 19 | global::Xamarin.Forms.Forms.Init(this, bundle); 20 | LoadApplication(new App()); 21 | } 22 | } 23 | } 24 | 25 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Droid/MainApplication.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using Android.App; 4 | using Android.OS; 5 | using Android.Runtime; 6 | using Plugin.CurrentActivity; 7 | 8 | namespace XamFormsIoTSuiteDevice.Droid 9 | { 10 | //You can specify additional application information in this attribute 11 | [Application] 12 | public class MainApplication : Application, Application.IActivityLifecycleCallbacks 13 | { 14 | public MainApplication(IntPtr handle, JniHandleOwnership transer) 15 | :base(handle, transer) 16 | { 17 | } 18 | 19 | public override void OnCreate() 20 | { 21 | base.OnCreate(); 22 | RegisterActivityLifecycleCallbacks(this); 23 | //A great place to initialize Xamarin.Insights and Dependency Services! 24 | } 25 | 26 | public override void OnTerminate() 27 | { 28 | base.OnTerminate(); 29 | UnregisterActivityLifecycleCallbacks(this); 30 | } 31 | 32 | public void OnActivityCreated(Activity activity, Bundle savedInstanceState) 33 | { 34 | CrossCurrentActivity.Current.Activity = activity; 35 | } 36 | 37 | public void OnActivityDestroyed(Activity activity) 38 | { 39 | } 40 | 41 | public void OnActivityPaused(Activity activity) 42 | { 43 | } 44 | 45 | public void OnActivityResumed(Activity activity) 46 | { 47 | CrossCurrentActivity.Current.Activity = activity; 48 | } 49 | 50 | public void OnActivitySaveInstanceState(Activity activity, Bundle outState) 51 | { 52 | } 53 | 54 | public void OnActivityStarted(Activity activity) 55 | { 56 | CrossCurrentActivity.Current.Activity = activity; 57 | } 58 | 59 | public void OnActivityStopped(Activity activity) 60 | { 61 | } 62 | } 63 | } -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Droid/Properties/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Droid/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | using Android.App; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("XamFormsIoTSuiteDevice.Droid")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("XamFormsIoTSuiteDevice.Droid")] 14 | [assembly: AssemblyCopyright("Copyright © 2014")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | [assembly: ComVisible(false)] 18 | 19 | // Version information for an assembly consists of the following four values: 20 | // 21 | // Major Version 22 | // Minor Version 23 | // Build Number 24 | // Revision 25 | // 26 | // You can specify all the values or you can default the Build and Revision Numbers 27 | // by using the '*' as shown below: 28 | // [assembly: AssemblyVersion("1.0.*")] 29 | [assembly: AssemblyVersion("1.0.0.0")] 30 | [assembly: AssemblyFileVersion("1.0.0.0")] 31 | 32 | // Add some common permissions, these can be removed if not needed 33 | [assembly: UsesPermission(Android.Manifest.Permission.Internet)] 34 | [assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)] 35 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Droid/Resources/AboutResources.txt: -------------------------------------------------------------------------------- 1 | Images, layout descriptions, binary blobs and string dictionaries can be included 2 | in your application as resource files. Various Android APIs are designed to 3 | operate on the resource IDs instead of dealing with images, strings or binary blobs 4 | directly. 5 | 6 | For example, a sample Android app that contains a user interface layout (main.xml), 7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png) 8 | would keep its resources in the "Resources" directory of the application: 9 | 10 | Resources/ 11 | drawable-hdpi/ 12 | icon.png 13 | 14 | drawable-ldpi/ 15 | icon.png 16 | 17 | drawable-mdpi/ 18 | icon.png 19 | 20 | layout/ 21 | main.xml 22 | 23 | values/ 24 | strings.xml 25 | 26 | In order to get the build system to recognize Android resources, set the build action to 27 | "AndroidResource". The native Android APIs do not operate directly with filenames, but 28 | instead operate on resource IDs. When you compile an Android application that uses resources, 29 | the build system will package the resources for distribution and generate a class called 30 | "Resource" that contains the tokens for each one of the resources included. For example, 31 | for the above Resources layout, this is what the Resource class would expose: 32 | 33 | public class Resource { 34 | public class drawable { 35 | public const int icon = 0x123; 36 | } 37 | 38 | public class layout { 39 | public const int main = 0x456; 40 | } 41 | 42 | public class strings { 43 | public const int first_string = 0xabc; 44 | public const int second_string = 0xbcd; 45 | } 46 | } 47 | 48 | You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main 49 | to reference the layout/main.xml file, or Resource.strings.first_string to reference the first 50 | string in the dictionary file values/strings.xml. 51 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Droid/Resources/Resource.Designer.cs: -------------------------------------------------------------------------------- 1 | #pragma warning disable 1591 2 | //------------------------------------------------------------------------------ 3 | // 4 | // This code was generated by a tool. 5 | // Runtime Version:4.0.30319.42000 6 | // 7 | // Changes to this file may cause incorrect behavior and will be lost if 8 | // the code is regenerated. 9 | // 10 | //------------------------------------------------------------------------------ 11 | 12 | [assembly: global::Android.Runtime.ResourceDesignerAttribute("XamFormsIoTSuiteDevice.Droid.Resource", IsApplication=true)] 13 | 14 | namespace XamFormsIoTSuiteDevice.Droid 15 | { 16 | 17 | 18 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")] 19 | public partial class Resource 20 | { 21 | 22 | static Resource() 23 | { 24 | global::Android.Runtime.ResourceIdManager.UpdateIdValues(); 25 | } 26 | 27 | public static void UpdateIdValues() 28 | { 29 | global::PCLCrypto.Resource.String.ApplicationName = global::XamFormsIoTSuiteDevice.Droid.Resource.String.ApplicationName; 30 | global::PCLCrypto.Resource.String.Hello = global::XamFormsIoTSuiteDevice.Droid.Resource.String.Hello; 31 | global::Xamarin.Forms.Platform.Android.Resource.Attribute.actionBarSize = global::XamFormsIoTSuiteDevice.Droid.Resource.Attribute.actionBarSize; 32 | } 33 | 34 | public partial class Attribute 35 | { 36 | 37 | static Attribute() 38 | { 39 | global::Android.Runtime.ResourceIdManager.UpdateIdValues(); 40 | } 41 | 42 | private Attribute() 43 | { 44 | } 45 | } 46 | 47 | public partial class Drawable 48 | { 49 | 50 | // aapt resource value: 0x7f020000 51 | public const int icon = 2130837504; 52 | 53 | static Drawable() 54 | { 55 | global::Android.Runtime.ResourceIdManager.UpdateIdValues(); 56 | } 57 | 58 | private Drawable() 59 | { 60 | } 61 | } 62 | 63 | public partial class String 64 | { 65 | 66 | // aapt resource value: 0x7f030001 67 | public const int ApplicationName = 2130903041; 68 | 69 | // aapt resource value: 0x7f030000 70 | public const int Hello = 2130903040; 71 | 72 | static String() 73 | { 74 | global::Android.Runtime.ResourceIdManager.UpdateIdValues(); 75 | } 76 | 77 | private String() 78 | { 79 | } 80 | } 81 | } 82 | } 83 | #pragma warning restore 1591 84 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Droid/Resources/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Droid/Resources/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Droid/Resources/drawable-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Droid/Resources/drawable-xhdpi/icon.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Droid/Resources/drawable-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Droid/Resources/drawable-xxhdpi/icon.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Droid/Resources/drawable/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Droid/Resources/drawable/icon.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Droid/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Droid/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.UWP/App.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.UWP/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.ApplicationModel; 7 | using Windows.ApplicationModel.Activation; 8 | using Windows.Foundation; 9 | using Windows.Foundation.Collections; 10 | using Windows.UI.Xaml; 11 | using Windows.UI.Xaml.Controls; 12 | using Windows.UI.Xaml.Controls.Primitives; 13 | using Windows.UI.Xaml.Data; 14 | using Windows.UI.Xaml.Input; 15 | using Windows.UI.Xaml.Media; 16 | using Windows.UI.Xaml.Navigation; 17 | 18 | namespace XamFormsIoTSuiteDevice.UWP 19 | { 20 | /// 21 | /// Provides application-specific behavior to supplement the default Application class. 22 | /// 23 | sealed partial class App : Application 24 | { 25 | /// 26 | /// Initializes the singleton application object. This is the first line of authored code 27 | /// executed, and as such is the logical equivalent of main() or WinMain(). 28 | /// 29 | public App() 30 | { 31 | this.InitializeComponent(); 32 | this.Suspending += OnSuspending; 33 | } 34 | 35 | /// 36 | /// Invoked when the application is launched normally by the end user. Other entry points 37 | /// will be used such as when the application is launched to open a specific file. 38 | /// 39 | /// Details about the launch request and process. 40 | protected override void OnLaunched(LaunchActivatedEventArgs e) 41 | { 42 | 43 | #if DEBUG 44 | if (System.Diagnostics.Debugger.IsAttached) 45 | { 46 | this.DebugSettings.EnableFrameRateCounter = true; 47 | } 48 | #endif 49 | 50 | Frame rootFrame = Window.Current.Content as Frame; 51 | 52 | // Do not repeat app initialization when the Window already has content, 53 | // just ensure that the window is active 54 | if (rootFrame == null) 55 | { 56 | // Create a Frame to act as the navigation context and navigate to the first page 57 | rootFrame = new Frame(); 58 | 59 | rootFrame.NavigationFailed += OnNavigationFailed; 60 | 61 | Xamarin.Forms.Forms.Init(e); 62 | 63 | if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) 64 | { 65 | //TODO: Load state from previously suspended application 66 | } 67 | 68 | // Place the frame in the current Window 69 | Window.Current.Content = rootFrame; 70 | } 71 | 72 | if (rootFrame.Content == null) 73 | { 74 | // When the navigation stack isn't restored navigate to the first page, 75 | // configuring the new page by passing required information as a navigation 76 | // parameter 77 | rootFrame.Navigate(typeof(MainPage), e.Arguments); 78 | } 79 | // Ensure the current window is active 80 | Window.Current.Activate(); 81 | } 82 | 83 | /// 84 | /// Invoked when Navigation to a certain page fails 85 | /// 86 | /// The Frame which failed navigation 87 | /// Details about the navigation failure 88 | void OnNavigationFailed(object sender, NavigationFailedEventArgs e) 89 | { 90 | throw new Exception("Failed to load Page " + e.SourcePageType.FullName); 91 | } 92 | 93 | /// 94 | /// Invoked when application execution is being suspended. Application state is saved 95 | /// without knowing whether the application will be terminated or resumed with the contents 96 | /// of memory still intact. 97 | /// 98 | /// The source of the suspend request. 99 | /// Details about the suspend request. 100 | private void OnSuspending(object sender, SuspendingEventArgs e) 101 | { 102 | var deferral = e.SuspendingOperation.GetDeferral(); 103 | //TODO: Save application state and stop any background activity 104 | deferral.Complete(); 105 | } 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.UWP/Assets/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.UWP/Assets/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.UWP/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.UWP/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.UWP/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.UWP/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.UWP/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.UWP/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.UWP/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.UWP/Assets/StoreLogo.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.UWP/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.UWP/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.UWP/MainPage.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.UWP/MainPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.Foundation; 7 | using Windows.Foundation.Collections; 8 | using Windows.UI.Xaml; 9 | using Windows.UI.Xaml.Controls; 10 | using Windows.UI.Xaml.Controls.Primitives; 11 | using Windows.UI.Xaml.Data; 12 | using Windows.UI.Xaml.Input; 13 | using Windows.UI.Xaml.Media; 14 | using Windows.UI.Xaml.Navigation; 15 | 16 | namespace XamFormsIoTSuiteDevice.UWP 17 | { 18 | public sealed partial class MainPage 19 | { 20 | public MainPage() 21 | { 22 | this.InitializeComponent(); 23 | 24 | LoadApplication(new XamFormsIoTSuiteDevice.App()); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.UWP/Package.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | FPCL.WIndows 7 | joaqu 8 | Assets\StoreLogo.png 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.UWP/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("XamFormsIoTSuiteDevice.UWP")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("XamFormsIoTSuiteDevice.UWP")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.UWP/Properties/Default.rd.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.UWP/Windows_TemporaryKey.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.UWP/Windows_TemporaryKey.pfx -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.UWP/XamFormsIoTSuiteDevice.UWP.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | x86 7 | {B99F1C18-01A5-427A-9E87-2D1A63E6C444} 8 | AppContainerExe 9 | Properties 10 | XamFormsIoTSuiteDevice.UWP 11 | XamFormsIoTSuiteDevice.UWP 12 | en-US 13 | UAP 14 | 10.0.10240.0 15 | 10.0.10240.0 16 | 14 17 | true 18 | 512 19 | {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 20 | Windows_TemporaryKey.pfx 21 | 22 | 23 | true 24 | bin\ARM\Debug\ 25 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 26 | ;2008 27 | full 28 | ARM 29 | false 30 | prompt 31 | true 32 | 33 | 34 | bin\ARM\Release\ 35 | TRACE;NETFX_CORE;WINDOWS_UWP 36 | true 37 | ;2008 38 | pdbonly 39 | ARM 40 | false 41 | prompt 42 | true 43 | true 44 | 45 | 46 | true 47 | bin\x64\Debug\ 48 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 49 | ;2008 50 | full 51 | x64 52 | false 53 | prompt 54 | true 55 | 56 | 57 | bin\x64\Release\ 58 | TRACE;NETFX_CORE;WINDOWS_UWP 59 | true 60 | ;2008 61 | pdbonly 62 | x64 63 | false 64 | prompt 65 | true 66 | true 67 | 68 | 69 | true 70 | bin\x86\Debug\ 71 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 72 | ;2008 73 | full 74 | x86 75 | false 76 | prompt 77 | true 78 | 79 | 80 | bin\x86\Release\ 81 | TRACE;NETFX_CORE;WINDOWS_UWP 82 | true 83 | ;2008 84 | pdbonly 85 | x86 86 | false 87 | prompt 88 | true 89 | true 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | App.xaml 98 | 99 | 100 | MainPage.xaml 101 | 102 | 103 | 104 | 105 | 106 | Designer 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | MSBuild:Compile 123 | Designer 124 | 125 | 126 | MSBuild:Compile 127 | Designer 128 | 129 | 130 | 131 | 132 | XamFormsIoTSuiteDevice 133 | 134 | 135 | 136 | 14.0 137 | 138 | 139 | 146 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.UWP/XamFormsIoTSuiteDevice.UWP.nuget.targets: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(UserProfile)\.nuget\packages\ 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.UWP/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "Microsoft.Azure.Devices.Client.PCL": "1.0.8", 4 | "Microsoft.NETCore.UniversalWindowsPlatform": "5.1.0", 5 | "Newtonsoft.Json": "8.0.3", 6 | "Xam.Plugin.DeviceInfo": "2.0.2", 7 | "Xam.Plugin.Geolocator": "4.0.0-beta4", 8 | "Xam.Plugins.Settings": "2.1.0", 9 | "Xamarin.Forms": "2.2.0.31" 10 | }, 11 | "frameworks": { 12 | "uap10.0": {} 13 | }, 14 | "runtimes": { 15 | "win10-arm": {}, 16 | "win10-arm-aot": {}, 17 | "win10-x86": {}, 18 | "win10-x86-aot": {}, 19 | "win10-x64": {}, 20 | "win10-x64-aot": {} 21 | } 22 | } -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.WinPhone/App.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.WinPhone/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.ApplicationModel; 7 | using Windows.ApplicationModel.Activation; 8 | using Windows.Foundation; 9 | using Windows.Foundation.Collections; 10 | using Windows.UI.Xaml; 11 | using Windows.UI.Xaml.Controls; 12 | using Windows.UI.Xaml.Controls.Primitives; 13 | using Windows.UI.Xaml.Data; 14 | using Windows.UI.Xaml.Input; 15 | using Windows.UI.Xaml.Media; 16 | using Windows.UI.Xaml.Media.Animation; 17 | using Windows.UI.Xaml.Navigation; 18 | 19 | // The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227 20 | 21 | namespace XamFormsIoTSuiteDevice.WinPhone 22 | { 23 | /// 24 | /// Provides application-specific behavior to supplement the default Application class. 25 | /// 26 | public sealed partial class App : Application 27 | { 28 | private TransitionCollection transitions; 29 | 30 | /// 31 | /// Initializes the singleton application object. This is the first line of authored code 32 | /// executed, and as such is the logical equivalent of main() or WinMain(). 33 | /// 34 | public App() 35 | { 36 | this.InitializeComponent(); 37 | this.Suspending += this.OnSuspending; 38 | } 39 | 40 | /// 41 | /// Invoked when the application is launched normally by the end user. Other entry points 42 | /// will be used when the application is launched to open a specific file, to display 43 | /// search results, and so forth. 44 | /// 45 | /// Details about the launch request and process. 46 | protected override void OnLaunched(LaunchActivatedEventArgs e) 47 | { 48 | #if DEBUG 49 | if (System.Diagnostics.Debugger.IsAttached) 50 | { 51 | this.DebugSettings.EnableFrameRateCounter = true; 52 | } 53 | #endif 54 | 55 | Frame rootFrame = Window.Current.Content as Frame; 56 | 57 | // Do not repeat app initialization when the Window already has content, 58 | // just ensure that the window is active 59 | if (rootFrame == null) 60 | { 61 | // Create a Frame to act as the navigation context and navigate to the first page 62 | rootFrame = new Frame(); 63 | 64 | // TODO: change this value to a cache size that is appropriate for your application 65 | rootFrame.CacheSize = 1; 66 | 67 | Xamarin.Forms.Forms.Init(e); 68 | 69 | if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) 70 | { 71 | // TODO: Load state from previously suspended application 72 | } 73 | 74 | // Place the frame in the current Window 75 | Window.Current.Content = rootFrame; 76 | } 77 | 78 | if (rootFrame.Content == null) 79 | { 80 | // Removes the turnstile navigation for startup. 81 | if (rootFrame.ContentTransitions != null) 82 | { 83 | this.transitions = new TransitionCollection(); 84 | foreach (var c in rootFrame.ContentTransitions) 85 | { 86 | this.transitions.Add(c); 87 | } 88 | } 89 | 90 | rootFrame.ContentTransitions = null; 91 | rootFrame.Navigated += this.RootFrame_FirstNavigated; 92 | 93 | // When the navigation stack isn't restored navigate to the first page, 94 | // configuring the new page by passing required information as a navigation 95 | // parameter 96 | if (!rootFrame.Navigate(typeof(MainPage), e.Arguments)) 97 | { 98 | throw new Exception("Failed to create initial page"); 99 | } 100 | } 101 | 102 | // Ensure the current window is active 103 | Window.Current.Activate(); 104 | } 105 | 106 | /// 107 | /// Restores the content transitions after the app has launched. 108 | /// 109 | /// The object where the handler is attached. 110 | /// Details about the navigation event. 111 | private void RootFrame_FirstNavigated(object sender, NavigationEventArgs e) 112 | { 113 | var rootFrame = sender as Frame; 114 | rootFrame.ContentTransitions = this.transitions ?? new TransitionCollection() { new NavigationThemeTransition() }; 115 | rootFrame.Navigated -= this.RootFrame_FirstNavigated; 116 | } 117 | 118 | /// 119 | /// Invoked when application execution is being suspended. Application state is saved 120 | /// without knowing whether the application will be terminated or resumed with the contents 121 | /// of memory still intact. 122 | /// 123 | /// The source of the suspend request. 124 | /// Details about the suspend request. 125 | private void OnSuspending(object sender, SuspendingEventArgs e) 126 | { 127 | var deferral = e.SuspendingOperation.GetDeferral(); 128 | 129 | // TODO: Save application state and stop any background activity 130 | deferral.Complete(); 131 | } 132 | } 133 | } -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.WinPhone/Assets/Logo.scale-240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.WinPhone/Assets/Logo.scale-240.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.WinPhone/Assets/SmallLogo.scale-240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.WinPhone/Assets/SmallLogo.scale-240.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.WinPhone/Assets/SplashScreen.scale-240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.WinPhone/Assets/SplashScreen.scale-240.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.WinPhone/Assets/Square71x71Logo.scale-240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.WinPhone/Assets/Square71x71Logo.scale-240.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.WinPhone/Assets/StoreLogo.scale-240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.WinPhone/Assets/StoreLogo.scale-240.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.WinPhone/Assets/WideLogo.scale-240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.WinPhone/Assets/WideLogo.scale-240.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.WinPhone/Helpers/Settings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | // Helpers/Settings.cs This file was automatically added when you installed the Settings Plugin. If you are not using a PCL then comment this file back in to use it. 3 | using Plugin.Settings; 4 | using Plugin.Settings.Abstractions; 5 | 6 | namespace XamFormsIoTSuiteDevice.WinPhone.Helpers 7 | { 8 | /// 9 | /// This is the Settings static class that can be used in your Core solution or in any 10 | /// of your client applications. All settings are laid out the same exact way with getters 11 | /// and setters. 12 | /// 13 | public static class Settings 14 | { 15 | private static ISettings AppSettings 16 | { 17 | get 18 | { 19 | return CrossSettings.Current; 20 | } 21 | } 22 | 23 | #region Setting Constants 24 | 25 | private const string SettingsKey = "settings_key"; 26 | private static readonly string SettingsDefault = string.Empty; 27 | 28 | #endregion 29 | 30 | 31 | public static string GeneralSettings 32 | { 33 | get 34 | { 35 | return AppSettings.GetValueOrDefault(SettingsKey, SettingsDefault); 36 | } 37 | set 38 | { 39 | AppSettings.AddOrUpdateValue(SettingsKey, value); 40 | } 41 | } 42 | 43 | } 44 | }*/ -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.WinPhone/MainPage.xaml: -------------------------------------------------------------------------------- 1 |  11 | 12 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.WinPhone/MainPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.Foundation; 7 | using Windows.Foundation.Collections; 8 | using Windows.UI.Xaml; 9 | using Windows.UI.Xaml.Controls; 10 | using Windows.UI.Xaml.Controls.Primitives; 11 | using Windows.UI.Xaml.Data; 12 | using Windows.UI.Xaml.Input; 13 | using Windows.UI.Xaml.Media; 14 | using Windows.UI.Xaml.Navigation; 15 | 16 | // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238 17 | 18 | namespace XamFormsIoTSuiteDevice.WinPhone 19 | { 20 | /// 21 | /// An empty page that can be used on its own or navigated to within a Frame. 22 | /// 23 | public sealed partial class MainPage 24 | { 25 | public MainPage() 26 | { 27 | this.InitializeComponent(); 28 | 29 | this.NavigationCacheMode = NavigationCacheMode.Required; 30 | 31 | LoadApplication(new XamFormsIoTSuiteDevice.App()); 32 | } 33 | 34 | /// 35 | /// Invoked when this page is about to be displayed in a Frame. 36 | /// 37 | /// Event data that describes how this page was reached. 38 | /// This parameter is typically used to configure the page. 39 | protected override void OnNavigatedTo(NavigationEventArgs e) 40 | { 41 | // TODO: Prepare page for display here. 42 | 43 | // TODO: If your application contains multiple pages, ensure that you are 44 | // handling the hardware Back button by registering for the 45 | // Windows.Phone.UI.Input.HardwareButtons.BackPressed event. 46 | // If you are using the NavigationHelper provided by some templates, 47 | // this event is handled for you. 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.WinPhone/Package.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | FPCL.Windows8.WindowsPhone 12 | joaqu 13 | Assets\StoreLogo.png 14 | 15 | 16 | 17 | 6.3.1 18 | 6.3.1 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.WinPhone/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("XamFormsIoTSuiteDevice.WinPhone.WindowsPhone")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("XamFormsIoTSuiteDevice.WinPhone.WindowsPhone")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.WinPhone/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.WinPhone/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Windows/App.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Windows/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.ApplicationModel; 7 | using Windows.ApplicationModel.Activation; 8 | using Windows.Foundation; 9 | using Windows.Foundation.Collections; 10 | using Windows.UI.Xaml; 11 | using Windows.UI.Xaml.Controls; 12 | using Windows.UI.Xaml.Controls.Primitives; 13 | using Windows.UI.Xaml.Data; 14 | using Windows.UI.Xaml.Input; 15 | using Windows.UI.Xaml.Media; 16 | using Windows.UI.Xaml.Media.Animation; 17 | using Windows.UI.Xaml.Navigation; 18 | 19 | // The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227 20 | 21 | namespace XamFormsIoTSuiteDevice.Windows 22 | { 23 | /// 24 | /// Provides application-specific behavior to supplement the default Application class. 25 | /// 26 | public sealed partial class App : Application 27 | { 28 | /// 29 | /// Initializes the singleton application object. This is the first line of authored code 30 | /// executed, and as such is the logical equivalent of main() or WinMain(). 31 | /// 32 | public App() 33 | { 34 | this.InitializeComponent(); 35 | this.Suspending += this.OnSuspending; 36 | } 37 | 38 | /// 39 | /// Invoked when the application is launched normally by the end user. Other entry points 40 | /// will be used when the application is launched to open a specific file, to display 41 | /// search results, and so forth. 42 | /// 43 | /// Details about the launch request and process. 44 | protected override void OnLaunched(LaunchActivatedEventArgs e) 45 | { 46 | #if DEBUG 47 | if (System.Diagnostics.Debugger.IsAttached) 48 | { 49 | this.DebugSettings.EnableFrameRateCounter = true; 50 | } 51 | #endif 52 | 53 | Frame rootFrame = Window.Current.Content as Frame; 54 | 55 | // Do not repeat app initialization when the Window already has content, 56 | // just ensure that the window is active 57 | if (rootFrame == null) 58 | { 59 | // Create a Frame to act as the navigation context and navigate to the first page 60 | rootFrame = new Frame(); 61 | 62 | // TODO: change this value to a cache size that is appropriate for your application 63 | rootFrame.CacheSize = 1; 64 | 65 | Xamarin.Forms.Forms.Init(e); 66 | 67 | if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) 68 | { 69 | // TODO: Load state from previously suspended application 70 | } 71 | 72 | // Place the frame in the current Window 73 | Window.Current.Content = rootFrame; 74 | } 75 | 76 | if (rootFrame.Content == null) 77 | { 78 | // When the navigation stack isn't restored navigate to the first page, 79 | // configuring the new page by passing required information as a navigation 80 | // parameter 81 | if (!rootFrame.Navigate(typeof(MainPage), e.Arguments)) 82 | { 83 | throw new Exception("Failed to create initial page"); 84 | } 85 | } 86 | 87 | // Ensure the current window is active 88 | Window.Current.Activate(); 89 | } 90 | 91 | /// 92 | /// Invoked when application execution is being suspended. Application state is saved 93 | /// without knowing whether the application will be terminated or resumed with the contents 94 | /// of memory still intact. 95 | /// 96 | /// The source of the suspend request. 97 | /// Details about the suspend request. 98 | private void OnSuspending(object sender, SuspendingEventArgs e) 99 | { 100 | var deferral = e.SuspendingOperation.GetDeferral(); 101 | 102 | // TODO: Save application state and stop any background activity 103 | deferral.Complete(); 104 | } 105 | } 106 | } -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Windows/Assets/Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Windows/Assets/Logo.scale-100.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Windows/Assets/SmallLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Windows/Assets/SmallLogo.scale-100.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Windows/Assets/SplashScreen.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Windows/Assets/SplashScreen.scale-100.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Windows/Assets/StoreLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Windows/Assets/StoreLogo.scale-100.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Windows/Helpers/Settings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | // Helpers/Settings.cs This file was automatically added when you installed the Settings Plugin. If you are not using a PCL then comment this file back in to use it. 3 | using Plugin.Settings; 4 | using Plugin.Settings.Abstractions; 5 | 6 | namespace XamFormsIoTSuiteDevice.Windows.Helpers 7 | { 8 | /// 9 | /// This is the Settings static class that can be used in your Core solution or in any 10 | /// of your client applications. All settings are laid out the same exact way with getters 11 | /// and setters. 12 | /// 13 | public static class Settings 14 | { 15 | private static ISettings AppSettings 16 | { 17 | get 18 | { 19 | return CrossSettings.Current; 20 | } 21 | } 22 | 23 | #region Setting Constants 24 | 25 | private const string SettingsKey = "settings_key"; 26 | private static readonly string SettingsDefault = string.Empty; 27 | 28 | #endregion 29 | 30 | 31 | public static string GeneralSettings 32 | { 33 | get 34 | { 35 | return AppSettings.GetValueOrDefault(SettingsKey, SettingsDefault); 36 | } 37 | set 38 | { 39 | AppSettings.AddOrUpdateValue(SettingsKey, value); 40 | } 41 | } 42 | 43 | } 44 | }*/ -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Windows/MainPage.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Windows/MainPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.Foundation; 7 | using Windows.Foundation.Collections; 8 | using Windows.UI.Xaml; 9 | using Windows.UI.Xaml.Controls; 10 | using Windows.UI.Xaml.Controls.Primitives; 11 | using Windows.UI.Xaml.Data; 12 | using Windows.UI.Xaml.Input; 13 | using Windows.UI.Xaml.Media; 14 | using Windows.UI.Xaml.Navigation; 15 | 16 | namespace XamFormsIoTSuiteDevice.Windows 17 | { 18 | public sealed partial class MainPage 19 | { 20 | public MainPage() 21 | { 22 | this.InitializeComponent(); 23 | 24 | LoadApplication(new XamFormsIoTSuiteDevice.App()); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Windows/Package.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 7 | 8 | 9 | FPCL.Windows8.Windows 10 | joaqu 11 | Assets\StoreLogo.png 12 | 13 | 14 | 15 | 6.3.0 16 | 6.3.0 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 27 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Windows/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("XamFormsIoTSuiteDevice.Windows.Windows")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("XamFormsIoTSuiteDevice.Windows.Windows")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Windows/Windows_TemporaryKey.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Windows/Windows_TemporaryKey.pfx -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.Windows/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/AppDelegate.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | using Foundation; 6 | using UIKit; 7 | 8 | namespace XamFormsIoTSuiteDevice.iOS 9 | { 10 | // The UIApplicationDelegate for the application. This class is responsible for launching the 11 | // User Interface of the application, as well as listening (and optionally responding) to 12 | // application events from iOS. 13 | [Register("AppDelegate")] 14 | public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate 15 | { 16 | // 17 | // This method is invoked when the application has loaded and is ready to run. In this 18 | // method you should instantiate the window, load the UI into it and then make the window 19 | // visible. 20 | // 21 | // You have 17 seconds to return from this method, or iOS will terminate your application. 22 | // 23 | public override bool FinishedLaunching(UIApplication app, NSDictionary options) 24 | { 25 | global::Xamarin.Forms.Forms.Init(); 26 | LoadApplication(new App()); 27 | 28 | return base.FinishedLaunching(app, options); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Entitlements.plist: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Helpers/Settings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | // Helpers/Settings.cs This file was automatically added when you installed the Settings Plugin. If you are not using a PCL then comment this file back in to use it. 3 | using Plugin.Settings; 4 | using Plugin.Settings.Abstractions; 5 | 6 | namespace XamFormsIoTSuiteDevice.iOS.Helpers 7 | { 8 | /// 9 | /// This is the Settings static class that can be used in your Core solution or in any 10 | /// of your client applications. All settings are laid out the same exact way with getters 11 | /// and setters. 12 | /// 13 | public static class Settings 14 | { 15 | private static ISettings AppSettings 16 | { 17 | get 18 | { 19 | return CrossSettings.Current; 20 | } 21 | } 22 | 23 | #region Setting Constants 24 | 25 | private const string SettingsKey = "settings_key"; 26 | private static readonly string SettingsDefault = string.Empty; 27 | 28 | #endregion 29 | 30 | 31 | public static string GeneralSettings 32 | { 33 | get 34 | { 35 | return AppSettings.GetValueOrDefault(SettingsKey, SettingsDefault); 36 | } 37 | set 38 | { 39 | AppSettings.AddOrUpdateValue(SettingsKey, value); 40 | } 41 | } 42 | 43 | } 44 | }*/ -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Info.plist: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | UIDeviceFamily 6 | 7 | 1 8 | 2 9 | 10 | UISupportedInterfaceOrientations 11 | 12 | UIInterfaceOrientationPortrait 13 | UIInterfaceOrientationLandscapeLeft 14 | UIInterfaceOrientationLandscapeRight 15 | 16 | UISupportedInterfaceOrientations~ipad 17 | 18 | UIInterfaceOrientationPortrait 19 | UIInterfaceOrientationPortraitUpsideDown 20 | UIInterfaceOrientationLandscapeLeft 21 | UIInterfaceOrientationLandscapeRight 22 | 23 | MinimumOSVersion 24 | 6.0 25 | CFBundleDisplayName 26 | XamFormsIoTSuiteDevice 27 | CFBundleIdentifier 28 | com.yourcompany.XamFormsIoTSuiteDevice 29 | CFBundleVersion 30 | 1.0 31 | CFBundleIconFiles 32 | 33 | Icon-60@2x 34 | Icon-60@3x 35 | Icon-76 36 | Icon-76@2x 37 | Default 38 | Default@2x 39 | Default-568h@2x 40 | Default-Portrait 41 | Default-Portrait@2x 42 | Icon-Small-40 43 | Icon-Small-40@2x 44 | Icon-Small-40@3x 45 | Icon-Small 46 | Icon-Small@2x 47 | Icon-Small@3x 48 | 49 | UILaunchStoryboardName 50 | LaunchScreen 51 | 52 | 53 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Main.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | using Foundation; 6 | using UIKit; 7 | 8 | namespace XamFormsIoTSuiteDevice.iOS 9 | { 10 | public class Application 11 | { 12 | // This is the main entry point of the application. 13 | static void Main(string[] args) 14 | { 15 | // if you want to use a different Application Delegate class from "AppDelegate" 16 | // you can specify it here. 17 | UIApplication.Main(args, null, "AppDelegate"); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("XamFormsIoTSuiteDevice.iOS")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("XamFormsIoTSuiteDevice.iOS")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("72bdc44f-c588-44f3-b6df-9aace7daafdd")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/Default-568h@2x.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/Default-Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/Default-Portrait.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/Default-Portrait@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/Default-Portrait@2x.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/Default.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/Default@2x.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/Icon-60@2x.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/Icon-60@3x.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/Icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/Icon-76.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/Icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/Icon-76@2x.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/Icon-Small-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/Icon-Small-40.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/Icon-Small-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/Icon-Small-40@2x.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/Icon-Small-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/Icon-Small-40@3x.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/Icon-Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/Icon-Small.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/Icon-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/Icon-Small@2x.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/Icon-Small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/Icon-Small@3x.png -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/Resources/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/iTunesArtwork: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/iTunesArtwork -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/iTunesArtwork@2x: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/iot-hub-xamarin-remote-monitoring-device/1e81ba911c22822b2c3a0680e23ff8b684216063/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/iTunesArtwork@2x -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice.iOS/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/GettingStarted.Xamarin: -------------------------------------------------------------------------------- 1 | 2 | GS\XF\CS\App\GettingStarted.html 3 | false 4 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/Helpers/Settings.cs: -------------------------------------------------------------------------------- 1 | // Helpers/Settings.cs 2 | using Plugin.Settings; 3 | using Plugin.Settings.Abstractions; 4 | 5 | namespace XamFormsIoTSuiteDevice.Helpers 6 | { 7 | /// 8 | /// This is the Settings static class that can be used in your Core solution or in any 9 | /// of your client applications. All settings are laid out the same exact way with getters 10 | /// and setters. 11 | /// 12 | public static class Settings 13 | { 14 | private static ISettings AppSettings 15 | { 16 | get 17 | { 18 | return CrossSettings.Current; 19 | } 20 | } 21 | 22 | #region Setting Constants 23 | 24 | private const string DeviceIdKey = "DeviceId_key"; 25 | private static readonly string DeviceIdDefault = string.Empty; 26 | 27 | private const string DeviceKeyKey = "DeviceKey_key"; 28 | private static readonly string DeviceKeyDefault = string.Empty; 29 | 30 | private const string HostNameKey = "HostName_key"; 31 | private static readonly string HostNameDefault = string.Empty; 32 | 33 | #endregion 34 | 35 | 36 | public static string DeviceId 37 | { 38 | get { return AppSettings.GetValueOrDefault(DeviceIdKey, DeviceIdDefault); } 39 | set { AppSettings.AddOrUpdateValue(DeviceIdKey, value); } 40 | } 41 | public static string DeviceKey 42 | { 43 | get { return AppSettings.GetValueOrDefault(DeviceKeyKey, DeviceKeyDefault); } 44 | set { AppSettings.AddOrUpdateValue(DeviceKeyKey, value); } 45 | } 46 | public static string HostName 47 | { 48 | get { return AppSettings.GetValueOrDefault(HostNameKey, HostNameDefault); } 49 | set { AppSettings.AddOrUpdateValue(HostNameKey, value); } 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Resources; 2 | using System.Reflection; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("XamFormsIoTSuiteDevice")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("XamFormsIoTSuiteDevice")] 14 | [assembly: AssemblyCopyright("Copyright © 2014")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | [assembly: NeutralResourcesLanguage("en")] 18 | 19 | // Version information for an assembly consists of the following four values: 20 | // 21 | // Major Version 22 | // Minor Version 23 | // Build Number 24 | // Revision 25 | // 26 | // You can specify all the values or you can default the Build and Revision Numbers 27 | // by using the '*' as shown below: 28 | // [assembly: AssemblyVersion("1.0.*")] 29 | [assembly: AssemblyVersion("1.0.0.0")] 30 | [assembly: AssemblyFileVersion("1.0.0.0")] 31 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/XamFormsIoTSuiteDevice/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /XamNativeIoTSuiteDevice/XamNativeIoTSuiteDevice/XamNativeIoTSuiteDevice.Droid/Assets/AboutAssets.txt: -------------------------------------------------------------------------------- 1 | Any raw assets you want to be deployed with your application can be placed in 2 | this directory (and child directories) and given a Build Action of "AndroidAsset". 3 | 4 | These files will be deployed with your package and will be accessible using Android's 5 | AssetManager, like this: 6 | 7 | public class ReadAsset : Activity 8 | { 9 | protected override void OnCreate (Bundle bundle) 10 | { 11 | base.OnCreate (bundle); 12 | 13 | InputStream input = Assets.Open ("my_asset.txt"); 14 | } 15 | } 16 | 17 | Additionally, some Android functions will automatically load asset files: 18 | 19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf"); 20 | -------------------------------------------------------------------------------- /XamNativeIoTSuiteDevice/XamNativeIoTSuiteDevice/XamNativeIoTSuiteDevice.Droid/Helpers/Settings.cs: -------------------------------------------------------------------------------- 1 | /* 2 | // Helpers/Settings.cs This file was automatically added when you installed the Settings Plugin. If you are not using a PCL then comment this file back in to use it. 3 | using Plugin.Settings; 4 | using Plugin.Settings.Abstractions; 5 | 6 | namespace XamNativeIoTSuiteDevice.Droid.Helpers 7 | { 8 | /// 9 | /// This is the Settings static class that can be used in your Core solution or in any 10 | /// of your client applications. All settings are laid out the same exact way with getters 11 | /// and setters. 12 | /// 13 | public static class Settings 14 | { 15 | private static ISettings AppSettings 16 | { 17 | get 18 | { 19 | return CrossSettings.Current; 20 | } 21 | } 22 | 23 | #region Setting Constants 24 | 25 | private const string SettingsKey = "settings_key"; 26 | private static readonly string SettingsDefault = string.Empty; 27 | 28 | #endregion 29 | 30 | 31 | public static string GeneralSettings 32 | { 33 | get 34 | { 35 | return AppSettings.GetValueOrDefault(SettingsKey, SettingsDefault); 36 | } 37 | set 38 | { 39 | AppSettings.AddOrUpdateValue(SettingsKey, value); 40 | } 41 | } 42 | 43 | } 44 | }*/ -------------------------------------------------------------------------------- /XamNativeIoTSuiteDevice/XamNativeIoTSuiteDevice/XamNativeIoTSuiteDevice.Droid/MainActivity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using Android.App; 4 | using Android.Content; 5 | using Android.Runtime; 6 | using Android.Views; 7 | using Android.Widget; 8 | using Android.OS; 9 | using AzureIoTSuiteRemoteMonitoringHelper; 10 | 11 | namespace XamNativeIoTSuiteDevice.Droid 12 | { 13 | [Activity (Label = "XamNativeIoTSuiteDevice.Droid", MainLauncher = true, Icon = "@drawable/icon")] 14 | public class MainActivity : Activity 15 | { 16 | MyClass Device; 17 | 18 | Button buttonConnect; 19 | Button buttonSend; 20 | 21 | TextView textDeviceId; 22 | TextView textDeviceKey; 23 | TextView textHostName; 24 | 25 | TextView textTemperature; 26 | TextView textHumidity; 27 | 28 | protected override void OnCreate (Bundle bundle) 29 | { 30 | base.OnCreate (bundle); 31 | 32 | // Set our view from the "main" layout resource 33 | SetContentView (Resource.Layout.Main); 34 | 35 | // Initialize IoT Hub client 36 | Device = new MyClass(); 37 | 38 | // Add the telemetry data 39 | Device.AddTelemetry(new TelemetryFormat { Name = "Temperature", DisplayName = "Temp (C)", Type = "Double" }, (double)0); 40 | Device.AddTelemetry(new TelemetryFormat { Name = "Humidity", DisplayName = "Hmdt (%)", Type = "Double" }, (double)0); 41 | 42 | 43 | // If you are developing and want to avoid having to enter the full connection string on the device, 44 | // you can temporarily hard code it here. Comment this when done! 45 | //Device.DeviceId = "[DeviceId]"; 46 | //Device.HostName = "[HostName]"; 47 | //Device.DeviceKey = "[DeviceKey]"; 48 | 49 | // Prepare UI elements 50 | buttonConnect = FindViewById