Answered by:
Live Tile Update base on Periodic and Normal web Service

Question
-
Hi , I need to update the live tile periodically every 30 minutes. The data is from web service.
1) I use a WebClient to get the data from a server
2) when data return, I create a XML file with the Data. Say , the return data is: weather.
string strXML = " <tile> "
+ " <visual>"
+ "<binding template=" + "TileSquareText04" + ">"+"<text id=" + "1" + ">Weather </text>"
+ " </binding>"
+ " </visual>"
+ " </tile>"How and where to get the WebClient to start downloading?
How to I use the TileUpdater to update the tile base on the XML template above?
The above XML template is one of the 46 XML templates. Please kindly provide me a working sample.
Thanks
Monday, February 23, 2015 3:28 PM
Answers
-
Hi FireDance,
>>How and where to get the WebClient to start downloading?
Unfortunately, there is no WebClient class in runtime, I would suggest you using HttpClient class to sends HTTP requests and receive HTTP responses.
Check the official sample for details: https://code.msdn.microsoft.com/windowsapps/HttpClient-sample-55700664
I would recommend you to use a background task to update your app's live tile, please refer to this article about how to update a live tile from a background task: https://msdn.microsoft.com/en-us/library/windows/apps/xaml/jj991805.aspx?f=255&MSPPError=-2147217396
>>How to I use the TileUpdater to update the tile base on the XML template above?
The following document have detailed explanations about how to update tile using TileUpdater, in this article, you will learn how to pick a template for your tile and retrieve its XML contents: https://msdn.microsoft.com/en-us/library/windows/apps/hh465439.aspx
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- Edited by Franklin ChenMicrosoft employee, Moderator Tuesday, February 24, 2015 8:38 AM
- Proposed as answer by Franklin ChenMicrosoft employee, Moderator Monday, March 2, 2015 6:31 AM
- Marked as answer by Franklin ChenMicrosoft employee, Moderator Thursday, March 5, 2015 11:23 AM
Tuesday, February 24, 2015 8:34 AMModerator -
Hi,
How to setup say 30 minutes cycle downloading with Background task?
Thanks
Hi FireDance,
>>How to setup say 30 minutes cycle downloading with Background task?
You need to use a TimeTrigger, check this document for details: https://msdn.microsoft.com/en-us/library/windows/apps/jj160504.aspx
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- Proposed as answer by Franklin ChenMicrosoft employee, Moderator Monday, March 2, 2015 6:31 AM
- Marked as answer by Franklin ChenMicrosoft employee, Moderator Thursday, March 5, 2015 11:23 AM
Monday, March 2, 2015 6:31 AMModerator
All replies
-
Hi FireDance,
>>How and where to get the WebClient to start downloading?
Unfortunately, there is no WebClient class in runtime, I would suggest you using HttpClient class to sends HTTP requests and receive HTTP responses.
Check the official sample for details: https://code.msdn.microsoft.com/windowsapps/HttpClient-sample-55700664
I would recommend you to use a background task to update your app's live tile, please refer to this article about how to update a live tile from a background task: https://msdn.microsoft.com/en-us/library/windows/apps/xaml/jj991805.aspx?f=255&MSPPError=-2147217396
>>How to I use the TileUpdater to update the tile base on the XML template above?
The following document have detailed explanations about how to update tile using TileUpdater, in this article, you will learn how to pick a template for your tile and retrieve its XML contents: https://msdn.microsoft.com/en-us/library/windows/apps/hh465439.aspx
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- Edited by Franklin ChenMicrosoft employee, Moderator Tuesday, February 24, 2015 8:38 AM
- Proposed as answer by Franklin ChenMicrosoft employee, Moderator Monday, March 2, 2015 6:31 AM
- Marked as answer by Franklin ChenMicrosoft employee, Moderator Thursday, March 5, 2015 11:23 AM
Tuesday, February 24, 2015 8:34 AMModerator -
if your webservice is able to return the right formatted xml you can even configure this in the manifest of your app! otherwise you bneed a background task
Microsoft Certified Solutions Developer - Windows Store Apps Using C#
Tuesday, February 24, 2015 9:19 AM -
Hi,
How to setup say 30 minutes cycle downloading with Background task?
Thanks
Tuesday, February 24, 2015 12:43 PM -
Hi,
How to setup say 30 minutes cycle downloading with Background task?
Thanks
Hi FireDance,
>>How to setup say 30 minutes cycle downloading with Background task?
You need to use a TimeTrigger, check this document for details: https://msdn.microsoft.com/en-us/library/windows/apps/jj160504.aspx
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- Proposed as answer by Franklin ChenMicrosoft employee, Moderator Monday, March 2, 2015 6:31 AM
- Marked as answer by Franklin ChenMicrosoft employee, Moderator Thursday, March 5, 2015 11:23 AM
Monday, March 2, 2015 6:31 AMModerator