locked
Background tasks

    Question

  • Can we create background tasks in c++ metro apps that are triggered on timer without placing the app on Lock Screen?

    Is the 15 minute time interval for time triggered background tasks standard?

    Can't we set less than 15 minutes  as interval for the background task?

    Sunday, September 09, 2012 5:00 PM

Answers

  • No, You cannot set less than 15 minutes.
    If FreshnessTime is set to less than 15 minutes, an exception is thrown when attempting to register the background task.

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by Jesse Jiang Monday, September 24, 2012 9:01 AM
    Monday, September 10, 2012 7:10 AM

All replies

  • No, You cannot set less than 15 minutes.
    If FreshnessTime is set to less than 15 minutes, an exception is thrown when attempting to register the background task.

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by Jesse Jiang Monday, September 24, 2012 9:01 AM
    Monday, September 10, 2012 7:10 AM
  • I'm looking for a way to update my application's Tile every minute in the background.

    I'm not sure how to do this given this 15 minute limitation (it also seems to be any time up to 15 minutes, not exactly 15 minutes according to the docs). I've seen a clock app in the Windows 8 store that seems to do this (updates the time every minute) but I'm not sure how they did it.

    I've also had issues getting my background task to run. I set a breakpoint in the Run method and it was never hit. I need to read up more on how to debug these background tasks.

    Update: I've found how to schedule my tasks in the background, using MaintenanceTask type of background task. This allows me to schedule a number of tile updates to cover until the next time the background task is run. My problem is now, the background task does not run when on battery mode (by design). How do I work around this? It's working how I want when on power, but I can find no way to run my background task without pinning it to the lock screen and using a Timer type of background task instead.

    cheers,

    Stephen


    Thursday, September 13, 2012 11:01 PM