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

2

6

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?

Fachanan answered 23/7, 2012 at 6:58 Comment(1)
I wonder if you would want to mark the answer?Lothaire
L
15

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!

Lothaire answered 16/10, 2012 at 15:15 Comment(0)
O
1

Try background tasks @ http://code.msdn.microsoft.com/windowsapps/Background-Task-Sample-9209ade9

Olivo answered 6/9, 2012 at 20:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.