Periodic Task

Periodic agents run for a small amount of time on a regular recurring interval. Typical scenarios for this type of task include uploading the device’s location and performing small amounts of data synchronization.

ResourceIntensive Task

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. A typical scenario for this type of task is synchronizing large amounts of data to the phone while it is not being actively used by the user.

Life cycle

The code for the agent is implemented by the application in a class that inherits from BackgroundAgent.

When the agent is launched, the operating system calls OnInvoke(ScheduledTask). In this method, the application can determine which type of ScheduledTask it is being run as, and perform the appropriate actions.

When the agent has completed its task, it should call NotifyComplete() or Abort() to let the operating system know that it has completed. NotifyComplete should be used if the task was successful. If the agent is unable to perform its task – such as a needed server being unavailable - the agent should call Abort, which causes the IsScheduledproperty to be set to false.

The foreground application can check this property when it is running to determine whether Abort was called.

1. WMAppmanifest.xml configuration

2. App.xaml.cs, App_Launching/App_Closing

3. Reference to Schedule Agent project

4. Write code in .cs file

Background agent的更多相关文章

  1. 例子:Background Agent Sample

    通过本例程学习: 后台代理Agent的使用方法 定期代理(PeriodicTask)来说,限制了: 有一些API不能使用,并不是说你不调用就可以了,只要你在同一个程序集里使用了这些API,就不会通过验 ...

  2. Windows phone应用开发[17]-xap提交异常处理

    在windows phone 应用提交操作上早在2011年时就写过一篇Windows phone 应用开发[4]-应用发布,那时wp应用提交官方市场的流程繁杂[超过了5步].因为上传和填写应用信息页面 ...

  3. wp8 入门到精通 WebClient Post

    WebClient wc = new WebClient(); var URI = new Uri("http://your_uri_goes_here"); //If any e ...

  4. Windows Phone 8 - Runtime Location API - 2

    原文:Windows Phone 8 - Runtime Location API - 2 在<Windows Phone 8 - Runtime Location API - 1>介绍基 ...

  5. Windows Phone 8 - Runtime Location API - 1

    原文:Windows Phone 8 - Runtime Location API - 1 在Windows Phone里要做Background Service的方式,除了Background Ag ...

  6. 【RDA】使用RDA(Remote Diagnostic Agent)工具对数据库进行健康检查

    [RDA]使用RDA(Remote Diagnostic Agent)工具对数据库进行健康检查 分类: Linux RDA英文全称叫做"Oracle Remote Diagnostic Ag ...

  7. 例子:Background Audio Streamer Sample

    The Background Audio Streamer sample demonstrates how to create an app that uses a MediaStreamSource ...

  8. 浏览器默认样式(user agent stylesheet)+cssreset

    每种浏览器都有一套默认的样式表,即user agent stylesheet,在写网页时,没有指定的样式,按浏览器内置的样式表来渲染.这是合理的,像word中也有一些预留样式,可以让我们的排版更美观整 ...

  9. Cloudinsight Agent install script

    #!/bin/bash # Cloudinsight Agent install script. set -e logfile="ci-agent-install.log" gis ...

随机推荐

  1. javascript 获取url参数值

    function getvl(name) { var reg = new RegExp("(^|\\?|&)"+ name +"=([^&]*)(\\s| ...

  2. 聊聊传统oo和js的某些对比——对象/函数/new关键字等

    自己的学习记录,写的短点可以以后短时间内理清一些疑惑,看前要求你至少了解js中关于原型链等基本概念,因为文章直接以总结的形式理出知识点,没有去解释一些基本的概念! 1.1.熟记两句话,预预热 1. 函 ...

  3. MOS X 下Apache服务器配置,及日志读取

    A01-配置Apache 在当前用户的目录创建一个文件夹 打开finder进入/etc/apache2/etc/apache2 是系统目录,默认不显示 进入该目录有两种方法 i. 显示所有隐藏和系统目 ...

  4. Java学习笔记(三)——运算符

    一.运算符: 1.分类: 2.java中的运算符 (1)其中,++在左,表示先加了再用,++在右,表示先用了再加. (2)% 用来求余数,也称为"取模运算符" 3.赋值运算符 4. ...

  5. Linux学习笔记(15)shell基础之Bash基本功能

    1 shell概述 shell是一个命令解释器,为用户提供了一个向Linux内核发送请求以便运行程序的界面系统级程序.用户可以用shell启动.挂起.停止甚至是编写一些程序. shell是一个功能强大 ...

  6. Redis持久化实践及灾难恢复模拟

    参考资料: Redis Persistence http://redis.io/topics/persistence Google Groups https://groups.google.com/f ...

  7. 【POI word】使用POI实现对Word的读取以及生成

    项目结构如下: 那第一部分:先是读取Word文档 package com.it.WordTest; import java.io.FileInputStream; import java.io.Fil ...

  8. Git的安装与使用

    1,下载git https://code.google.com/p/msysgit/downloads/list 2,安装git ,我们选择命令行形式,这样无论在window下还是在linux下 都可 ...

  9. LoadRunner常用事务判断

    一.数据值比较 lr_start_transaction("终审") if (atoi(lr_eval_string("{MyOutputParm}"))==a ...

  10. Adobe Flash Media Server安装

    Flash Media Server(FMS)是一个流媒体服务器 使用 实时消息传送协议(RTMP),RTMP是一种未加密的TCP/IP协议,专门设计用来高速传送音频.视频和数据信息. 3.5版32位 ...