Xamarin.forms长期运行的后台工作 [英] Xamarin.forms long running background work

查看:681
本文介绍了Xamarin.forms长期运行的后台工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Xamarin平台的新手.我正在使用Xamarin.forms为所有三个主要平台(WP,iOS,Android)开发应用程序. 如何在后台与服务器同步数据->我需要类似于Android服务的内容.即使用户转到应用程序的其他屏幕,我也想同步数据.如果我可以在用户离开应用程序后继续同步数据,那就太好了.

谢谢

解决方案

这是我找到的唯一解决方案 http://arteksoftware.com/backgrounding-with-xamarin-forms/

几句话: 您无法在Xamarin.Forms中提取后台任务,因为iOS,Android和WP的工作方式不同.您必须使用MessagingCenter从每个平台的特定实现中发送和接收数据

I'm new to Xamarin platform. I'm developing an application for all three major platforms (WP,iOS,Android) using Xamarin.forms. How can I sync data with my server in the background -> I need something similar to Android Service. I want to sync the data even when the user goes to a different screen of the app. It would be great if I could continue syncing the data even when the user leaves the app.

Thank you

解决方案

This is the only solution i have found http://arteksoftware.com/backgrounding-with-xamarin-forms/

in a few words: You can't abstract background tasks in Xamarin.Forms because iOS, Android and WP works in a different way. You have to use MessagingCenter to send and receive data from specific implementations in each platform

这篇关于Xamarin.forms长期运行的后台工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆