One topic that we’ve demonstrated quite a bit is how apps on a Windows 8 PC can communicate with other apps and web services. At the start of Windows 8 we chose an approach where apps can be the source or destination for data you want to share—sort of like a clipboard, but with a richer interaction model and clearer semantics. When an app implements a contract, Windows 8 can provide glue between that app and any other apps on the system, and the system itself. You can see this in action when you do something simple like use the Share charm from a web page in the Metro style Internet Explorer—you can share the link via the Mail app, with someone whose contact info you've stored in the People app, and so on. You can search across apps that implement the Search contract. You can open and save files from or to any location that implements the File Open and Save Picker contracts. This innovative approach allows Windows 8 to work with any app/service pair rather than “hardcoding” a single level of support for a given app. And all of this is supported, if you choose, by your Microsoft account, which you can connect to different services, from Facebook to Twitter to LinkedIn and more. Over the course of this week, we’ll do a series of posts on the new Microsoft apps, where sharing, connecting, and integration with Windows 8 are key topics. This is a repost of a developer-focused post from our Windows 8 App Developer blog and was authored by Derek Gebhard, a program manager on our User Experience team. --Steven
When you start writing Metro style apps you’ll quickly come across contracts, a new and powerful concept in Windows 8. Metro style apps use contracts to declare interactions they support with other apps and with Windows. You’ve probably already heard about some of them: search, share, etc. Using contracts, apps become better by working with the system or with each other when users install more apps that implement contracts. In this post I’ll walk you through activation, one of the main concepts to think about as you add contracts to your apps.
The Windows activation platform is used to launch Metro Style apps and to notify them of the reason why a user launched them. The reasons vary from a user starting the app using its tile on the start screen to the app being launched for a specific task such as showing a user search results for a query. Windows provides your app with the reason it was launched and if applicable any additional info needed to complete its task. Before our Windows 8 activation platform, you passed this info to apps via command-line parameters. With our new model, we also support passing live objects such as a StorageFile, ShareOperation, etc to provide the app with context. You’ll see that this makes contracts all the more powerful. Let’s jump into the details of what you need to know to support being launched for a contract.