Sams Teach Yourself Windows® Phone 7 Application Development in 24 Hours

Total Page:16

File Type:pdf, Size:1020Kb

Sams Teach Yourself Windows® Phone 7 Application Development in 24 Hours Scott Dorman Kevin Wolf Nikita Polyakov Joe Healy SamsTeachYourself Windows® Phone 7 Application Development in Hours24 800 East 96th Street, Indianapolis, Indiana, 46240 USA Sams Teach Yourself Windows® Phone 7 Application Development Editor-in-Chief in 24 Hours Greg Wiegand Copyright © 2012 by Pearson Education Executive Editor All rights reserved. No part of this book shall be reproduced, stored in a retrieval system, or transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, without Neil Rowe written permission from the publisher. No patent liability is assumed with respect to the use of Acquisitions Editor the information contained herein. Although every precaution has been taken in the preparation of Brook Farling this book, the publisher and author assume no responsibility for errors or omissions. Nor is any liability assumed for damages resulting from the use of the information contained herein. Development ISBN-13: 978-0-672-33539-6 Editor ISBN-10: 0-672-33539-5 Mark Renfrow Library of Congress Cataloging-in-Publication Data Managing Editor Sams teach yourself Windows Phone 7 application development in 24 hours / Scott Dorman ... [et al.]. Kristy Hart p. cm. Project Editor Includes index. Betsy Harris ISBN-13: 978-0-672-33539-6 Copy Editor ISBN-10: 0-672-33539-5 Karen Annett 1. Windows phone (Computer file) 2. Application software—Development. 3. Smartphones— Programming. 4. Mobile computing. I. Dorman, Scott, 1973- II. Title: Windows Phone 7 applica- Senior Indexer tion development in 24hours. Cheryl Lenser QA76.76.A65S254 2012 Proofreader 004.16’7—dc23 Paula Lowell 2012007173 Printed in the United States of America Technical Editor First Printing April 2012 Richard Bailey Trademarks Publishing All terms mentioned in this book that are known to be trademarks or service marks have been Coordinator appropriately capitalized. Sams Publishing cannot attest to the accuracy of this information. Use Cindy Teeters of a term in this book should not be regarded as affecting the validity of any trademark or service mark. Book Designer Warning and Disclaimer Gary Adair Every effort has been made to make this book as complete and as accurate as possible, but no Senior Compositor warranty or fitness is implied. The information provided is on an “as is” basis. The authors and the publisher shall have neither liability nor responsibility to any person or entity with respect to Gloria Schurick any loss or damages arising from the information contained in this book. Bulk Sales Sams Publishing offers excellent discounts on this book when ordered in quantity for bulk pur- chases or special sales. For more information, please contact U.S. Corporate and Government Sales 1-800-382-3419 [email protected] For sales outside of the U.S., please contact International Sales [email protected] Contents at a Glance Part I: Fundamentals HOUR 1 Introducing Windows Phone 7 ......................................................1 2 Considerations for Desktop Developers ..........................................21 3 Choosing an Application Framework ............................................31 4 Learning Silverlight Basics ...........................................................45 5 Understanding Page-Based Navigation ..........................................73 6 Using the Sensors .......................................................................87 Part II: Developing Applications with Silverlight HOUR 7 Working with the GPS and the Bing Map Control .............................99 8 Developing Finger-Friendly Applications ......................................111 9 Consuming Web Data Services ...................................................129 10 Working with REST, Syndication Feeds, and OData ........................141 11 Integrating with Windows Phone Hubs ........................................159 12 Integrating with Microsoft Services ..............................................177 13 Performance and Debugging ......................................................191 14 Understanding Push Notification Services .....................................207 15 Understanding Live Tiles and Toast Notifications ...........................217 16 Working with Data ...................................................................231 Part III: Developing Games with the XNA Framework HOUR 17 Introduction to XNA Programming .............................................249 18 Building a Simple Game ............................................................263 19 Adding Polish to Your Game ......................................................281 iv Sams Teach Yourself Windows Phone 7 Application Development in 24 Hours Part IV: Diving Deeper HOUR 20 Internationalizing Your Application ............................................293 21 Working with Phone Internals ....................................................309 22 Being a Good Mobile Citizen ......................................................325 23 Distributing Applications with the Marketplace .............................343 24 Marketing and Selling Your Application .......................................359 Resources ................................................................................371 Index .....................................................................................373 Table of Contents Introduction xvii Audience and Organization ................................................................xviii Conventions Used In This Book ............................................................xix Closing Thoughts................................................................................xix Part I: Fundamentals HOUR 1: Introducing Windows Phone 7 1 Experiencing Life in Motion ....................................................................2 Ensuring a Common Foundation ............................................................3 Introducing the Application Platform ......................................................6 Introducing Metro................................................................................11 Summary ..........................................................................................18 Q&A..................................................................................................19 HOUR 2: Considerations for Desktop Developers 21 Understanding the Requirements............................................................21 Identifying Users and Their Mobile Needs ................................................22 Getting Data for Your Application ..........................................................25 Building the User Interface ....................................................................27 Summary ..........................................................................................29 Q&A..................................................................................................29 Workshop ..........................................................................................29 HOUR 3: Choosing an Application Framework 31 Introducing the Application Frameworks ................................................31 Understanding Silverlight......................................................................32 Understanding the XNA Framework........................................................37 vi Sams Teach Yourself Windows Phone 7 Application Development in 24 Hours Summary ..........................................................................................41 Q&A..................................................................................................42 Workshop ..........................................................................................43 Exercise ..............................................................................................43 HOUR 4: Learning Silverlight Basics 45 Understanding Silverlight......................................................................45 Silverlight Coding Fundamentals............................................................46 Exploring Silverlight Controls ................................................................49 Understanding Data Binding ................................................................62 Summary ..........................................................................................70 Q&A..................................................................................................70 HOUR 5: Understanding Page-Based Navigation 73 Introducing the Page Navigation Model ..................................................74 Using the Navigation Service ................................................................75 Working with Page Navigation Events ....................................................79 Passing Data with the Navigation Context ..............................................82 Summary ..........................................................................................83 Q&A..................................................................................................83 Workshop ..........................................................................................84 Exercise ..............................................................................................85 HOUR 6: Using the Sensors 87 Working with the Accelerometer ............................................................87 Using the Compass ..............................................................................91 Responding
Recommended publications
  • Of Mobile Devices: a Survey on Network Traffic Analysis
    1 The Dark Side(-Channel) of Mobile Devices: A Survey on Network Traffic Analysis Mauro Conti, Senior Member, IEEE, QianQian Li, Alberto Maragno, and Riccardo Spolaor*, Member, IEEE. Abstract—In recent years, mobile devices (e.g., smartphones elements enable both smartphones and tablets to have the and tablets) have met an increasing commercial success and same functionalities typically offered by laptops and desktop have become a fundamental element of the everyday life for computers. billions of people all around the world. Mobile devices are used not only for traditional communication activities (e.g., voice According to the statistics reported in [1], smartphone calls and messages) but also for more advanced tasks made users were 25:3% of the global population in 2015, and this possible by an enormous amount of multi-purpose applications percentage is expected to grow till 37% in 2020. Similarly, the (e.g., finance, gaming, and shopping). As a result, those devices statistics about tablets reported in [2] indicate a global penetra- generate a significant network traffic (a consistent part of the overall Internet traffic). For this reason, the research community tion of 13:8% in 2015, expected to reach 19:2% in 2020. The has been investigating security and privacy issues that are related driving forces of this tremendous success are the ubiquitous to the network traffic generated by mobile devices, which could Internet connectivity, thanks to the worldwide deployment of be analyzed to obtain information useful for a variety of goals cellular and Wi-Fi networks, and a large number of apps (ranging from fine-grained user profiling to device security and available in the official (and unofficial) marketplaces.
    [Show full text]
  • Best Practices in Mobile Application Testing
    Innovate, Digitize, Transform BEST PRACTICES IN MOBILE APPLICATION TESTING The basic frame of software testers’ mind-set is attuned to check documentation, functionality, stability, API and performance and make sure that the software application is secure from all vulnerabilities and check for any other related things surrounding the software piece of code. However, mobile application testing adds a different dimension to the traditional software testing in the sense that the testers have to think about the mobile functions based on usage patterns, heterogeneous devices available in the market with different screen sizes and form factors adds to the complexity of the mobile testing. This whitepaper talks about the best practices that exist at ACL Digital pertaining to mobile application testing focusing on mobile apps for iPhone, Android, Windows Phone and mobile web apps. These practices have evolved over a period of time with our experience in working with global top enterprises and ISVs that improved the testing activities and provided a quick turnaround time reducing the cycle time. Functional Testing Every new feature developed for a mobile device needs to be thoroughly tested. Functional testing is an important aspect when it comes to mobile app testing. Based on the developed test cases, mobile testers should do manual and automated testing. At the beginning of the test phase, a tester must test the mobile app manually using “black box” strategy to see if the functionality provided matches to customer expectations and work as designed. Besides traditional software testing defined in text books, like clicking a button, submitting a form, playing around with different screen elements, mobile testers must perform more functional and device-specific testing.
    [Show full text]
  • UI Design and Interaction Guide for Windows Phone 7
    UI Design and Interaction Guide 7 for Windows Phone 7 July 2010 Version 2.0 UI Design and Interaction Guide for Windows Phone 7 July 2010 Version 2.0 This is pre-release documentation and is subject to change in future releases. This document supports a preliminary release of a software product that may be changed substantially prior to final commercial release. This docu- ment is provided for informational purposes only and Microsoft makes no warranties, either express or implied, in this document. Information in this document, including URL and other Internet Web site references, is subject to change without notice. The entire risk of the use or the results from the use of this document remains with the user. Unless otherwise noted, the companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted in examples herein are fictitious. No association with any real company, organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation. Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this docu- ment. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property.
    [Show full text]
  • Use Your PC for Music
    WINDOWS® GUIDE Use Your PC for Music IN THIS GUIDE Rip and Burn CDs Page 2 Play Music Page 10 Connect an MP3 Player Page 14 Use a Music Service Page 17 What You’ll Need n Windows Media® Player—available as a free download n Recordable or rewritable audio or data CDs n A CD Burner n A Windows Media-enabled media device, such as a Windows Mobile® device or Zune® n A computer running Windows Vista® Windows Guides is a library of easy-to-use guides that show you how to get more from your Windows experience. Share these guides with your friends and family. © 2008 Microsoft. All rights reserved. WINDOWS GUIDE Use Your PC for Music Rip and Burn CDs Nowadays, most of us don’t just own a handful of albums. Music is a way of life. We want to be able to buy, organize and play songs on a whim, and take them with us wherever we go. Well, Windows Media Player takes the work out of building and maintaining a music library, so your only worry is what to listen to first. RIP A CD Ripping, or encoding, your impressive CD library into a digital one with Windows Media Player is quick and simple. There are two things to consider before ripping a CD: n By default, ripped songs are stored as Windows Media Audio (WMA) files. WMA is the best format to use for playing on Windows Media Player, but if for some reason you’d like to choose a different format: 1.
    [Show full text]
  • Taking the Metro with Windows Phone
    1 Taking the Metro with Windows Phone WHAT ’ S IN THIS CHAPTER ➤ How Windows Phone has changed Microsoft ’ s approach to the mobile industry ➤ What the Metro Design Language is and how it came about ➤ An overview of the Start and Lock Screens and how they help users access information on the phone ➤ Why the use of Hubs creates a more connected user experience ➤ What it means to be a Windows Phone developer Microsoft has been building mobile devices for well over 10 years, starting with a variety of Windows CE- based devices, such as the Handheld PC and the Palm- size PC, fi rst released in 1996. Beginning around 2000, these disparate operating systems began converging into what became Windows Mobile, based on the principle of delivering a PC to your pocket. New features were predominately driven by enterprise needs such as device management and security. This eventuallyCOPYRIGHTED worked to the detriment ofMATERIAL the platform as it didn’ t appeal to the average consumer. Devices were more robust than sexy, and the user interface mirrored that of the desktop, even having a Start menu, rather than providing an experience. Throughout this chapter, and in other parts of this book, there will be references to both Windows Mobile and Windows Phone . This is intentional, and they are not the same thing. Windows Mobile refers to the previous mobile operating system from Microsoft that at the time of writing is Windows Mobile 6.5.3. Windows Phone refers to Microsoft ’ s latest offering in the mobile space and starts with Windows Phone 7.
    [Show full text]
  • Why Software Firms Build Hardware – and What Microsoft Is Doing About It
    Why Software Firms Build Hardware – And What Microsoft Is Doing About It by Ryan M. Shaffer B.S. Electrical Engineering Grove City College, 2008 M.S. Computer Science Boston University, 2011 SUBMITTED TO THE SYSTEM DESIGN AND MANAGEMENT PROGRAM IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF SCIENCE IN ENGINEERING AND MANAGEMENT AT THE MASSACHUSETTS INSTITUTE OF TECHNOLOGY FEBRUARY 2015 © Ryan M. Shaffer. All rights reserved. The author hereby grants to MIT permission to reproduce and to distribute publicly paper and electronic copies of this thesis document in whole or in part in any medium now known or hereafter created. Signature of Author: _____________________________________________________ System Design and Management Program January 9, 2015 Certified by: ____________________________________________________________ Michael Cusumano Sloan Management Review Professor in Management Thesis Supervisor Accepted by: ___________________________________________________________ Patrick Hale Director, System Design and Management Fellows Program Why Software Firms Build Hardware – And What Microsoft Is Doing About It by Ryan M. Shaffer Submitted to the System Design and Management Program on January 9, 2015 in Partial Fulfillment of the Requirements for the Degree of Master of Science in Engineering and Management ABSTRACT Many software companies build first-party hardware products due to the trend toward smaller, more highly-integrated devices, along with the fast pace of innovation in the technology industry. Building hardware products does not always lead to success and actually creates a financial risk for the company by significantly reducing profit margins as compared to the traditional profit margins to which large software companies are accustomed. Three specific strategies are observed which firms have used successfully in this area.
    [Show full text]
  • Distimo Report
    REPORT June 2010 Apple App Store, BlackBerry App World, Google Android Market, Nokia Ovi Store, Palm App Catalog and Windows Marketplace New and noteworthy This report covers the Apple App Store for iPad, the Apple App Store for iPhone, BlackBerry App World (Worldwide), Google Android Market, Nokia Ovi Store, Palm App Catalog and Windows Marketplace for Mobile for May 2010 in the United States. The major findings are: » More than 50% of applications are priced below or equal to $2.00 in all stores, with the exception of BlackBerry App World and Windows Marketplace for Mobile. » The average price of all paid applications and the 100 most popular paid applications in the Apple App Store for iPad ($4.65) is higher than in the Apple App Store for iPhone ($4.01). However, the average price of the 100 top grossing applications is higher on the Apple App Store for iPhone. » Google Android Market has the largest share of free applications (57%) and Windows Marketplace for Mobile has the smallest (22%). » Twitter, Inc. published their native application in the Apple App Store and Google Android Market, becoming the monthly number 10 free application in the Apple App Store for iPhone, and the number 6 free application in Google Android Market. » Nine out of the ten most popular free applications and eight out of ten most popular paid applications in the Apple App Store for iPhone are games. » In the competitive e-reader market, both the iBooks application by Apple, Inc., and the Kindle application by Amazon.com are ranked among the 10 most popular free applications in the Apple App Store for iPad.
    [Show full text]
  • Microsoft Announces Windows Mobile 6.5 17 February 2009, by John Messina
    Microsoft Announces Windows Mobile 6.5 17 February 2009, by John Messina Internet Explorer Mobile browser. The free My Phone service enables users to access, manage and back up their personal information on their device to a password-protected Web-based service. This also makes it easier to upgrade your phone without losing important information. Windows Marketplace for Mobile is an integrated marketplace for searching, browsing and purchasing mobile applications from Windows phones. The new marketplace will be found on Windows phones that incorporate Windows Mobile 6.5. Developers have already built more than (PhysOrg.com) -- At the Mobile World Congress 20,000 applications for Windows phones and will 2009 in Barcelona, Microsoft officially revealed the offer applications to customers through the new Windows phones featuring new user-friendly marketplace via a simple security and compatibility software and services. The next generation of check from Microsoft. Windows phones will be based on Windows Mobile 6.5 and feature a new user interface and a richer The new Windows phones are expected to be browsing experience. available the second half of 2009. If you would like additional information, you can visit Microsoft In addition to the new Windows phones, Microsoft Mobile World Congress Web Page. will also be featuring two new services: My Phone, to sync text messages, photos, video and contacts © 2009 PhysOrg.com to the Web and Windows Marketplace for Mobile. Marketplace will provide direct-to-phone mobile applications that can be controlled from both the phone and the Web. Microsoft is currently working with partners across the industry to deliver a new generation of Windows phones that will provide consumers with information, and applications that will provide a greater end-to-end experiences at work or at home.
    [Show full text]
  • Microsoft—Kinect for Windows
    Microsoft—Xbox Live, Games for Windows Live, Zune, and Windows Phone Marketplace Consumer Demand for Arbitration before the American Arbitration Association AMERICAN ARBITRATION ASSOCIATION SUPPLEMENTARY PROCEDURES FOR CONSUMER-RELATED DISPUTES Instructions for filing an arbitration claim: 1. Please fill out this form and keep a copy for your records. 2. Mail two (2) copies of this form and your check or money order to the nearest American Arbitration Association Case Management Center. Please consult Section C-8 of the AAA Supplementary Procedures for Consumer-Related Disputes for the required fee. You can find the AAA rules, the nearest Case Management Center, and the fee at www.adr.org or by calling the AAA at (800) 778-7879. Please make your check or money order payable to the American Arbitration Association. 3. Mail a copy of this form and a copy of your check or money order to Microsoft Corporation, LCA Arbitration, One Microsoft Way, Redmond, WA 98052-6399. Upon receipt, Microsoft will reimburse you for your filing fee if your claim is for $75,000 or less. 4. Please include the attached copies of the Terms of Use for Xbox Live, Games for Windows Live, Zune, and Windows Phone Marketplace with each copy of this form you mail. Your Information: Name: Address: City/State/Zip: Phone: Fax: E-mail address: Gamertag Zune tag (if Zune at issue) Windows Live ID Disputes involving $10,000 or less are usually resolved by the submission of documents. If a hearing is held, it will usually be telephonic. In disputes involving more than $10,000, a telephonic or in-person hearing will be held.
    [Show full text]
  • Synology Diskstation User's Guide Based on DSM
    Synology NAS User's Guide Based on DSM 6.2 Document ID Syno_UsersGuide_NAS_20180104 Table of Contents Chapter 1: Introduction Chapter 2: Get Started with Synology DiskStation Manager Install Synology NAS and DSM ............................................................................................................................................. 8 Sign into DSM .......................................................................................................................................................................... 8 DiskStation Manager Desktop ............................................................................................................................................... 8 Open Applications and Packages with Main Menu .......................................................................................................... 11 Shutdown, Restart, Logout, or Manage Personal Settings ............................................................................................. 12 Chapter 3: Modify System Settings Use Control Panel ................................................................................................................................................................. 14 Change Network Settings .................................................................................................................................................... 15 Join Wireless Network .........................................................................................................................................................
    [Show full text]
  • Microsoft—Kinect for Windows
    Microsoft Software, Devices, and Services with Arbitration Agreements Consumer Demand for Arbitration before the American Arbitration Association Instructions for filing an arbitration claim with American Arbitration Association: 1. Please fill out this form and keep a copy for your records. 2. Mail a copy of this form and your check or money order for $200 to American Arbitration Association, Case Filing Services, 1101 Laurel Oak Road, Suite 100, Voorhees, NJ 08043. Make your check or money order payable to American Arbitration Association. Please consult the AAA Consumer Arbitration Rules for more information. You can find them at www.adr.org or by calling the AAA at (800) 778-7879. 3. Please copy (or download and print) and mail to AAA (with this form and your check) your agreement with an arbitration clause (for example, Microsoft Services Agreement, Xbox Live Terms of Use, Xbox One Limited Warranty, Microsoft Software License Agreement Windows 8, Nokia Limited Warranty, etc.). If you don’t have your agreement, you can find most at www.microsoft.com/about/legal/en/us/arbitration/default.aspx 4. Mail a copy of this form, a copy of your Microsoft agreement, and a copy of your check or money order to Microsoft Corporation, LCA Arbitration, One Microsoft Way, Redmond, WA 98052-6399. Upon receipt, Microsoft will reimburse you for your $200 filing fee if your claim is for $75,000 or less. Your Information: Name: Address: City/State/Zip: Phone: Fax: E-mail address: Gamertag (for Xbox) Zune tag (for Zune) Microsoft account (was Windows Live ID) Disputes involving $25,000 or less are usually resolved by the submission of documents.
    [Show full text]
  • Oo BELLSOUTH
    ACCEPTED Oo BELLSOUTH FOR BellSouth Telecommunications, Inc. Patrick W. Turner PROCESSING Legal Department General Counsehgth Capone 1600 Wilhams Street o Suite 5200 803 401 2900 Columbia, SC 29201 Fax 803 254 17~3 t Vl patrickturnertpbeilsouth.corn April 12, 20 t'A SION - 2021 May The Honorable Bruce Duke Executive Director 20 Public Service Commission of SC 2:00 Post Office Drawer 11649 Columbia, South Carolina 29211 PM - Re: Petition for Arbitration of US LEC of South Carolina Inc. Of an Amendment to SCPSC an Interconnection Agreement with BellSouth Telecommunications, Inc. Pursuant to Section 252(b) of the Communications Act of 1934, as Amended - 2004-78-C Petition of US LEC of South Carolina Inc. to Resolve Dispute with BellSouth Telecommunications, Inc. on Change of Law Provisions to the Interconnection Agreement Docket 2004-78-C - Page Dear Mr. Duke: Enclosed for filing are the original and fifteen 1 copies of BellSouth of Inc.'s Inc.'s Telecommunications, Response to US LEC of South Carolina Petition for 118 Arbitration in the above-referenced matter. By copy of this letter, I am serving this response on all parties of record as reflected by the attached Certificate of Service. Sincerely, 7jtttrml, Patrick W. Turner PWT/nml Enclosures cc: Parties of Record PC Docs ¹ 534736 ACCEPTED BEFORE FOR THE PUBLIC SERVICE COMMISSION OF D +QC J~ SOUTH CAROLINA PROCESSING In Re: ) ) Petition for Arbitration ofUS LEC of South Carolina Inc. ) o Of an Amendment to an Interconnection Agreement with ) O G Inc. Docket No 2004:78-Cm BellSouth Telecommunications, Pursuant to ) - 2021 Section 252(b) ofthe Communications Act of 1934, ) ', I! as Amended ) co ) May Petition of US LEC of South Carolina Inc.
    [Show full text]