修改电话联系人的回调 [英] Callback for phone contacts modification

查看:85
本文介绍了修改电话联系人的回调的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

WP8是否具有任何操作系统挂钩或回调(同步机制),我可以实现这些功能来在联系人更改时获取通知?

Does WP8 have any OS hook or callback (sync mechanism) I can implement to get a notification when a contact changes?

例如,我正在运行一个应用程序作为后台座席,用户可以随机更改联系人的详细信息。我想在后台引擎中得到通知,以便执行各种操作。

For example I'm running an application as a background agent, and a user randomly changes a contact's details. I want to get notified in my background engine so that I can do various operations.

我总是可以进行定期检查(例如,每分钟我阅读所有联系人并检查查看是否有任何修改-假设我以某种方式记得上一个配置)。但是此解决方案对于大量联系人而言效率不高,尤其是当我希望应用程序在低端电话上运行时。

I could always implement a periodic check (say every minute I read all contacts and check to see if there are any modifications - assuming I'm remembering the last configuration somehow). But this solution is not efficient for a large number of contacts, especially when I want the application to run on the low end phones.

推荐答案

Windows Phone不支持任何内置的方式来通知应用程序联系人的更改。

Windows Phone does not support any built in way for applications to be notified of contact changes.

您已经注意到,唯一的方法是跟踪细节并定期查找差异。是的,如果要支持具有一个256MB内存的WP7设备,则必须在运行应用程序(而不是后台代理)的情况下执行此操作。

As you've noted, the only way to do this would be to track the details and periodically look for differences. Yes, you'd have to do this with the app running (rather than a background agent) if you want to support WP7 devices with one 256MB of memory.

另一种方法,并假设用户正在将其联系人与live.Windows帐户同步,则可以创建一个定期轮询其实时帐户的外部服务(通过 http://msdn.microsoft.com/en-us/live/ff519582.aspx )进行更改,然后将有关更改的通知发送给设备/应用

As an alternative and assuming that the user is syncing their contacts with their live.Windows account you could create an external service that periodically polls their live account (via http://msdn.microsoft.com/en-us/live/ff519582.aspx) for changes and then send a notification to the device/app regarding the change.

这篇关于修改电话联系人的回调的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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