Live Time in Windows 8 - windows-8

There is an app in Windows Store called "The Time" which shows current time (every minute) on its Tile. The app can do this without registering any Background Task.
How can it do this?
UPDATE: it seems that it schedules lots and lots of tiles!
Because if you draw back the computer time, it will stop working.
However, I don't know how many tiles it schedules and how many tiles it is possible to schedule?

From the author himself:
Live tile updates may be scheduled
Applications may be given slices of time via the background task infrastructure
So, simply, when The Time’s background tasks are executed by the OS they queue up a number of live tile updates.

As far as I know this is not possible in Windows 8 - the background task for updating tiles can run every 15 minutes, but not more frequently.
Being productive in the background – background tasks

Related

What is the best way to do the long background task in Windows 8

I'm developing Windows Metro App and in my App I need to download some information(about 60Mb, every time) from server in background. Download should occur regularly, for example every 8 hours. So I tried to use Background Task, but there are some CPU and network quotas(https://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh977051.aspx), and I can't do this. Could somebody help me with advice in this problem?
Instead of attempting to do the entire transfer in the background task itself, have the background task start a background transfer, which runs independent of the task and independent of the app as well. See the topic, Transferring Data in the Background, https://msdn.microsoft.com/en-us/library/windows/apps/hh452979.aspx. You can run the background task periodically according to the schedule you need, and it will easily stay under CPU and networking quotas because the background transfer doesn't count against that.

How to cancel a background task in windows 8.1 using javascript

I am building a windows 8 metro app using javascript and html5. I want to know following things.
How can I cancel the current instance of any running background task.
What are the possible conditions when system automatically cancels background task.
JavaScript background tasks are executed in web workers, so just use close() within running background task to end it when ever you want. If you want to do this from your app code, check out following MSDN sample: http://msdn.microsoft.com/en-us/library/windows/apps/jj160500.aspx.
There are many conditions when system may cancel your task, but that depends how you registered it (is it lock screen task etc). In normal conditions each background tasks has 1s CPU quota and 7.5 MB daily data quota. You can read more about it here: http://msdn.microsoft.com/en-us/library/windows/apps/hh977046.aspx

WinRT Clear Clipboard background task

My app gives users the ability to clear a their clipboard after a certain time in seconds after copying some secure text. The problem is, if the app suspends, the clipboard never clears. I've looked at using a background task but I can't find a trigger that suits my needs.
Any advice?
A background task is your best bet, but you have limited options. Ideally you would use a 15 minute timer, but you must be added to the lock screen and I suspect not many users would do that. The 2 hour timer might be your next best option.
A maintenance trigger would be a good option (as that is every 15 minutes and doesn't need to be on the lock screen), but it does require the device to not be on battery power.

Can a WinRT background task be long-lived if within CPU and Network limits?

Microsoft's documentation states:
Background tasks are meant to be short-lived tasks that do not consume a lot of resources.
It also says:
Each app on the lock screen receives 2 seconds of CPU time every 15 minutes, which can be used by all of the background tasks of the app. At the end of 15 minutes, each app on the lock screen receives another 2 seconds of CPU time for use by its background tasks.
I need to run a background task every two minutes to update my live-tile.
My app is a lock-screen-app.
Computation is within the CPU and network usage constraints
Can I create a permanent background task (e.g. something which polls a web service and pulls information, waits and loops) to create a OneShot TimeTrigger every two minutes or is there a better way of doing this?
My concern with the background task option is whether the runtime would deem the task inactive while it was sleeping and close it or something else like there's a limit on the number of times a live tile can be updated within 15 minutes...
Yes, if by long lived you mean under 25 minutes.
Time triggers cannot execute more frequent than 15 minutes. Creating a OneShot trigger that executes in 2 minutes is, that's an interesting idea and should work. Yes, background tasks can register other background tasks to keep this chain going. Should the user's machine be off when it execs it will queue later.
Having said that, updating your tile that frequently & using a background task is not a wise solution. Because, it is unreliable. Background tasks can be disabled, for one. But every 15 minutes, you are going to exceed your quota. Try using a Scheduled tile instead.

Synchronizing scores and achievements from Game Center to device?

Just wondering on how frequently I should sync data from Game Center to the device? The first time the app is run, every time the app is run or once every x number of days?
I am trying to ensure that a user has the same achievements and high scores if he/she gets a new phone or deletes the app and re-installs it.
Any insight would be great!
If you want to guarantee the latest data, then you should try to update the data every time the app is run.
If your sync process is scheduled to run in the background, you can even sync every time the data changes in addition to every time the app is launched.
If you are syncing just the deltas this should not be very expensive to do
my two cents ;)