0

I have an WP application that updates the Live Tile using the ScheduledTaskAgent (Background Tasks).

However, the ScheduledTaskAgent only updates the Live Tile once every 60 minutes or so.

Is there a way to update the Live Tile more frequently (so I can display a minute clock, stock quote, etc.)?

Thanks,

eitan barazani
  • 1,123
  • 3
  • 18
  • 34

2 Answers2

2

You can't run code that often, but you don't need to run code at the time to set a tile notification. There are several options.

The first option if you're on Windows Phone 8.1 or Windows is to use ScheduledTileNotification. This works great for predictable data like your clock scenario. You can schedule multiple tile notifications when the app runs. See How to schedule a tile notification for a walkthrough. For Windows Phone 8 the ShellTileSchedule class has a one hour minimum.

The second is to push notifications from off-system. This is good for changing network data like stock quotes or new email. Instead of polling from the device, the server that generates the data can send a tile notification to the Windows Notification Service which will then deliver it to the device. See Windows Push Notification Services (WNS) overview. For Windows Phone 8 see Sending push notifications for Windows Phone 8

Either of these will update more frequently than trying to set the tiles directly from code which can run only every 15 or 30 minutes.

Rob Caplan - MSFT
  • 21,714
  • 3
  • 32
  • 54
  • Hi Rob, Thanks for your input. In your first option, would that mean that if the condition for update changes and I don't need to update anymore, I would have to unschedule (RemoveFromSchedule) the events in the queue? The second option is not an option in my case (I don't have an off-system). Thx – eitan barazani Jan 17 '15 at 23:14
  • Yes. You can unscheduled the tile updates if and when your app determines the queued updates are no longer necessary. For quick, dynamic updates push notifications are the only option. You can use something like Azure Mobile Services if you don't already have your own service. – Rob Caplan - MSFT Jan 17 '15 at 23:25
1

nope, background task is fired every 30-60 minutes, or not at all, if user switch battery saver on for example

kober
  • 832
  • 7
  • 13
  • This is a short-coming on Microsoft I think. Though I see that for the OS they allow it (mail, etc.). Thx – eitan barazani Jan 17 '15 at 23:16
  • 1
    Mail, etc. are using the same push notification services that your app can use. Running constant background tasks would quickly run the batteries out. Pushing from off system is much more efficient than polling from on system. – Rob Caplan - MSFT Jan 17 '15 at 23:26