简体   繁体   English

使用Xamarin Forms从Android上的IoT中心接收遥测

[英]Receive telmetry from IoT hub on Android with Xamarin Forms

I have a Xamarin.Forms shared project created for Android 7.0 and UWP. 我有一个为Android 7.0和UWP创建的Xamarin.Forms共享项目。

What I am attempting to do is receive information from an IoT hub on Azure. 我正在尝试从Azure的IoT中心接收信息。

I have previously been able to receive telemetry to a console application by following this tutorial 通过遵循本教程,我以前能够接收到控制台应用程序的遥测

https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-csharp-csharp-getstarted https://docs.microsoft.com/zh-cn/azure/iot-hub/iot-hub-csharp-csharp-getstarted

I was using Microsoft.ServiceBus.Messaging library 我正在使用Microsoft.ServiceBus.Messaging

Is this not supported on Android? Android不支持此功能吗? and if so, is there a way to receive messages on an android device from an IoT hub using Xamarin? 如果是的话,有没有办法使用Xamarin从IoT中心在android设备上接收消息?

You might want to use the newer library for event Hub monitoring: https://github.com/azure/azure-event-hubs-dotnet 您可能需要使用更新的库来进行事件中心监视: https : //github.com/azure/azure-event-hubs-dotnet

This new lib is .Net Standard 1.3 compatible and should work on Xamarin.Android. 此新库与.Net Standard 1.3兼容,并且可以在Xamarin.Android上运行。

We need to update the Azure IoT Hub docs to point to this new lib instead of the older Microsoft.ServiceBus.Messaging one. 我们需要更新Azure IoT中心文档以指向此新库,而不是旧版Microsoft.ServiceBus.Messaging。 I'll make sure it's added to our backlog. 我将确保将其添加到我们的待办事项中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM