windows phone 7 developer guide

337 418 0
windows phone 7 developer guide

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

• • • • • • • • • • • • • • • • • • • • • • • • • • WINDOWS ® PHONE 7 DEVELOPER GUIDE WINDOWS ® PHONE 7 DEVELOPER GUIDE For more information explore: msdn.microsoft.com/practices Software Architecture U.S.A. $29.99 [Recommended] patterns & practices Proven practices for predictable results Save time and reduce risk on your software development projects by incorporating patterns & practices, Microsoft’s applied engineering guidance that includes both production quality source code and documentation. The guidance is designed to help software development teams: Make critical design and technology selection decisions by highlighting the appropriate solution architectures, technologies, and Microsoft products for common scenarios Understand the most important concepts needed for success by explaining the relevant patterns and prescribing the important practices Get started with a proven code base by providing thoroughly tested software and source that embodies Microsoft’s recommendations The patterns & practices team consists of experienced architects, developers, writers, and testers. We work openly with the developer community and industry experts, on every project, to ensure that some of the best minds in the industry have contributed to and reviewed the guidance as it is being developed. We also love our role as the bridge between the real world needs of our customers and the wide range of products and technologies that Microsoft provides. Windows ® Phone 7 provides an exciting new opportunity for companies and developers to build applications that travel with users, are interactive and attractive, and are available whenever and wherever users want to work with them. By combining Windows Phone 7 applications with remote services and applications that run in the cloud (such as those using the Windows Azure™ technology platform), developers can create highly scalable, reliable, and powerful applications that extend the functionality beyond the tradi- tional desktop or laptop; and into a truly portable and much more accessible environment. This guide describes a scenario around a fi ctitious company named Tailspin that has decided to include Windows Phone 7 as a client device for their existing cloud-based application. Their Windows Azure-based application named Surveys is described in detail in a previous book in this series, Devel- oping Applications for the Cloud. After reading this book, you will be familiar with how to design and imple- ment applications for Windows Phone 7 that take advantage of remote services to obtain and upload data while providing a great user experience on the device. W I N D O W S ® P H O N E 7 D E V E L O P E R G U I D E Building connected mobile applications with Microsoft Silverlight ® Dominic Betts Federico Boerr Scott Densmore Jose Gallardo Salazar Alex Homer Introducing Windows Phone 7 Overview, features, terminology Designing Applications for Windows Phone 7 Planning, application life cycle, performance, UI design, storage, connectivity Building the Mobile Client Designing the UI, form factors, MVVM, navigation Using Services on the Phone Data storage and manipulation, synchronization, capturing pictures, sound and location Interacting with Windows Marketplace Distribution, packaging, restrictions, content policies The Tailspin Scenerio The “case study”: motivations, constraints, goals Appendices Development and testing practices Device capabilities XNA versus Silverlight Prism and Snyc Framework www.it-ebooks.info  ®     Do w n lo a d f r o m W o w! e Bo o k < w w w. w o we b o ok . c om > www.it-ebooks.info www.it-ebooks.info Windows ® Phone 7 Developer Guide Building connected mobile applications with Microsoft Silverlight ® Dominic Betts Federico Boerr Scott Densmore Jose Gallardo Salazar Alex Homer www.it-ebooks.info ISBN: 978-0-7356-5609-3 Information in this document is subject to change without notice. The names of companies, products, people, characters, and/or data mentioned herein are fictitious and are in no way intended to represent any real individual, company, product, or event, unless otherwise noted. Complying with all applicable copyright laws is the responsibility of the user. No part of this document may be reproduced or transmit- ted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of Microsoft Corporation. If, however, your only means of access is electronic, permission to print one copy is hereby granted. Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. 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, copy- rights, or other intellectual property. © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Azure, Windows Live, Windows Vista, ActiveSync, Bing, Direct3D, DirectX, Excel, Expression Blend, Internet Explorer, MSDN, SharePoint, Silverlight, SQL Azure, Visual Basic, Visual C++, Visual C#, Visual Studio, Xbox, Xbox 360, XNA, and Zune are registered trademarks or trademarks of Microsoft Corporation in the United States and other countries. Other product and company names herein may be trademarks of their respective owners. Do w n lo a d f r o m W o w! e Bo o k < w w w. w o we b o ok . c om > www.it-ebooks.info Contents  xiii Charlie Kindel  xv Istvan Cseri  xvii Who This Book Is For xviii Why This Book Is Pertinent Now xviii How This Book Is Structured xix The Example Application xxi What You Need to Use the Code xxi Who’s Who xxii Where to Go for More Information xxiiii  xxv 1 Introducing Windows Phone 7  A Standardized Platform  Data-driven Applications  Developing for the Windows Phone 7 Platform  Resources for Developers  Resources for Silverlight Developers  Resources for XNA-Based Application Developers  Resources for Web and Service Developers  Terminology  More Information  Blogs, Code Samples, Training Kits, and Windows Marketplace  www.it-ebooks.info 2 Designing Applications for Windows Phone 7 Basic Design Considerations  Type of Application  Design and Implementation  Resource Management  Remote Services  Mobile Phone Client Applications  Suitable Application Types for Mobile Phones  Silverlight and Windows Phone 7  Design Considerations for Windows Phone 7 Applications  User Interface Design and Style Guidelines  Application Deactivation and Tombstoning  User Input Considerations  Storage Considerations  Connectivity Considerations  Security Considerations  Data Formats and Accessing Remote Services  Data Format and Synchronization Considerations  Microsoft Data and Synchronization Technologies for Windows Phone 7  Resource Management and Performance  Minimize Device Resource Usage  Apply Good Practice Programming Techniques  Optimize Memory Usage  Maximize GPU Usage  Availability of Components and Frameworks  Questions  3 The Tailspin Scenario  The Tailspin Company  Tailspin’s Strategy  Tailspin’s Goals and Concerns  The Surveys Application Architecture  The Actors  Tailspin - the ISV  Fabrikam and Adatum - the Subscribers  The Surveyors - Windows Phone 7 Users  The Business Model  The Application Components  www.it-ebooks.info 4 Building the Mobile Client  Overview of the Mobile Client Application  Goals and Requirements  Usability Goals  Non-Functional Goals  Development Process Goals  The Components of the Mobile Client Application  The Structure of the Tailspin Surveys client Application  Dependency Injection  The Contents of the TailSpin.PhoneClient Project  The Design of the User Interface  Navigation  User Interface Description  User Interface Elements  The Pivot Control  The Panorama Control  Styling and Control Templates  Context Menus  Using the Model-View-ViewModel Pattern  The Premise  Overview of MVVM  Benefits of MVVM  Connecting the View and the View Model  Inside the Implementation  Testing the Application  Inside the Implementation  Displaying Data  Inside the Implementation  Commands  Inside the Implementation  Handling Navigation Requests  Inside the Implementation  User Interface Notifications  Informational/Warning Notifications  Error Notifications  Inside the Implementation  Accessing Services  Questions  More Information  www.it-ebooks.info 5 Using Services on the Phone  The Model Classes  Using Isolated Storage on the Phone  Overview of the Solution  Security  Storage Format  Inside the Implementation  Application Settings  Survey Data  Handling Activation and Deactivation  Overview of the Solution  Inside the Implementation  Reactivation and the Panorama Control  Handling Asynchronous Interactions  Using Reactive Extensions  Inside the Implementation  Synchronizing Data between the Phone and the Cloud  Overview of the Solution  Limitations of the Current Approach  Inside the Implementation  The getNewSurveys Task  The saveSurveyAnswersTask  Using Location Services on the Phone  Overview of the Solution  Inside the Implementation  Acquiring Image and Audio Data on the Phone  Overview of the Solution  Capturing Image Data  Recording Audio Data  Inside the Implementation  Using a Chooser to Capture Image Data  Using XNA Interop to Record Audio  Logging Errors and Diagnostic Information on the Phone  Conclusion  Questions  More Information  Do w n lo a d f r o m W o w! e Bo o k < w w w. w o we b o ok . c om > www.it-ebooks.info 6 Connecting with Services  Installing the Mobile Client Application  Overview of the Solution  Inside the Implementation  Authenticating with the Surveys Service  Goals and Requirements  Overview of the Solution  A Future Claims-Based Approach  Inside the Implementation  Notifying the Mobile Client of New Surveys  Overview of the Solution  Inside the Implementation  Registering for Notifications  Sending Notifications  Notification Payloads  Accessing Data in the Cloud  Goals and Requirements  Overview of the Solution  Exposing the Data in the Cloud  Data Formats  Consuming the Data  Using SSL  Inside the Implementation  Creating a WCF REST Service in the Cloud  Consuming the Data in the Windows Phone 7 Client Application  Filtering Data  Overview of the Solution  Registering User Preferences  Identifying Which Devices to Notify  Selecting Surveys to Synchronize  Inside the Implementation  Storing Filter Data  Building a List of Devices to Receive Notifications  Building a List of Surveys to Synchronize with the Mobile Client  Summary  Questions  More Information  www.it-ebooks.info [...]... Using the Windows Phone Connect Tool Developing Windows Phone 7 Applications Developing Trial Applications for Windows Phone 7 Testing Trial Versions in an Emulator or Device Developing Web Applications for Windows Phone 7 Debugging Windows Phone 7 Applications Unit Testing Windows Phone 7 Applications Automated Unit Testing Additional Tools and Frameworks b silverlight and xna in windows phone 7 Basic... Application for Windows Phone on MSDN (http://msdn microsoft.com/en-us/library/ff402526(VS.92).aspx) A series of videos that describe development of Windows Phone 7 applications, for both Silverlight and XNA, is available from Windows Phone 7 Jump Start Training” on the Windows Phone Developer Blog (http:// windowsteamblog.com /windows_ phone/ b/wpdev/archive/2010/ 08/ 17 /windows- phone- 7- jump-start-training.aspx)... Sync Framework Synchronization for Windows Azure and Windows Phone 7 265 266 2 67 269 270 answers to questions Chapter 2: Designing Windows Phone 7 Applications Chapter 4: Building the Mobile Client Chapter 5: Using Services on the Phone Chapter 6: Connecting with Services Chapter 7: Interacting with Windows Marketplace 273 273 275 278 282 285 index 271 289 www.it-ebooks.info Foreword Great achievements... features of a Windows Phone 7 device www.it-ebooks.info introducing windows phone 7 figure 1 The features available on Windows Phone 7 devices www.it-ebooks.info 3 4 ch a pter one Windows Phone 7 is also an integrated part of the end-to-end application development and run-time story at Microsoft The wide range of powerful Microsoft frameworks, applications, and services work with Windows Phone 7 to provide... cloud-based surveys application on Windows Phone 7 You can download the application and run it on your own computer to see how it works and to experiment and reuse the code The application is provided in two versions to make it easier for you to see just the Windows Phone 7 client or the combined Windows Phone 7 and Windows Azure application If you want to try only the Windows Phone 7 client, you can run the... emulator for Windows Phone 7 You can obtain the Windows Phone Developer from the Windows Phone and Xbox 360® App Hub at http://create.msdn.com/ en-us/home/getting_started Note: You will also need to install the Windows Phone Developer Tools October 2010 Update from http://www.microsoft.com/ downloads/en/details.aspx?FamilyID=49B9D0C5-65 97- 4313912A-F0CCA9C7D 277 &displaylang=en For a simple walkthrough that... • Windows Phone Developer Tools • Microsoft Internet Information Services (IIS) 7. 0 • Microsoft NET Framework 4.0 or later www.it-ebooks.info xxii Alternatively, you can use Visual Studio 2010 to develop Windows Phone 7 applications instead of the version of Visual Studio Express that is included with the Windows Phone Developer Tools However, you must still install the Windows Phone Developer Tools... Vibration Alerts Web Browser Windows Marketplace Reactive Extensions d prism library for windows phone 7 About Prism for Windows Phone 7 Contents of Prism for Windows Phone 7 Library Microsoft.Practices.Prism Namespace Microsoft.Practices.Prism.Commands Namespace Microsoft.Practices.Prism.Events Namespace Microsoft.Practices.Prism.ViewModel Namespace www.it-ebooks.info 2 17 218 218 220 221 222 223 226... practices Windows Phone 7 Developer Guide community site on CodePlex (http://go.microsoft.com/fwlink/?LinkId=205602) What You Need to Use the Code These are the system requirements for running the scenarios: • Microsoft Windows Vista® operating system (x86 and x64) with Service Pack 2 (all editions except Starter Edition) or Microsoft Windows 7 (x86 and x64) (all editions except Starter Edition) • Windows Phone. .. capabilities for testing and debugging Windows Phone 7 applications and building more complex Windows Phone 7 application solutions If you want to run the full version of the example, which uses a Windows Azure service to provide the data and authentication services to the device, you must also install the following: • Windows Azure Tools for Microsoft Visual Studio 2010 • Windows Identity Foundation Who’s . • • • • • • • • • • • • • • • • • • • • • • • • • • WINDOWS ® PHONE 7 DEVELOPER GUIDE WINDOWS ® PHONE 7 DEVELOPER GUIDE For more information explore: msdn.microsoft.com/practices Software. Emulator or Device  Developing Web Applications for Windows Phone 7  Debugging Windows Phone 7 Applications  Unit Testing Windows Phone 7 Applications  Automated Unit Testing  Additional. Application Types for Mobile Phones  Silverlight and Windows Phone 7  Design Considerations for Windows Phone 7 Applications  User Interface Design and Style Guidelines  Application Deactivation

Ngày đăng: 28/04/2014, 17:10

Từ khóa liên quan

Mục lục

  • Contents

  • Foreword

  • Foreword

  • Preface

    • Who This Book Is For

    • Why This Book Is Pertinent Now

    • How This Book Is Structured

    • The Example Application

    • What You Need to Use the Code

    • Who’s Who

    • Where to Go for More Information

    • Acknowledgments

    • Chapter 1. Introducing Windows Phone 7

      • A Standardized Platform

      • Data-driven Applications

      • Developing for the Windows Phone 7 Platform

      • Terminology

      • More Information

      • Chapter 2. Designing Applications for Windows Phone 7

        • Basic Design Considerations

        • Mobile Phone Client Applications

        • Design Considerations for Windows Phone 7 Applications

        • Questions

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan