[UWP] UWP应用程序 - 跨设备进行通信 [英] [UWP] UWP apps - communicate across devices

查看:127
本文介绍了[UWP] UWP应用程序 - 跨设备进行通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们需要构建一个可在桌面上运行的UWP应用程序(其工作方式类似于服务器)和另一个将在平板电脑上运行的UWP应用程序(其工作方式类似于客户端)。所有这些都将在同一个本地网络中。服务器应用程序将包含一些图像,视频,
3D模型(其中一些可能是大约100 MB或更大的大文件),当点击该应用程序的按钮时,我们需要将该图像/视频/模型发送到平板电脑上的客户端应用程序。我们开始研究这样做的选项,这些是我们找到的主要选项




- 应用程序服务 - https://docs.microsoft。 com / zh-CN / windows / uwp / launch-resume / how-to-create-and-consume-app-service



- 套接字 - https: //docs.microsoft.com/en-us/windows/uwp/networking/sockets



- 分享合同(不确定这是否适用于各种设备,必须阅读更多) - https://docs.microsoft.com/en-us/windows/uwp/app-to-app/



我们计划创建一些带有这些选项的样本,看看我们可以对每个选项做些什么。同时希望从专家那里获得关于利用这些方法从一个UWP应用程序向另一个发送数据的优点和缺点的任何想法。如果我错过了我们可以尝试的任何其他选项,请告诉我。

We need to build a UWP app which will run on a desktop (which works like a server) and another UWP app which will run on tablets (which works like a client). All these will be in the same local network. The server app will contain some images, videos, 3D models (some of them can be large files around 100 MB or more) and when a button is clicked on that app we need to send that image/video/model to the client app on the tablet. We started researching on the options of doing that and these are the main options we found.

- App services - https://docs.microsoft.com/en-us/windows/uwp/launch-resume/how-to-create-and-consume-an-app-service

- Sockets - https://docs.microsoft.com/en-us/windows/uwp/networking/sockets

- Share contract (not sure whether this is available across devices, have to read more) - https://docs.microsoft.com/en-us/windows/uwp/app-to-app/

We are planning to create some samples with these options and see what we can do with each option. In the mean time would like to get any ideas from the experts about Pros and Cons of using each of these methods to send data from one UWP app to the other. Also please let me know if I have missed any other options that we can try.

推荐答案

Hello Madhu_AtLink,

Hello Madhu_AtLink,

以下两件事可能是你的想法:

The following two things can be your chioce:

1。罗马项目: 已连接的应用和设备(罗马项目)

1. Project Rome: Connected apps and devices (Project Rome)

2。套接字

您提供的应用服务和共享合同是您在使用UWP时需要学习的基本内容。但是,通常它们不用于跨设备方案。常见的应用服务用于设备上的应用,远程
设备应用服务属于项目罗马。共享数据功能用于将当前UWP应用程序中的数据共享给其他应用程序。

The app service and share contract you provided are basic things that you need to learn when working with UWP. However, commonly they are not used for cross device scenario. A common app service is used for apps on the device, remote device app service belongs to project rome. The share data function is used to share data from current UWP app to other apps. 

要检查样本以了解更多信息:

To check for samples to understand more:

1 。罗马项目: https://github.com/Microsoft/Windows-universal-samples/tree/dev/Samples/RemoteSystems

2。套接字: https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/StreamSocket

Project Rome的搭配喜欢最合适的技术,因为它也用于交叉设备。但是,由于我没有对大数据通信进行测试,我对它的性能不太了解。无论如何,我认为你首先从
开始是个好主意。 

Project Rome looks like the most suitable technology since it is also used for cross devices. However since I haven't tested it for large data communication, I'm not so sure about its performance. Anyway, I think it's a good idea for you to start from it first. 

祝你好运,

Barry


这篇关于[UWP] UWP应用程序 - 跨设备进行通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆