23.01.2018 Views

MICROSOFT_PRESS_EBOOK_PROGRAMMING_WINDOWS_8_APPS_WITH_HTML_CSS_AND_JAVASCRIPT_PDF

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

What We’ve Just Learned<br />

• Networks come in a number of different forms, and separate capabilities in the manifest<br />

specifically call out Internet (Client), Internet (Client & Server), and Private Networks (Client &<br />

Server). Local loopback within these is normally blocked for apps but may be used for<br />

debugging purposes on machines with a developer license.<br />

• Rich network information is available through the Windows.Networking.Connectivity.-<br />

NetworkInformation API, including the ability to track connectivity, be aware of network costs,<br />

and obtain connection profile details.<br />

• Connectivity can be monitored from a background task by using the networkStateChange trigger<br />

and conditions such as internetAvailable and internetNotAvailable.<br />

• The ability to run offline can be an important consideration that can make an app much more<br />

attractive to customers. Apps need to design and implement such features themselves, using<br />

local or temporary app data folders to store the necessary caches.<br />

• Windows.Networking.BackgroundTransfer provides for cost-aware downloads and up-loads that<br />

continue to run while an app is suspended and that are easy to resume if an app is restarted after<br />

termination. Using this API is highly recommended over doing the same with XmlHttpRequests;<br />

the API supports credentials, multipart uploads, cost policy, and grouping.<br />

• The Credential Picker UI provides a built-in UI for collecting credentials, and the credential locker<br />

provides a secure means for storing and retrieving those credentials (that can also be roamed to<br />

the user’s other trusted devices if they allow it).<br />

• Apps can authenticate through OAuth providers using the web authentication broker API. This<br />

allows apps to obtain necessary access keys and tokens to work with those providers while never<br />

having to manage user credentials directly.<br />

• For authentication providers that support it, apps can use single sign on so that authenticating<br />

the user in one app will authenticate them in all others using the same provider. The Live<br />

SDK/Live Connect provides for this with the user’s Microsoft account.<br />

• Apps can obtain and manage some of the user’s profile data, including the user image and the<br />

lock screen image.<br />

• WinRT provides APIs for encryption and decryption, along with certificates.<br />

• The Windows.Web.Syndication API provides a structured way to consume RSS feeds, and<br />

Windows.Web.AtomPub provides a structured way to post, edit, and manage entries.<br />

• Socket support in WinRT includes datagram and stream sockets, as well as message and stream<br />

WebSockets. The capabilities of the latter expand on the capabilities of W3C WebSockets by<br />

supporting both a streaming (TCP) model and binary content.<br />

689

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!