I have been developing a windows store app, where I need something like
- Periodically call a function that performs a http request and returns the response string
- Update the Live tile with the returned string
- These should happen only when the app is suspended/navigated away to start screen or something
(I have written the function to perform and return http request)
I referred to this link but I do not know where to put those code in my program. Should I create a Background task separately?
You don’t need to set up a background task. Simply make a call to
StartPeriodicUpdateduring your app initialization (perhaps after all of your UI has loaded). Windows will then continually update the tile on behalf of your app using the provided interval.