Presentation is loading. Please wait.

Presentation is loading. Please wait.

4/9/2019 06 | Contracts © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.

Similar presentations


Presentation on theme: "4/9/2019 06 | Contracts © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks."— Presentation transcript:

1 4/9/2019 06 | Contracts © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

2 Course Topics Building Windows Store Apps for iOS Developers Jump Start 01 | Introduction to the Windows Store Platform and the tools 02 | C# for Objective-C developers 03 | Async programming & Networking intro Meal Break, around noon PST 45 to 60 mins 04 | Introduction to XAML & UI Patterns for XAML apps 05 | App Model & Storage 06 | Contracts 07 | Notifications 08 | Windows Store APIs

3 Most apps have rich content that users want to..
Build 2012 4/9/2019 Most apps have rich content that users want to.. Find and act upon Share Save or enhance in other apps Print Send to devices © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

4 App-to-app communication
4/9/2019 App-to-app communication Contracts File Open Picker File Save Picker Search Share PlayTo Windows 8.1 Contacts Card Calendar Extensions Account Picture Provider Autoplay Camera settings Contact picker File Activation © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

5 “Charms”, Search, Share contract
4/9/2019 Contracts “Charms”, Search, Share contract © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

6 Contract implementation pattern
4/9/2019 Contract implementation pattern Source Listen for event Fill in the data Target Declare in manifest Implement User Interface Handle activation Process Data Report event completion Design-time Run-time © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

7 Declaring contract in app’s manifest
4/9/2019 Declaring contract in app’s manifest <Extensions> <Extension Category="windows.shareTarget" StartPage="target.html"> <ShareTarget> <DataFormat>text</DataFormat> <DataFormat>uri</DataFormat> <DataFormat>bitmap</DataFormat> <DataFormat>html</DataFormat> </ShareTarget> </Extension> </Extensions> © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

8 Sharing from source to target
Build 2012 4/9/2019 Sharing from source to target Source app Operating system Share target app Registers with the DataTransfer Manager User selects “Share”, active app is sent event Receives event and fills DataPackage Filters list of Target Apps and Quicklinks Completes async calls and returns User selects Target App or Quicklink Activated for sharing Activate Target as kind shareTarget Processes DataPackage contents DataPackage lives in source application Reports Complete © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

9 Implementing Share Source
4/9/2019 Implementing Share Source // Step 1: Register as a share source. this.dataTransferManager = DataTransferManager.GetForCurrentView(); this.dataTransferManager.DataRequested += new TypedEventHandler<DataTransferManager, DataRequestedEventArgs>(this.OnDataRequested); // Step 2 fill in the data private void OnDataRequested(DataTransferManager sender, DataRequestedEventArgs e){ DataPackage requestData = request.Data; requestData.Properties.Title = “title will go here” ; requestData.Properties.Description = “description is optional”; requestData.Properties.ContentSourceApplicationLink = ApplicationLink; requestData.SetText(dataPackageText); requestData.SetData (“customformat”, customObjectHere); } © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

10 Implementing Share Target
4/9/2019 Implementing Share Target // Step 2: Handle activation and retrieve data protected override void OnShareTargetActivated(ShareTargetActivatedEventArgs args) { var so = args.ShareOperation; var title = so.Data.Properties.Title; var description = so.Data.Properties.Description; … // Retrieve the data package content. // The GetWebLinkAsync(), GetTextAsync(), GetStorageItemsAsync(), etc. if (so.Contains(StandardDataFormats.WebLink)) sharedWebLink = await so.Data.GetWebLinkAsync(); } so.ReportCompleted(/*quicklink could go there */ ); © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

11 Search contract makes your app searchable from anywhere in the system
Build 2012 4/9/2019 Search contract makes your app searchable from anywhere in the system © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

12 Search anatomy (in 8.0) Search box (scoped)
4/9/2019 Search anatomy (in 8.0) 1 4 Search box (scoped) Apps that implement search contract Query suggestions provided by foreground app Result suggestions 3 2 © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

13 Implementing Search //Step 2, handle activation
4/9/2019 Implementing Search //Step 2, handle activation async protected override void OnSearchActivated(SearchActivatedEventArgs args) { //Look at args.QueryText } //Step 3, implement QuerySubmitted Event handler SearchPane.GetForCurrentView().QuerySubmitted += new TypedEventHandler<SearchPane, SearchPaneQuerySubmittedEventArgs>(OnQuerySubmitted) { //Do something with searchPane.SuggestionsRequested -= new TypedEventHandler<SearchPane, SearchPaneSuggestionsRequestedEventArgs>(OnSearchPaneSuggestionsRequested);args.QueryText © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

14 Implementing Search //Step 4, implement suggestions
4/9/2019 Implementing Search //Step 4, implement suggestions searchPane.SuggestionsRequested -= new TypedEventHandler<SearchPane, SearchPaneSuggestionsRequestedEventArgs>(OnSearchPaneSuggestionsRequested); private void OnSearchPaneSuggestionsRequested(SearchPane sender, SearchPaneSuggestionsRequestedEventArgs e) { var request = e.Request; request.SearchSuggestionCollection.AppendQuerySuggestion(suggestion); Uri uri = new Uri("ms-appx:///Assets/result.png"); RandomAccessStreamReference imageSource = RandomAccessStreamReference.CreateFromUri(uri); request.SearchSuggestionCollection.AppendResultSuggestion ( text, description, url, imageSource, imageAlt); } © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

15 Changes in Windows 8.1 search
4/9/2019 Changes in Windows 8.1 search In-canvas search for app SearchBox control System search returns results in Hero search Apps will integrate with hero integration (details are coming) © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

16 Build 2012 4/9/2019 File picker contracts enable seamless integration between apps through the system’s file picking experience © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

17 4/9/2019 File Pickers © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

18 FileOpenPicker Providing app (implements contract) Calling app
Build 2012 4/9/2019 FileOpenPicker Providing app (implements contract) Calling app File Picker Calls FileOpenPicker Loads default (last) store Activated to provide files User selects app to provide files Loads app’s page to display provided files Navigates to a page that displays files User picks file (or save location) Completes async calls and captures picked file Returns picked file to calling app © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

19 File Open Picker //Step1: manifest //Step2: handle activation
4/9/2019 File Open Picker //Step1: manifest //Step2: handle activation protected override void OnFileOpenPickerActivated(FileOpenPickerActivatedEventArgs args) { var FileOpenPickerPage = new SDKTemplate.FileOpenPickerPage(); FileOpenPickerPage.Activate(args); } //Step3: Populate basket //Step4: Add selected file to basket FileOpenPickerUI fileOpenPickerUI = FileOpenPickerPage.Current.fileOpenPickerUI; StorageFile file = await fileOpenPickerUI.AddFile(id, file); © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

20 Contracts cheat-sheet
Build 2012 4/9/2019 Contracts cheat-sheet Contract Manifest Activation VS template Jumpstart Share source No N/N Windows.ApplicationModel.DataTransfer.DataTransferManager Share target Yes Windows.ApplicationModel.DataTransfer.ShareTarget Search Windows.ApplicationModel.Search File Open Windows.Storage.Pickers.Provider.FileOpenPickerUI File Save Windows.Storage.Pickers.Provider.FileSavePickerUI Settings Windows.UI.ApplicationSettings.SettingsPane PlayTo Windows.Media.PlayTo.PlayToManager Cached file updater Windows.Storage.Provider.CachedFileUpdaterUI © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

21 Useful references App contracts and extensions, MSDN
4/9/2019 Useful references App contracts and extensions, MSDN Building apps that work together (updates for 8.1) Jake Sabulsky Design and build a great search experience (8.1) Jon Gordner © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.


Download ppt "4/9/2019 06 | Contracts © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks."

Similar presentations


Ads by Google