Windows Phone 8 - 报警任务

时间:2012-11-30 10:34:44

标签: windows-phone-8

我编写了一个按需读取qr /条形码的代码。但是,当系统警报响起时,我需要后台代理来运行这段代码/应用程序。我一直无法思考如何去做。

1 个答案:

答案 0 :(得分:2)

您无法从后台代理启动该程序。您可以更新Live Tiles或显示Shell Toast或从后台代理执行一些后台任务。

Windows Phone 8有两种类型代理 - 1)PeriodicTask& 2)ResourceIntensiveTask

PeriodicTask: Periodic agents run for a small amount of time on a regular recurring interval.Periodic agents typically run every 30 minutes. To optimize battery life, periodic agents may be run in alignment with other background processes and therefore the execution time may drift by up to 10 minutes.Periodic agents typically run for 25 seconds. There are other constraints that may cause an agent to be terminated early. 

ResourceIntensiveTask: Resource-intensive agents run for a relatively long period of time when the phone meets a set of requirements relating to processor activity, power source, and network connection. Resource-intensive agents typically run for 10 minutes. There are other constraints that may cause an agent to be terminated early.Resource-intensive agents do not run unless the device has a network connection over Wi-Fi or through a connection to a PC.Resource-intensive agents do not run unless the device’s battery power is greater than 90%. 

有关详情,请阅读Agent

相关问题