Search code examples
windows-8live-tile

In windows 8 metro style app, how to update live tile while app is not running?


In windows 8 metro style app, how to update live tile while app is not running ?

And the live tile start to run when OS system begin to start.

http://blogs.msdn.com/b/windowsappdev/archive/2012/04/16/creating-a-great-tile-experience-part-1.aspx

"3.Use polling notifications from the cloud to update the tile while the app is not running"

But I cannot find any example code.

I also try MSDN's PushNotificationSample, But I don't know how to set the "Server URI"?

Does anyone have similar experiences?


Solution

  • Okay, let's get you answered! Here is every single way and resources for each way to get you started. Your scenario isn't clear to me, so I will try to be generic.

    There are four ways to update a live tile in Windows 8! And this is true for the primary app tile and the subsequent secondary tiles created by the app, too.

    1> The first is that the app, while running, can update the tile

    But, you were asking how to update when it is not running:

    2> A user can deploy a background task with their Windows 8 app. This background task executes periodically and can update the tile of the app during its execution. The minimum frequency of background tasks is 15 minutes. Windows 8 allocates 1 CPU second every two hours to a task. Your task can execute as often as you want until you exhaust its allocation.

    3> An app can open a WNS (Windows Notification Services) channel while it is running. When it is not running, a web service can push tile updates across WNS.

    4> A tile can be configured to pull from a URL. The XML from that URL is periodically evaluated for deltas and the tile is refreshed when detected. Tiles expire by default after three days.

    Point of clarification: you can't cause something like a tile update when the OS is booted. For one, in Windows 8 the idea of rebooting (or at least shutting down) is practically deprecated. But your Store app can only execute in the ways above - and can't do something like the StartUp folder (in the past) or RegEdit/Run (in the past) just the stuff above. But maintenance or timer triggers get you pretty close.

    And, that's the answer. Best of luck, dude!