Details for Windows 8 contracts for apps revealed

Windows 8 app developers have some new tools to work with when they make their Metro style software products. One of them is called contracts. Basically, putting in contracts in Windows 8 apps allows them to interact with other apps or with Windows 8 itself.

In a new and highly technical entry on the Windows 8 app developers blog site, Microsoft's Derek Gebhard writes about how app developers can program and use Windows 8 contracts in their apps. Gebhard gives a couple of examples of how these contracts work:

For example, the File Open Picker contract allows the user to import files from one app into another. With the Search contract, users are empowered to search an app from anywhere in the system and can quickly transfer a query between multiple apps. In all of these cases, and a lot of other contract scenarios, Windows needs to be able to launch directly to a spot in your app’s UI where the user can complete a specific task quickly and efficiently.

The blog goes into detail about how app programmers can implement contracts in their apps. Metro app makers can put in the Search contract in both JavaScript and XAML apps. Both types of Metro apps can also be programmed to use the File Open Picker contract. Gebhard points out that using the Visual Studio tool will be of great help in supporting both the Search and File Open Picker contracts, along with the Share Target contract.

He also says that even if a Windows 8 Metro app maker doesn't add support for contracts in his app at first, it's still a good idea to keep these techniques in mind, saying, "This way you can easily extend your app in the future to support contracts without refactoring your code."

Image via Microsoft

Report a problem with article
Previous Story

Online scam targets former MegaUpload users

Next Story

Google+ Hangouts adds telephone calling support

12 Comments

Commenting is disabled on this article.

techguy77 said,
Thanks but no.

Yes, as you've said over, and over, and over, and over, and over again, you won't be getting Windows 8. Give the comments that add nothing to the conversation (ie. trolling) a rest already.

This actually a really neat solution for mobile devices, and it's not something you see people in the forums displeased with. I do still have concerns, however. Things like "Share" and "Search" on the outset seem very practical, but I can see cases where they might be unnecessary on the one hand or insufficient on the other.

In the case of a card game, for instance, Search or Share might not make any sense. In the case of a web browser, both Search and Share may not give users the wide range actions they may want to carry out. Then there's the issue that these features don't work at all for desktop applications.

Like I said, I like what MSFT came up with, but I'm not sure how it will eventually come to be regarded in practice.

Salutary7 said,
Like I said, I like what MSFT came up with, but I'm not sure how it will eventually come to be regarded in practice.

I imagine LoB apps sharing rich datatypes instead of users copying and pasting with data entry errors being introduced.

dotf said,

I imagine LoB apps sharing rich datatypes instead of users copying and pasting with data entry errors being introduced.

True, that could be a really nice incentive for some companies to adopt Win8. It makes it pretty easy to have modularity in app suites as well, giving businesses or individual departments only what they need, while still offering consistent interoperation within the suite and with other programs on the system.

Salutary7 said,
This actually a really neat solution for mobile devices, and it's not something you see people in the forums displeased with. I do still have concerns, however. Things like "Share" and "Search" on the outset seem very practical, but I can see cases where they might be unnecessary on the one hand or insufficient on the other.

In the case of a card game, for instance, Search or Share might not make any sense. In the case of a web browser, both Search and Share may not give users the wide range actions they may want to carry out. Then there's the issue that these features don't work at all for desktop applications.

Like I said, I like what MSFT came up with, but I'm not sure how it will eventually come to be regarded in practice.

Why are you concerned about those things? In a card game, the developer wouldn't put the search and share contract in their app and when you try to use those charms, the OS will tell you there is nothing to search or share.

In a browser, search is probably just going to make search quiries through Bing (or whatever search engine you may be able to use) and share would just allow you to share the page with to another app/service (ie, Facebook, Twitter, StumbleUpon, etc.).

I do see the concern for the desktop apps. Hopefully, there will be some way for those to utilize the contracts in the future.

wixostrix said,

Why are you concerned about those things? In a card game, the developer wouldn't put the search and share contract in their app and when you try to use those charms, the OS will tell you there is nothing to search or share.

In a browser, search is probably just going to make search quiries through Bing (or whatever search engine you may be able to use) and share would just allow you to share the page with to another app/service (ie, Facebook, Twitter, StumbleUpon, etc.).

I do see the concern for the desktop apps. Hopefully, there will be some way for those to utilize the contracts in the future.


I suppose I just see consistency as a potential problem. When you have this common app interface accessible 100% of the time, the downside is that it only works well some of the time. From a traditional design standpoint, this goes against the grain, so that's why I'm unsure how these features will be received, at least on the desktop.

Salutary7 said,

I suppose I just see consistency as a potential problem. When you have this common app interface accessible 100% of the time, the downside is that it only works well some of the time. From a traditional design standpoint, this goes against the grain, so that's why I'm unsure how these features will be received, at least on the desktop.

I understand that. They will likely just not work with the desktop apps, at least not initially.

I'm not sure how I feel about this, it all seems to be getting to the point where a rogue apps could potentially take all of your contact information. I guess its getting to the point were we're going to have to start looking at the apps and the permissions they have more closely to see what they're accessing.

Hopefully the API and onslaught of apps it provides does help things because the lack of metro apps and the ones that were released in the Win8 CP were diabolical and I'd be ashamed to have released them, even if they were supposed to be a preview.

sagum said,
I'm not sure how I feel about this, it all seems to be getting to the point where a rogue apps could potentially take all of your contact information. I guess its getting to the point were we're going to have to start looking at the apps and the permissions they have more closely to see what they're accessing.

Hopefully the API and onslaught of apps it provides does help things because the lack of metro apps and the ones that were released in the Win8 CP were diabolical and I'd be ashamed to have released them, even if they were supposed to be a preview.


Apps can only access each other's data and stuff through Contracts and the File Picker, of which both requires the user's input and approval. Otherwise, all of the apps are completely sandboxed from each other.

sagum said,
I'm not sure how I feel about this, it all seems to be getting to the point where a rogue apps could potentially take all of your contact information. I guess its getting to the point were we're going to have to start looking at the apps and the permissions they have more closely to see what they're accessing..

You don't already? I'm sorry but if you're just installing any old app off the store from an untrusted developer, and don't bother to check what access it's requesting, then you deserve to have all your private data stolen. That said, apps on the windows app store will be vetted by Microsoft. Sure there's a chance something malicious will get past the screening, but the instances of that should be low.