Home > Store

Essential Windows Phone 8, 2nd Edition

Register your product to gain access to bonus material or receive a coupon.

Essential Windows Phone 8, 2nd Edition


  • Sorry, this book is no longer in print.
Not for Sale


  • Copyright 2013
  • Dimensions: 7" x 9-1/8"
  • Pages: 624
  • Edition: 2nd
  • Book
  • ISBN-10: 0-321-90494-X
  • ISBN-13: 978-0-321-90494-2

“Shawn has created a guide that is easy to read, up-to-date, and comprehensive–covering the entire application surface area for Windows Phone developers. Enjoy!”
–Jeff Wilcox, Senior Software Development Engineer, Microsoft

Essential Windows® Phone 8 is the definitive guide to creating powerful mobile apps with Microsoft’s dramatically improved Windows Phone 8 platform. Ten-time Microsoft MVP Shawn Wildermuth draws on his extensive experience teaching Windows Phone development, helping you to get started fast and master techniques that lead to truly outstanding solutions.

Updated throughout, this edition reflects new APIs and development best practices, ranging from new WinRT APIs to voice integration. It also contains a comprehensive new chapter on developing enterprise solutions for business.

After introducing the platform and its key improvements, Shawn dives directly into the essentials. Using realistic code, he illustrates today’s best techniques for delivering robust, well-performing apps. You’ll build a complete app from start to finish and then deepen your skills with increasingly sophisticated techniques.

From planning through delivery, Shawn guides you through the entire lifecycle, helping you make the most of Windows Phone 8’s valuable capabilities. Whether you’re a Windows developer going mobile or a mobile developer moving to Windows Phone, here are all the skills you’ll need.

Coverage includes

  • Setting up the WP8 development environment, including the emulator
  • Using XAML to fully control the look and feel of your app’s interface
  • Providing robust user interactivity through controls
  • Creating mobile experiences built around the real needs of Windows Phone users
  • Localizing your app for native languages and global markets
  • Utilizing vibration, motion, sound, the camera, or other hardware features
  • Supporting voice commands such as “Call Mom” or “Open Twitter”
  • Integrating features that use Contacts, Appointments, Alarms, the media library and hubs, and the lock screen
  • Storing data in simple files, caches, or a full-fledged database
  • Multitasking in the background without compromising performance
  • Implementing location-aware apps that can track where users are
  • Retrieving external data and assets via REST, Web services, push notifications, or Windows Live
  • Preparing your application for the Windows Phone Store
  • Building and distributing enterprise apps for your company’s internal customers

Sample Content

Online Sample Chapter

Writing Your First Windows Phone 8 Application

Sample Pages

Download the sample pages (includes Chapter 2 and Index)

Table of Contents

1  Introducing Windows Phone     1

A Different Kind of Phone     1

Phone Specifications     7

   Input Patterns     10

   Designing for Touch     11

   Hardware Buttons     12

   Keyboards     12

   Sensors     15

Application Lifecycle     15

Driving Your Development with Services     17

Live Tiles     18

The Windows Phone Store     19

   Distributing Your Application Through the Windows Phone Store     20

   App Hub Submissions     20

   Application Policies     22

   Content Policies     25

Where Are We?     26

2  Writing Your First Phone Application     27

Preparing Your Machine     27

Creating a New Project     29

   Visual Studio     29

   XAML     34

Designing with Blend     39

Adding Code     48

   Working with Events     51

   Debugging in the Emulator     52

   Debugging with a Device     53

   Using Touch     58

Working with the Phone     61

Where Are We?     66

3  XAML Overview     67

What Is XAML?     67

XAML Object Properties     69

   Understanding XAML Namespaces     70

Naming in XAML     71

Visual Containers     72

Visual Grammar     77

   Shapes     77

   Brushes     79

   Colors     80

   Text     81

Images     82

Transformations and Animations     84

   Transformations     84

   Animations     87

XAML Styling     90

   Understanding Resources     91

   Understanding Styles     93

Where Are We?     96

4  Controls     97

Controls in XAML     97

   Simple Controls     100

   Content Controls     106

   List Controls     107

Phone-Specific Controls     108

   Panorama Control     108

   Pivot Control     112

Data Binding     115

   Simple Data Binding     115

   Using a DataTemplate     117

   Improving Scrolling Performance     118

   Binding Formatting     120

   Element Binding     121

   Converters     121

   Data Binding Errors     123

   Control Templates     125

Windows Phone Toolkit     130

   AutoCompleteBox Control     131

   ContextMenu Control     133

   DatePicker and TimePicker Controls     135

   ListPicker Control     137

   LongListSelector Control     140

   PerformanceProgressBar Control     144

   ToggleSwitch Control     145

   ExpanderView Control     146

   PhoneTextBox Control     147

   CustomMessageBox     149

   WrapPanel Layout Container     153

Where Are We?     156

5  Designing for the Phone     157

The Third Screen     157

   It Is a Phone, Right?     160

Deciding on an Application Paradigm     162

   Panorama     164

   Pivot     166

   Simple Pages     169

Microsoft Expression Blend     169

   Creating a Project     170

   A Tour Around Blend     171

Blend Basics     180

   Layout     180

   Brushes     186

   Creating Animations     191

   Working with Behaviors     196

Phone-Specific Design     199

   The ApplicationBar in Blend     199

   Using the Panorama Control in Blend     203

   Using the Pivot Control in Blend     206

Previewing Applications     209

Designing with Visual Studio     210

Implementing the Look and Feel of the Phone     212

Where Are We?     215

6  Developing for the Phone     217

Application Lifecycle     217

   Navigation     220

   Tombstoning     227

The Phone Experience     233

   Orientation     233

   Designing for Touch     236

   Application Client Area     245

   Application Bar     247

   Understanding Idle Detection     249

   The Tilt Effect     250

Localizing Your Phone Application     252

Where Are We?     258

7  Phone Hardware     261

Using Vibration     261

Using Motion     262

   Emulating Motion     266

Using Sound     268

   Playing Sound with MediaElement     269

   Using XNA Libraries     270

   Playing Sounds with XNA     270

   Adjusting Playback     271

   Recording Sounds     272

Working with the Camera     275

   Using the PhotoCamera Class     276

   Raw Hardware Access     281

   Camera Lens App     284

The Clipboard API     286

Location APIs     287

   Location Permission     287

   Accessing Location Information     289

   Turning Coordinates into Addresses     294

   Emulating Location Information     295

Voice Commands     299

Speech Recognition     306

Speech Synthesis     310

Bluetooth and VOIP     316

Where Are We?     316

8  Phone Integration     317

Contacts and Appointments     317

   Contacts     318

   Appointments    323

Alarms and Reminders     324

   Creating an Alarm     327

   Creating a Reminder     328

   Accessing Existing Notifications     329

Using Tasks     330

   Launchers     333

   Choosers     344

Media and Picture Hubs     355

   Accessing Music     355

   Playing Music     359

   Accessing Pictures     360

   Storing Pictures     363

   Integrating into the Pictures Hub     364

   Integrating into the Music and Videos Hub     367

Live Tiles     371

   Main Live Tile     375

   Secondary Tiles     377

Other Ways of Launching Your App     380

   Using a Custom Protocol     380

   Using a File Association     384

Where Are We?     387

9  Databases and Storage     389

Storing Data     389

Storage     390

   Serialization     395

Local Databases     401

   Getting Started     402

   Optimizing the Context Class     408

   Associations     412

   Using an Existing Database     418

   Schema Updates     420

   Database Security     422

Where Are We?     423

10  Multitasking     425

Multitasking     425

Background Agents     426

   Periodic Agent     428

   Resource-Intensive Agent     436

   Audio Agent     439

Location-Aware Apps     448

Background Transfer Service     452

    Requirements and Limitations     453

   Requesting Transfers     454

   Monitoring Requests     456

Where Are We?     461

 11  Services     463

The Network Stack     464

   The WebClient Class     464

   Accessing Network Information     467

Consuming JavaScript Object Notation     470

   Using JSON Serialization     472

   Parsing JSON     473

Web Services     477

Consuming OData     482

   How OData Works     483

   The URI     484

   Using OData on the Phone     492

   Generating a Service Reference for OData     492

   Retrieving Data     493

   Updating Data     496

Using Push Notifications     497

   Push Notification Requirements     499

   Preparing the Application for Push Notifications     499

   Setting Up the Server for Push Notifications     501

   Raw Notifications     504

   Sending Toast Notifications     516

   Creating Live Tiles     519

   Handling Push Notification Errors     522

Where Are We?     524

12  Making Money     525

What Is the Store?     525

   How It Works     527

   Charging for Apps     529

   Getting Paid     531

Submitting Your App     533

   Preparing Your Application     533

   The Submission Process     538

   After the Submission     545

Modifying Your Application     548

Dealing with Failed Submissions     548

Using Ads in Your Apps     551

Where Are We?     552

13 Enterprise Phone Apps     553

Enterprise Apps?     553

Registering Your Company     554

Buying a Symantec Code-Signing Certificate     556

Installing the Certificate     558

Application Enrollment Token     563

Registering Phones     564

Preparing Apps for Distribution     566

Building a Company Hub     567

Where Are We?     571

Index     573


Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information

To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.


Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.


If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information

Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.


This site is not directed to children under the age of 13.


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information

If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information

Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents

California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure

Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact

Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice

We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020