Foreword

You're riding the train to work in the morning. You're onboard an airplane that's taxiing to the gate following the flight attendant's announcement that cell phones and other electronic devices can be turned back on. You're sitting in a coffee shop enjoying a morning brew. And what are people all around you doing? They're checking their e-mail, surfing the web, reading the news, and checking the latest weather report—all on their iPhones, Android phones, Blackberrys, Windows phones, and other devices that just a few short years ago wouldn't have fit in a suitcase, much less a purse or pants pocket.

The smartphone phenomenon is no less a revolution in the way we live, work, and play than the personal-computer revolution was in the early 1980s. And it represents no less of an opportunity to developers, to whom it falls to write the applications that drive these devices. In coming years, companies will be built and millionaires will be made by savvy developers who successfully anticipate the needs of the market and possess the technical chops to meet those needs. Developers everywhere realize that mobile is where the action is. Moreover, the excitement around mobile devices in the development community is as palpable today as it was around personal computers in the heyday of the IBM PC.

The latest contestant to enter the mobile arena and scrap for market share is the new Windows Phone, powered by Windows Phone 7.1, also known as “Mango.” No one refutes that Microsoft was late to the party. But so was Google with its Android operating system, and Android sales now outstrip iPhone sales by a comfortable margin. The market is huge, and there's plenty of room under the tent. Microsoft has put a stake in the ground with Mango and has big plans for the Windows Phone for 2014 and beyond.

What is it that makes Mango a compelling platform for developers? For starters, if you're already a C# programmer, you'll feel right at home with Mango, using a familiar language, familiar tools, and even a familiar API. If you're a Silverlight developer, you're way ahead of the game because you already know XAML, and learning to write Windows Phone apps is largely a matter of learning about phone-specific APIs such as the location API and sensor API. But even if you're not already versed in XAML and the .NET framework, you'll find Windows Phone Mango as easy a platform to learn as any you've ever picked up. It's managed code all the way, supported by an elegant set of APIs that were designed from the ground up to enable types of applications, which just a few years ago we could only dream about.

Mango improves on Windows Phone 7.0 in numerous ways. For example, in 7.0, applications that weren't in the foreground were almost always terminated, causing app developers to have to save state prior to deactivation and restore it again following reactivation. Mango turns that model upside-down, ensuring that in most cases, suspended apps are just that—suspended—and therefore can be resumed very quickly. This is mostly transparent to the developer, but there are implications to this architecture that affect the design of your apps. You still need to preserve state in case you're terminated, but upon activation, you can detect whether you were terminated and avoid the potentially costly process of restoring that state when it doesn't need restoring.

Mango also introduces a new set of APIs for accessing compasses, gyroscopes, and other sensors. It provides low-level access to the phone's built-in camera and adds support for front-facing cameras as well. It introduces a brand-new API for background processing, and it features a local database based on SQL CE that's perfect for storing relational data in flash memory on the phone, as well as an encryption API that enables data to be stored securely. It also adds HTML5 support to the platform, making Mango an equally viable target for cross-platform mobile development as iPhones, Android phones, and Blackberry devices. The list of new features could go on and on, but suffice it to say that I know developers on the Windows Phone team at Microsoft who told me even before 7.0 came out “just wait until you see Mango. It's awesome.” They were right. And there's no better time than the present to see for yourself by downloading the SDK and checking out the new and improved Windows Phone.

I can't think of anyone better to guide you on the path to Windows Phone enlightenment than Jesse Liberty and Jeff Blankenburg. Both work for Microsoft and have “ins” to the phone team that the rest of us can only dream about. Both have been involved with the Windows Phone operating system since the beginning. And both have a passion for this platform that comes through in their blog posts, their speaking engagements, and, of course, in their books.

They've put together a step-by-step guide to building Windows Phone applications not only for developers already at home with the Microsoft technology stack, but for iPhone and Android developers as well. You'll learn about the application lifecycle and what it means for your code. You'll learn how to use push notifications to deliver timely informational updates and convert static tiles into live tiles. You'll learn about launchers and choosers and the role they play in building great mobile applications. In short, you'll get a working introduction to the core features and services that Mango has to offer, as well as to the tools that you use to leverage them—all in an edgy and humorous style that's in keeping with the hipness of the mobile market. Angry Birds, after all, wasn't written by a bunch of guys wearing coats and ties.

PCs are out. Mobile is in. You can either ride on top of the wave or get crushed by it. Let the revolution begin.

— Jeff Prosise

Cofounder, Wintellect

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset