Microsoft shows how Metro style app developers the different types of activities that an app can do when it's in the background and show some code examples to that support these scenarios.
In short, in the first part of the two part series, Hari Pulapaka, Program Manager, Windows, discuss how to play audio in the background and perform uploads or downloads in the background while your app is suspended. All this to ensure apps are being productive in the background and using minimal battery power.
"We designed the Windows 8 app lifecycle for maximum battery life. But that doesn't mean the app model precludes background activities. To design the background model of Windows 8, we identified the typical scenarios you want an app in the background to perform and added APIs that accomplish this power efficiently," said Pulapaka.
"Windows 8 provides you with the ability to create background tasks. These background tasks run in response to external triggers (like time or system events or incoming push notification) and have resource constraints imposed on them to make it easy to perform background activity in a power-friendly manner. The most common examples of apps that use them are email, VoIP, and IM apps. These apps can sync your data, in the background while on battery, or in Connected Standby mode," Pulapaka explains.
"Apps can use the background transfer API to upload and download data in the background. The OS itself performs the upload or download here, which takes the app code out of the picture, and helps maximize battery life. After an app starts a background download operation, even if it gets suspended, these download operations continue in the background. The next time your app is resumed, you will receive the progress and completion callbacks of these download operations," explains Pulapaka.
"If the app was terminated after being suspended, enumerating your download operations will restart previously queued background download operations."
The easiest method to play audio in an app is through the HTML5 <audio> element.
"A Windows 8 Metro style app is full screen, which means that if a user of your app is listening to music in the background, there is no quick way to stop the music without registering for the transport controls. The system transport controls appear on-screen, if the app has registered for them and the user presses one of the hardware volume buttons," he concludes.
For more info about how to add media transport controls to your Metro style app, see System Transport Controls Developer Guide.
In other Windows 8 news,
Microsoft tweeted that 32-bit versions of Windows 8 will support 16-bit apps natively. And, that the 64-bit architecture will not include the subsystem, for a variety of reasons.
Microsoft said, "... you can run 16 bit apps on 32 bit Windows 8. 64 bit doesn't include the subsystem at all for a variety of reasons."
@Joakim_Ziegler you can run 16 bit apps on 32 bit Windows 8.64 bit doesn't include the subsystem at all for a variety of reasons.-- Building Windows 8 (@BuildWindows8) May 15, 2012
Windows 8 is expected to launch with three major architectures, 32-bit, 64-bit and ARM.16-bit support will be baked right into the 32-bit kernel system. The reason, Microsoft has been trying to move people away from old kernels like 16-bit since Windows 95, so including support for the architecture is probably not helping.
Only a handful of devices that run Windows RT, the version of Windows 8, will be available when Windows 8 launches later this year.
"Chipmakers Nvidia, Qualcomm, and Texas Instruments will initially get two "slots" each for devices, according to sources familiar with Microsoft's plans. "ARM is restricted to two designs each, meaning six total initial designs," one source said, referring to the chip design from U.K.-based ARM that those three suppliers use. On the other hand, Intel is expected to have more than a dozen Windows 8 designs," reports News.com.
The report claims, via unnamed sources that NVIDIA is the furthest along with its Windows RT plans, with one source claiming that its chip may be used in Windows RT products sold by Asus and Lenovo. Those designs could be a tablet, a hybrid tablet-laptop, or a more conventional clamshell laptop design.
Nvidia is "working with two manufacturers" a second source said, who is familiar with Nvidia's plans.
The story also claims that a one of Qualcomm's slots had been slated for a Hewlett-Packard tablet. However, that product may not be released until 2013. However, Nokia's Windows 8 tablet could have a Qualcomm chip inside, according to the source.
By contrast, Intel is expected to have many Windows 8-based tablet devices, using the regular x86 version of Windows 8, available for sale this year. The latest rumors claim that the first Intel-based Windows 8 tablets could go on sale in November.
Texas Instruments has also announced plans to offer an ARM-based processor that can run Windows RT. However, there's no word on which PC makers will sign up to use a TI chip.