Windows Phone 7 Programming for Android and iOS Developers

Windows Phone 7 Programming for Android and iOS Developers

4.0 1
by Zhinan Zhou

Learn to develop for the new Windows Phone 7 platform

With a special focused placed on the new Windows Phone 7 (WP7) design guidelines and technologies, this reference helps you extend your knowledge so that you can learn to develop for the new WP7 platform. The team of authors presents topic-by-topic comparisons between WP7 and Android and the iPhone,

…  See more details below


Learn to develop for the new Windows Phone 7 platform

With a special focused placed on the new Windows Phone 7 (WP7) design guidelines and technologies, this reference helps you extend your knowledge so that you can learn to develop for the new WP7 platform. The team of authors presents topic-by-topic comparisons between WP7 and Android and the iPhone, enabling you to learn the differences and similarities between them. This indispensible coverage prepares you for making the transition from programming for Android and the iPhone to programming for the exciting new WP7.

  • Covers the exciting new technology of Windows Phone 7 (WP7) and serves as ideal reference for Android and iPhone developers who are eager to get started programming for the WP7

  • Zeroes in on the differences between programming for Android and the iPhone, making it much easier for you to learn and practice

  • Offers various real-world programming scenarios to enhance your comprehension

  • Demonstrates how to set up your development environment, create the User Interface, use local data storage, leverage location and maps, and use system services

  • Discusses how to handle security issues

Start programming for the WP7 today with this book by your side.

Read More

Product Details

Publication date:
Product dimensions:
7.40(w) x 9.20(h) x 0.80(d)

Read an Excerpt

Windows Phone 7 Programming for Android and iOS Developers

By Zhinan Zhou Robert Zhu Pei Zheng Baijian Yang

John Wiley & Sons

Copyright © 2011 John Wiley & Sons, Ltd
All right reserved.

ISBN: 978-1-1180-2197-2

Chapter One

What's New in Windows Phone 7


* An architectural overview of WP7

* Comparisons with iOS and Android

Mobile application developers will find it useful to have an architectural understanding of the underlying Windows Phone 7 (WP7) software platform. In particular, developers need to understand the application framework, its capabilities and limitations, and platform extensibility. It's also important to know potential technical approaches to common development tasks. For Android or iPhone app developers, it's vital to obtain a big picture of the new WP7 operating system.

The first chapter of this book provides an overview of the new WP7 operating system, the history of Windows Mobile, the WP7 hardware platform (also known as the chassis specification), the new Windows Compact Edition (CE) kernel, the application framework, the application store, and WP7 capabilities and limitations. Readers who aren't familiar with Windows phone technologies will see examples that use Android or iPhone technologies. It's important to understand the overall design philosophy of WP7 and its potential impact on the competition.

The chapter will outline a roadmap of Microsoft's Windows Phone offerings in the next 12-18 months. The chapter also compares the three major mobile platforms from different perspectives:

* Underlying operating system origins: MacOS, Linux, or Windows CE

* Application frameworks: Xcode on iPhone, Java on Android framework, or Silverlight and Xbox/DirectX New generation Architecture (XNA) on the WP7 app framework

* App store process: iPhone App Store, Android Market, or Windows Marketplace


This section will present an overview of WP7, including a brief introduction to Windows Mobile history, the design rationale of WP7 and its system architecture, as well as the new application framework and application store.

A Brief History

Microsoft's mobile operating system originated with the Pocket PC 2000 release in 2000, which was targeting Personal Digital Assistant (PDA) devices without any cellular capability. It was built on top of the Windows CE 3.0 kernel and supported multiple processor architectures, including Acorn RISC Machine (ARM), where RISC stands for Reduced Instruction Set Computer, Microprocessor without Interlocked Pipeline Stages (MIPS), and x86. The rationale was to provide scaled-down desktop experience on a mobile form factor, with a stylus mimicking the computer mouse interface, and a resistive touch screen that reacts to stylus tapping.

In 2003, Microsoft released Windows Mobile 2003 and Windows Mobile 2003 Second Edition that started to offer phone capability. This release also offered strong enterprise-oriented features such as Pocket Outlook, Virtual Private Network (VPN) support, and ActiveSync.

Then a major upgrade, Windows Mobile 5, was released in 2005. Windows Mobile 5 allowed developers to write managed applications that ran on top of the .NET Compact Framework. It also provided a Direct Push technology where Microsoft Exchange e-mails can be pushed to the Pocket Outlook client on the device as they arrive. The GUI was essentially similar to the previous releases.

Windows Mobile 6 and Windows Mobile 6.1 were released in 2007 and 2008. Both are built on top of Windows CE 5.2. The focus was still on providing a rich set of features rather than a compelling user interface (UI).

With all the Windows Mobile releases until Windows Mobile 6.1, Microsoft managed to build a strong mobile product line, targeting enterprise professionals. Its major competitor was Research in Motion (RIM). Microsoft's development efforts turned out to be quite a success from 2006 to early 2007. During this time, Windows Mobile took over 20 percent of the smartphone market and shipped 12 million devices.

The iPhone arrived in June 2007. iPhone's "Touching is believing" user experience was undoubtedly a tremendous innovation compared to any other smartphone on the market at that time. The unique multi-touch, finger-friendly user interface changed the public's opinion that smartphones were designed for professionals; as a result the smartphone market grew rapidly in the following years.

Initially Microsoft didn't realize the mobile market was undergoing a major overhaul. It failed to react quickly to accommodate the dramatic growth of the smartphone market driven by explosive adoption of the iPhone among average consumers. In 2007 and 2008, Microsoft worked on Windows Mobile 7, which for the most part resembled Windows Mobile 6 from a user interface perspective but with multi-touch support. In the interim, Microsoft released Windows Mobile 6.5, which provided a minor update with finger-friendly tiles and menus. Unsurprisingly, it failed to impress the market.

Google entered mobile space with Android in 2008, and has enjoyed rapid growth since then, partly because Microsoft has failed to release a major update for about three years (since Windows Mobile 6.1). Google has formed the Open Handset Alliance (OHA) with major handset makers, silicon vendors, and mobile operators to create the Android open platform. As Microsoft struggled to build Windows Mobile 7, handset makers turned to Google Android.

Feeling the pressure from Apple and Google, Microsoft has shuffled its mobile business division, reset the Windows Mobile 7 effort, and started WP7 from scratch. WP7 sports a new tile interface, Marketplace application store, Silverlight- and XNA-based application framework, and Xbox LIVE and Zune integration. The effort has finally paid off. WP7 was launched in Europe, Singapore, and Australia in October 2010, and in the U.S. and Canada in November 2010. Microsoft shipped 1.5 million WP7 devices in the first six weeks. It's still too early to project WP7's future in terms of market share. Nonetheless, WP7 is unique in many ways compared to iOS and Android, and thus offers another choice for smartphone users. Microsoft continues to invest in mobile technology and keeps improving Windows Phone. It'll be quite interesting to see the competition among the three major mobile operating systems for the next few years.

The Big Ideas

WP7 is the outcome of Microsoft's new mobile strategy, which is to shift from enterprise-oriented mobile product design to consumer-focused design. As Andy Lees, Microsoft's president of the mobile and embedded division, put it in an interview:

We made a very big decision to re-examine everything, because the industries surrounding mobile are at an inflection point. ... The technological advances over the past few years enable us to do bold new things we've never done before. But the most important thing is that we are bringing it all together with an almost maniacal focus on the consumer.

The following list describes the overall goals that Microsoft tried to achieve when developing WP7:

* Consumer Focused: Microsoft reviewed its competitors' offerings in order to understand what the consumer wants in terms of mobile user experience. For example, consumers want to touch the screen using their fingers, rather than using a stylus. Therefore, the developer must create a graphical user interface (GUI) that's finger-friendly, with enlarged actionable components that support tapping (briefly using a finger to touch the surface), dragging (pressing and holding an item, and moving it on the surface), flicking (briefly brushing the surface), pinching (pressing and holding, using two fingers and moving them closer), spreading (pressing and holding, using two fingers and moving them apart), and so on. In addition, WP7 applications can enable unique user experiences such as Panorama and Pivots, which are discussed in Chapter 4. Another example of consumer-focused design is the seamless integration with Microsoft's other computing assets, such as Zune media service, Xbox LIVE , Office Live, and Bing search service. This integration makes it possible for consumers to enjoy these services across different screens on different devices.

* Life in Motion: The rationale behind the WP7 user experience is "life in motion," where the phone keeps pace with events happening in people's life in a well-integrated, effortless way. For example, live tiles on the Home screen show real-time updates of the user's contacts, calendars, games, messages, and phone calls. A quick glance gives the user all the needed information without the user's touching anything. And if the user touches any of those tiles, WP7 displays a hub screen where events of the selected type are aggregated into a single view from various applications, web services, and other sources.

* Consistent experience: The Windows Phone user experience is consistent across applications and services on assorted devices. Any third-party hardware or software innovations must be in line with the unified model to avoid fragmentation.

* Hardware: Microsoft and its partners defined a set of specifications where all WP7 devices rely on a few chipsets. The reason these chipsets are so important is that Qualcomm and Microsoft have performed all the major work on the Board Support Packages (BSPs), which are driver and hardware configurations. During the Windows Mobile era, original equipment manufacturers (OEMs) had the opportunity to choose any chipset. Supporting all the chipset variants with Windows Mobile was a big challenge for Microsoft. Now, with the unique chassis specifications, a large part of the device BSPs are provided for OEMs — they only need to select some peripherals and create drivers for them. The unified hardware design is actually good for developers; there is no need to consider different CPU speeds, memory capacity, and screen sizes. They are the same on all WP7 devices.

* Software: All applications are either Silverlight- or XNA-based, leveraging the same set of .NET Framework APIs. All third-party applications must pass the Marketplace certification before the user can install them on a device.

System Architecture

The WP7 OS is based on a variant of Microsoft Embedded OS, Windows CE 6 (also known as Windows Embedded CE 6), while the Windows Mobile 6.x variants are all based on Windows CE 5. Generally, Windows CE provides a 32-bit kernel that is designed for embedded devices, and a set of system services such as memory management, networking and connection management, I/O, and graphics. On the other hand, the Windows Phone OS is built on top of the CE kernel with added specific system services and an application framework for mobile phones.

The major differences between CE 6 and CE 5 are listed below:

* Process address space is increased from 32MB to 2GB. On Windows CE 5, every process can occupy 32MB of address space. Windows CE 6 increases process storage to 2GB.

* The number of processes has been increased from 32 to 32K (32,768). This is important to application developers. On Windows Mobile 6.x, only 32 processes can be active at the same time. If a user wants to launch another process, the system will reject it. WP7 eliminates the 32-process limitation.

* User mode and kernel mode device drivers are possible.

* device.exe, filesys.exe, and GWES.exe have been moved to Kernel mode, to improve device performance.

Overall, the operating system in WP7 devices is more secure and stable, and offers better performance.

Figure 1-1 illustrates the WP7 OS architecture. As shown in the figure, the operating system contains three layers (from bottom to top): hardware, kernel space, and user space. All .NET Framework applications run in the user space. The OS kernel, drivers, and system services execute in kernel space. Compared to the architecture of Windows Mobile 6.5, on which you can execute both native and managed applications, WP7 OS enforces managed application development only. Furthermore, managed applications can use only the features provided by Silverlight, XNA, and Phone APIs; nothing else is accessible from within applications.

Application Framework

Mobile application developers are mainly concerned with changes to the application framework. When targeting Windows Mobile 6.x, developers can use either native Win32 APIs to write C/C++ code or C# and Visual Basic .NET to write managed code. The managed code runs on top of the .NET Compact Framework. On WP7, however, all applications are managed applications, and Microsoft provides two application frameworks: Silverlight and XNA, as shown in Figure 1-2 (source: Microsoft suggests using Silverlight for developing event-based applications and XNA for game development.


Excerpted from Windows Phone 7 Programming for Android and iOS Developers by Zhinan Zhou Robert Zhu Pei Zheng Baijian Yang Copyright © 2011 by John Wiley & Sons, Ltd. Excerpted by permission of John Wiley & Sons. All rights reserved. No part of this excerpt may be reproduced or reprinted without permission in writing from the publisher.
Excerpts are provided by Dial-A-Book Inc. solely for the personal use of visitors to this web site.

Read More

Meet the Author

Dr. Zhinan Zhou is Senior Software Engineer with Samsung Telecommunications America.

Robert Zhu is Principal Development Lead with Microsoft, developing Microsoft mobile products.

Dr. Pei Zheng is Senior Software Architect with Sony Ericsson.

Dr. Baijian Yang is an associate professor at Ball State University and teaches mobile computing courses.

Customer Reviews

Average Review:

Write a Review

and post it to your social network


Most Helpful Customer Reviews

See all customer reviews >

Windows Phone 7 Programming for Android and iOS Developers 4 out of 5 based on 0 ratings. 1 reviews.
rmattos More than 1 year ago
This is an excellent join effort from fours authors, all experts on mobile development field. But that does not make this book easy to use if you are new into this area and trying to develop your fist application ever for a smartphone. I have developed an application for iOS named "Bible Names", using a book called "iPhone Application Development for Dummies" from the "for Dummies" series. What I think this book is missing is more examples going deeper into details of the code for many scenarios. I personally like to code by example, but that is just my style. But the comparison between Android and iOS and WP7 is really interesting and presented in a very academic way. The book goes over what is new in Windows Phone 7 (WP7), the development environment, fundamentals, user interfaces, application data storage, WEB services and push notifications, leveraging location and maps, graphics, multimedia and much more, but always at a high level, showing some snippets of code, never going into details that would be so useful for a novice, although they never claimed the book was for novices, and that is way I give the book a four star out of five. Overall it is a very useful book, that I recommend if you have some experience developing applications for Android or iOS platforms and want to start playing with WP7 platform. This book was written by Zhinan Zhou, Robert Zhu, Pei Zheng and Baijian Yang and was Published by John Wiley & Sons, Inc on August of 2011.