Pranit Kothari
Pranit Kothari

Reputation: 9859

How to manage multiple tasks and background services?

Background agents for Windows Phone

An application may have only one background agent. This agent can be registered as a PeriodicTask, a ResourceIntensiveTask, or both. The schedule on which the agent runs depends on which type of task it is registered as. The details of the schedules are described later in this topic. Only one instance of the agent runs at a time.

What if I want many tasks simultaneous done in WP8 like, getting data from database and getting location information?

Secondly, if there can be only one background process possible, then why ScheduledActionService have Add() method.

I tried to add multiple projects of Windows Phone Scheduled Task Agent it gives following error.

Error 2 The Project References contain two or more background agents of the same type 'ScheduledTaskAgent'. projectName

How will I run parallel task simultaneously.

Upvotes: 0

Views: 1177

Answers (1)

Igor Kulman
Igor Kulman

Reputation: 16359

It depends on when you want the concurrent task to be run. If you want everything to run while you app is running, then you do no need any background task at all.

If you want all the task to run while you app is not running, just use one background agent and use it to do all the task.

Upvotes: 1

Related Questions