欢迎来到麦多课文档分享! | 帮助中心 海量文档,免费浏览,给你所需,享你所想!
麦多课文档分享
全部分类
  • 标准规范>
  • 教学课件>
  • 考试资料>
  • 办公文档>
  • 学术论文>
  • 行业资料>
  • 易语言源码>
  • ImageVerifierCode 换一换
    首页 麦多课文档分享 > 资源分类 > PPT文档下载
    分享到微信 分享到微博 分享到QQ空间

    App ServicesDeveloper's Guide to Windows 10.ppt

    • 资源ID:378479       资源大小:783.06KB        全文页数:27页
    • 资源格式: PPT        下载积分:2000积分
    快捷下载 游客一键下载
    账号登录下载
    微信登录下载
    二维码
    微信扫一扫登录
    下载资源需要2000积分(如需开发票,请勿充值!)
    邮箱/手机:
    温馨提示:
    如需开发票,请勿充值!快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如需开发票,请勿充值!如填写123,账号就是123,密码也是123。
    支付方式: 支付宝扫码支付    微信扫码支付   
    验证码:   换一换

    加入VIP,交流精品资源
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    App ServicesDeveloper's Guide to Windows 10.ppt

    1、App Services Developers Guide to Windows 10,Agenda,What are App Services? App Services Scenarios App Services Client App Services Server Debugging Tips Debugging an App Service App Services Details App Service Lifetime Implementing a client SDK Controlling Access Versioning,What are App Services?,Ap

    2、p Service: Special case of Background Task,Client App A,Client App B,Background Task,App with App Service,Scenario: Bar Code Scanning,Bar Code decoding App Service,Image bytes in ValueSet or FileToken,Decoded data,Scenario: Enterprise suite of apps,App Service Maintains Inventory cache,Client App A,

    3、Client App B,Interact with cloud services,App Service Proximity Reading Services,Think of App Services as Web services on device,App Services Client,AppServiceConnection connection = new AppServiceConnection(); connection.AppServiceName = “microsoftDX-appservicesdemo“; connection.PackageFamilyName =

    4、 “24919ArunjeetSingh.InstapaperIt“; AppServiceConnectionStatus connectionStatus = await connection.OpenAsync(); if (connectionStatus = AppServiceConnectionStatus.Success) /Send data to the service var message = new ValueSet(); message.Add(“Command“, “CalcSum“); message.Add(“Value1“, Int32.Parse(Valu

    5、e1.Text); message.Add(“Value2“, Int32.Parse(Value2.Text); /Send message and wait for response AppServiceResponse response = await connection.SendMessageAsync(message); if (response.Status = AppServiceResponseStatus.Success) int sum = (int)response.Message“Result“; new MessageDialog(“Result=“ + sum).

    6、ShowAsync(); ,App Services Service (1/2),namespace AppServicesDemoTask public sealed class AppServiceTask : IBackgroundTask private static BackgroundTaskDeferral _serviceDeferral; public void Run(IBackgroundTaskInstance taskInstance) var appService = taskInstance.TriggerDetails as AppServiceTriggerD

    7、etails; if (appService.Name = “microsoftDX-appservicesdemo“) / Hook up the RequestReceived event handler appService.AppServiceConnection.RequestReceived += RequestReceived; .,App Services Service (2/2),private async void RequestReceived(AppServiceConnection sender, AppServiceRequestReceivedEventArgs

    8、 args) var message = args.Request.Message; / This service uses a Command keyed entry for the client to invoke services from the App Service string command = message“Command“ as string; switch (command) case “DoIt“: var messageDeferral = args.GetDeferral(); int value1 = (int)message“Value1“; . Do som

    9、e processing /Set a result to return to the caller var returnMessage = new ValueSet(); returnMessage.Add(“Result“, result); var responseStatus = await args.Request.SendResponseAsync(returnMessage); messageDeferral.Complete(); break; . ,Declaring App Service,Two-way Communication,Client and server ca

    10、n keep a two-way chatty communication channel open Client can attach a RequestReceived event handler to its own AppServiceConnection instanceBoth client and server can send and receive messages,AppServiceConnectionStatus connectionStatus = await connection.OpenAsync(); if (connectionStatus = AppServ

    11、iceConnectionStatus.Success) connection.RequestReceived += OnRequestReceived; ,Debugging Tips,Getting the PackageFamilyName for the App Service Debugging your App Service,Getting the Service PackageFamilyName,Store Associate App with the Store sets the store assigned PackageFamilyName You dont have

    12、to associate your app for testing! Call Package.Current.Id.FamilyName to return PFN to use in debugging,Debugging App Services,Set breakpoints in app service code Check Do not launch but debug my code when it starts in project properties Launch app service foreground app in debugger nothing happens!

    13、 Run client app to connect to app service Debugger attaches and breaks on your breakpoint,Demo: App Services,More considerations on App Services,App Service Lifetime,Service is activated on-demand Background Task activated by means of an AppServiceTrigger Client may terminate service by disposing it

    14、s AppServiceConnection You can build in capability for your service to shutdown through a message from a client If the invoking app is suspended, app services sponsored by the app will be terminated Insufficient resources may cause launch failure or service termination Invoking app will get AppServi

    15、ceConnectionStatus.ResourcesNotAvailable when connecting May get AppServiceResponseStatus.ResourceLimitsExceeded when sending message,What Protocol?,App Services are designed to be flexible and light-weight and are modelled on web REST Web services Simple Request-Response message API Data packaged a

    16、s string-keyed ValueSets Easy to use with multiple different payloads When you publish an App Service, you are defining a communications endpoint An App Service endpoint provides the Caller a way to send data to the Callee An App Service endpoint also provides the Caller a way to request return valu

    17、es from the Callee and for the Callee to respond with these return values.,App services provides another way for applications to communicate with each other,Nice to do: Implementing a Client SDK ,Wrap the low-level service communication implementation details inside a more functional set of methods

    18、Publish a client SDK for your service Distribute as a NuGet package or by other means,Can I restrict access to my App Service?,Build your own caller validation mechanisms on top of app services Simplest is for service provider to whitelist callers based on their PackageFamilyName PackageFamilyName o

    19、f caller is passed with every request Possible to build more complicated caller validation mechanisms on top of ValueSets once a connection has been established Whitelist could be followed by explicit X.509 certificate exchange,Versioning,Follow the Web REST API versioning model If you need to make

    20、a breaking change to an App Service endpoint, you must expose a new endpoint and provide backward compatibility with the old one,Demo: App Services client library,Final Thoughts,Its not just about XAML Windows App clients! See Calling an App Service from a WPF/WinForms Win32 App https:/ Arun at aruntalkstech,Review,What are App Services? App Services Scenarios App Services Client App Services Server Debugging Tips Debugging an App Service App Services Details App Service Lifetime Building a client API Controlling Access Versioning,


    注意事项

    本文(App ServicesDeveloper's Guide to Windows 10.ppt)为本站会员(twoload295)主动上传,麦多课文档分享仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知麦多课文档分享(点击联系客服),我们立即给予删除!




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

    copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
    备案/许可证编号:苏ICP备17064731号-1 

    收起
    展开