Search code examples
uwpwindows-10-iot-corecross-application

How to send string cross-app in one UWP device?


I am developing application that consist of three separated applications. (two background, one with GUI) that are running on Raspberry PI 3B+ with Windows 10 IOT Core. Schematic is simple

Communicator -> Data transformation -> Visualization

My problem is, that I cannot effectively send data from one app to another without user activity. Windows solution for data transfer requires user action or launching other app. ( https://learn.microsoft.com/en-us/windows/uwp/app-to-app/ )

Data are short JSON serialized objects into strings.

I tried TCP protocol, but it is not allowed on one device cross app (why? I don't understand).

Now I am doing that by creating text file in Picture folder, next app will read that file and delete file. This method is slow and often crashes.

Is there any other solution? Best one will be stream or some kind of fast file transfer.

Thanks for any idea.

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

It is not perfect, because in background tasks you will make another background task. But works pretty good.


Solution

  • have a look at this: https://learn.microsoft.com/en-us/windows/uwp/launch-resume/how-to-create-and-consume-an-app-service

    it will let you send data on the same device to a background task of other apps