Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Communication between Windows Store app and native desktop application

Tags:

! For the sake of simplifying things I will refer to Windows Store applications (also known as Metro or Modern UI) as "app" and to common desktop applications as "application" !

I believe this is still one of the most unclear yet important questions concerning app-development for developers who already have established applications on the market: How to manage communication between apps and applications on a Windows 8 system? (please let's not start a debate on principles - there're so many use cases where this is really required!)

I basically read hundrets of articles in the last few days but still it remains unclear how to proceed doing it right from the first time. Mainly because I found several conflicting information. With my question here I'd like to re-approach this problem from the viewpoint of the final Windows 8 possibilities.

Given situation:

  • App and application run on same system
  • 1:1 communication
  • Application is native (written in Delphi)
  • Administrator or if required even system privileges are available for the application
  • In 90% of the use cases the app requests an action to be performed by the application and receives some textual result. The app shouldn't be left nor frozen for this!
  • In 10% the application performs an action (triggered by some event) and informs the app - the result might be: showing certain info on the tile or in the already running and active app or if possible running the app / bringing it to the foreground.

Now the "simple" question is, how to achieve this?

  • Is local webserver access actually allowed now? (I believe it wasn't for a long time but now is since the final release)
  • WCF? (-> apparently MS doesn't recommend that anymore)
  • HTTP requests on a local REST/SOAP server?
  • WinRT syndication API? (another form of webservice access with RSS/atom responses)
  • WebSockets (like MessageWebSocket)?
  • Some other form of TCP/IP communication?
  • Sharing a text file for in- and output (actually simply thinking of this hurts, but at least that's a possibility MS can't block...)
  • Named Pipes are not allowed, right?

There are some discussions on this topic here on SO, however most of them are not up-to-date anymore as MS changed a lot before releasing the final version of Windows 8. Instead of mixing up old and new information I'd like to find a definite and current answer to this problem for me and for all the other Windows application and app developers. Thank you!

like image 995
CodeX Avatar asked Sep 09 '12 18:09

CodeX


People also ask

What is the difference between a desktop app and a Microsoft Store app?

Microsoft Store Apps: Interface. The same app can vary quite a bit between versions. In general, desktop apps offer more features and navigation icons, while Store apps use larger, more spaced-out buttons. This makes Store apps more convenient for touchscreen use.

Is Windows application and desktop application same?

That is because they are the same thing: the traditional Windows applications that you install and use with the mouse and keyboard, just as it has been done since the first versions of Windows. In Windows, the list of installed desktop apps is found in the Control Panel.

How do I put an app from the Microsoft Store on my desktop?

Press and hold (or right-click) the desktop, then select New > Shortcut. Enter the location of the item or select Browse to find the item in File Explorer, then select the location and select OK. Select Next, then select Finish.


1 Answers

If you are talking about an application going into the Store, communication with the local system via any mechanism is not allowed. Communication with the local system is supported in some debug scenarios to make app development easier.

You can launch desktop applications from Windows Store applications with file or protocol handlers, but there is no direct communication.

So, to reiterate the point... communication between WinRT and the desktop is not allowed for released Windows Store applications. Communication between the two environments is allowed in debug only.

The PG has posted in different places reasons for why communication is not allowed, ranging from security, to the WinRT lifecycle (i.e., you app gets suspended - how does that get handled re: resources, sockets, remote app, etc. -- lots of failure points) and the fact that Store apps cannot have a dependency on external programs (i.e., I need your local desktop app/service for the app to run, but how do I get your app/service installed? You cannot integrate into the Store app. You can provide another Store desktop app entry, but that is a bad user experience.) Those are high level summaries, of course.

like image 122
Jeff Brand Avatar answered Oct 27 '22 17:10

Jeff Brand