Connecting to External Services

The MyTasks app cannot even get off the ground unless it can connect to Live Connect and Windows Azure Mobile Services. If the MyTasks app cannot authenticate you with Live Connect and get your tasks from Azure Mobile Services then the app has nothing useful to do. So the very first thing that the MyTasks app does is to connect to these services.

Listing 16.1 contains the startup code that is responsible for connecting to Live Connect and Azure.

LISTING 16.1 MyTasks Startup Code (/js/default.js)

// The startup method ensures that you are// connected to Live and Azure before// doing anything else.function startup() {    return new WinJS.Promise(function (complete) {        function ...

Get Windows® 8.1 Apps with HTML5 and JavaScript Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.