Tomasz
Tomasz

Reputation: 99

Windows Phone 8 - task on alarm

I've written a code that reads qr/barcode on demand. However I need background agent to run this piece of code/app while system alarm rings. I haven't been able to think how to do it.

Upvotes: 0

Views: 471

Answers (1)

Sad Al Abdullah
Sad Al Abdullah

Reputation: 379

You can't launch the program from background agent. You can update Live Tiles or show Shell toast or do little background task from background agent.

Windows phone 8 have two types agent- 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%. 

For more please read Agent

Upvotes: 2

Related Questions